Python PySvn:提交从头构建的文件

Python PySvn:提交从头构建的文件,python,pysvn,Python,Pysvn,我想使用pysvn提交一个文件 以下是来自的代码: 我必须首先打开要提交的文件吗? 如果我从头构建了一个文件,并希望使用它替换svn repo中的现有文件,那么我必须如何继续 谢谢 import pysvn # edit the file foo.txt f = open('./examples/pysvn/foo.txt', 'w') f.write('Sample versioned file via python\n') f.close() # checkin the change wit

我想使用pysvn提交一个文件

以下是来自的代码:

我必须首先打开要提交的文件吗? 如果我从头构建了一个文件,并希望使用它替换svn repo中的现有文件,那么我必须如何继续

谢谢

import pysvn
# edit the file foo.txt
f = open('./examples/pysvn/foo.txt', 'w')
f.write('Sample versioned file via python\n')
f.close()
# checkin the change with a log message
client = pysvn.Client()
client.checkin(['./examples/pysvn'], 'Corrected spelling of python in foo.txt')