当前位置: 首页>>代码示例>>Python>>正文


Python SvnClient.get_branches方法代码示例

本文整理汇总了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))
开发者ID:jpgr87,项目名称:vcstools,代码行数:21,代码来源:test_svn.py

示例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())
开发者ID:jpgr87,项目名称:vcstools,代码行数:22,代码来源:test_svn.py


注:本文中的vcstools.svn.SvnClient.get_branches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。