def create_branch(self, name=None, commit='HEAD'): repo = self._repo if name is None: print repo.branches, type(repo.branches) nb = NewBranchView(branches=repo.branches) info = nb.edit_traits() if info.result: name = nb.name else: return if name not in repo.branches: branch = repo.create_head(name, commit=commit) branch.checkout() self.information_dialog('Repository now on branch "{}"'.format(name)) return True
def create_branch(self, name=None, commit='HEAD'): if name is None: nb = NewBranchView() info = nb.edit_traits() if info.result: name = nb.name else: return repo = self._repo if name not in repo.branches: branch = repo.create_head(name, commit=commit) branch.checkout() self.information_dialog('Data set not on branch "{}"'.format(name)) else: self.information_dialog( 'Branch "{}" already exists. Choose a different name'.format( name))