本文整理汇总了Python中vcstools.svn.SvnClient.get_branches方法的典型用法代码示例。如果您正苦于以下问题:Python SvnClient.get_branches方法的具体用法?Python SvnClient.get_branches怎么用?Python SvnClient.get_branches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vcstools.svn.SvnClient
的用法示例。
在下文中一共展示了SvnClient.get_branches方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_branches
# 需要导入模块: from vcstools.svn import SvnClient [as 别名]
# 或者: from vcstools.svn.SvnClient import get_branches [as 别名]
def test_get_branches(self):
client = SvnClient(self.local_path)
self.assertEqual(['foo'], client.get_branches())
# slyly create some empty branches
subprocess.check_call("mkdir -p branches/foo2", shell=True, cwd=self.init_path)
subprocess.check_call("mkdir -p branches/bar", shell=True, cwd=self.init_path)
subprocess.check_call("svn add branches/foo2", shell=True, cwd=self.init_path)
subprocess.check_call("svn add branches/bar", shell=True, cwd=self.init_path)
subprocess.check_call("svn commit -m newbranches", shell=True, cwd=self.init_path)
self.assertEqual([], client.get_branches(local_only=True))
self.assertEqual(['bar', 'foo', 'foo2'], client.get_branches())
# checkout branch foo
local_path2 = os.path.join(self.root_directory, "local_foo")
client = SvnClient(local_path2)
client.checkout(self.local_root_url + '/branches/foo')
self.assertEqual(['foo'], client.get_branches(local_only=True))
示例2: test_get_branches_non_canonical
# 需要导入模块: from vcstools.svn import SvnClient [as 别名]
# 或者: from vcstools.svn.SvnClient import get_branches [as 别名]
def test_get_branches_non_canonical(self):
remote_path = os.path.join(self.root_directory, "remote_nc")
init_path = os.path.join(self.root_directory, "init_nc")
local_path = os.path.join(self.root_directory, "local_nc")
# create a "remote" repo
subprocess.check_call("svnadmin create %s" % remote_path, shell=True, cwd=self.root_directory)
local_root_url = "file://localhost/" + remote_path
local_url = local_root_url + "/footest"
# create an "init" repo to populate remote repo
subprocess.check_call("svn checkout %s %s" % (local_root_url, init_path), shell=True, cwd=self.root_directory)
for cmd in [
"mkdir footest",
"mkdir footest/foosub",
"touch footest/foosub/fixed.txt",
"svn add footest",
"svn commit -m initial"]:
subprocess.check_call(cmd, shell=True, cwd=init_path)
client = SvnClient(local_path)
client.checkout(local_url)
self.assertEqual([], client.get_branches())