28
28
import bzrlib.errors as errors
29
29
from bzrlib.workingtree import WorkingTree
31
from dialog import error_dialog
31
from errors import show_bzr_error
32
from bzrlib.plugins.gtk.dialog import error_dialog
32
33
from guifiles import GLADEFILENAME
78
80
destination = os.path.join(self.wtpath, new_filename)
82
wt1, path1 = WorkingTree.open_containing(self.wt.abspath(source))
83
wt2, path2 = WorkingTree.open_containing(self.wt.abspath(source))
83
wt1, path1 = WorkingTree.open_containing(self.wt.abspath(source))
84
wt2, path2 = WorkingTree.open_containing(self.wt.abspath(source))
85
if wt1.basedir != wt2.basedir:
86
error_dialog(_('Not the same branch'),
87
_('The destination is not in the same branch.'))
89
wt1.rename_one(source, destination)
90
except errors.NotBranchError:
91
error_dialog(_('File is not in a branch'),
92
_('The selected file is not in a branch.'))
86
if wt1.basedir != wt2.basedir:
87
error_dialog(_('Not the same branch'),
88
_('The destination is not in the same branch.'))
94
except errors.BzrError, msg:
95
error_dialog(_('Unknown bzr error'), str(msg))
90
wt1.rename_one(source, destination)
99
93
def close(self, widget=None):