示例#1
0
文件: tree.py 项目: broesamle/servo
    def unique_branch_name(self, prefix):
        """Get an unused branch name in the local tree

        :param prefix: Prefix to use at the start of the branch name"""
        branches = [ref[len("refs/heads/"):] for sha1, ref in self.list_refs()
                    if ref.startswith("refs/heads/")]
        return get_unique_name(branches, prefix)
示例#2
0
    def unique_branch_name(self, prefix):
        """Get an unused branch name in the local tree

        :param prefix: Prefix to use at the start of the branch name"""
        branches = [ref[len("refs/heads/"):] for sha1, ref in self.list_refs()
                    if ref.startswith("refs/heads/")]
        return get_unique_name(branches, prefix)
示例#3
0
 def create(self, state):
     remote_branch = "sync_%s" % state.commit.sha1
     branches = [
         ref[len("refs/heads/"):]
         for sha1, ref in state.sync_tree.list_remote(state.gh_repo.url)
         if ref.startswith("refs/heads")
     ]
     state.remote_branch = get_unique_name(branches, remote_branch)
示例#4
0
 def create(self, state):
     remote_branch = "sync_%s" % state.commit.sha1
     branches = [
         ref[len("refs/heads/"):]
         for sha1, ref in state.sync_tree.list_remote(state.gh_repo.url)
         if ref.startswith("refs/heads")
     ]
     state.remote_branch = get_unique_name(branches, remote_branch)