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))
def create_branch(self, name=None, commit='HEAD', inform=True): repo = self._repo if name is None: 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() if inform: self.information_dialog('Repository now on branch "{}"'.format(name)) return name
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))