def run(self, merge_from_path=None): from bzrlib.plugins.gtk.dialog import error_dialog from bzrlib.plugins.gtk.merge import MergeDialog (wt, path) = workingtree.WorkingTree.open_containing('.') old_tree = wt.branch.repository.revision_tree(wt.branch.last_revision()) delta = wt.changes_from(old_tree) if len(delta.added) or len(delta.removed) or len(delta.renamed) or len(delta.modified): error_dialog(_i18n('There are local changes in the branch'), _i18n('Please commit or revert the changes before merging.')) else: parent_branch_path = wt.branch.get_parent() merge = MergeDialog(wt, path, parent_branch_path) response = merge.run() merge.destroy()
def merge_cb(self, menu, vfs_file): # We can only cope with local files if vfs_file.get_uri_scheme() != 'file': return file = vfs_file.get_uri() # We only want to continue here if we get a NotBranchError try: tree, path = WorkingTree.open_containing(file) except NotBranchError: return from bzrlib.plugins.gtk.merge import MergeDialog dialog = MergeDialog(tree, path) dialog.run() dialog.destroy()
def merge_cb(self, menu, tree, path=None): from bzrlib.plugins.gtk.merge import MergeDialog dialog = MergeDialog(tree, path) dialog.run() dialog.destroy()