使用 pysvn 包中的 import_() 函数

Using import_() function from pysvn package

我想知道如何使用 pysvn 包中的函数 import_() 但我不完全理解它需要的所有不同参数。

任何人都可以给我一个如何使用它的例子吗?

提前致谢

Anyone can give me an example of how to use it?

下面的程序演示了client.import_()的用法。该程序执行与命令行完全相同的功能:

svn import /tmp/example svn+ssh://t420/svnroot/trunk/example -m "Initial checkin"

示例程序(x.py):

import pysvn
client = pysvn.Client()
client.import_(path='/tmp/example',
               url=u'svn+ssh://t420/svnroot/trunk/example',
               log_message='Initial checkin')

结果:

$ ls /tmp/example
hello.py  hello.txt
$ python x.py 
$ svn ls svn+ssh://t420/svnroot/trunk/example
hello.py
hello.txt