Ejemplo n.º 1
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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)