/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/rename.py

  • Committer: Javier Derderian
  • Date: 2008-04-11 20:34:06 UTC
  • mto: (465.1.1 gtk.patch)
  • mto: This revision was merged to the branch mainline in revision 466.
  • Revision ID: javierder@gmail.com-20080411203406-ftlwyodw9vr87olv
Updated "Compare with..." (#78765) to use revbrowser.RevisionBrowser.
Also needed to fix #215872 to make it work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import bzrlib.errors as errors
29
29
from bzrlib.workingtree import WorkingTree
30
30
 
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
33
34
 
34
35
 
59
60
        
60
61
        self.window.show_all()
61
62
 
 
63
    @show_bzr_error
62
64
    def rename(self, widget):
63
65
        # Get entry
64
66
        old_filename = self.selected
78
80
        destination = os.path.join(self.wtpath, new_filename)
79
81
        
80
82
        # Rename the file
81
 
        try:
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))
84
85
 
85
 
            if wt1.basedir != wt2.basedir:
86
 
                error_dialog(_('Not the same branch'),
87
 
                             _('The destination is not in the same branch.'))
88
 
                return
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.'))
93
89
            return
94
 
        except errors.BzrError, msg:
95
 
            error_dialog(_('Unknown bzr error'), str(msg))
96
 
 
 
90
        wt1.rename_one(source, destination)
97
91
        self.close()
98
92
    
99
93
    def close(self, widget=None):