假设SVN服务器上的目录结构与此类似:
/ mainfolder
../ subfolder1
-big-file1.xlm
-small-file1.txt
../ subfolder2
-big-file2.xlm
-small-file2.txt
Python脚本中的签出函数如下所示:
client = pysvn.Client()
client.callback_get_login = svnlogin
try:
client.checkout(svnurl()+"/mainfolder",
'./examples/pysvntest')
print("done")
except pysvn.ClientError as e:
print("SVN Error occured: ", e)
如何将函数限制为仅签出small-file
?
可以是文件类型、文件大小(或其他智能方式)
您可以使用
client.ls()
(或client.list()
)找到需要获取的文件路径,然后过滤结果。 注意您无法签出单个文件,因此需要使用client.export()
或client.cat()
以下代码应为您提供一个起点:
相关问题 更多 >
编程相关推荐