/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: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-27 19:11:59 UTC
  • mfrom: (0.8.90 merge)
  • mto: (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 103.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060927191159-cc4e54f613575779
Merge all changes. Release 0.11.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
except:
29
29
    sys.exit(1)
30
30
 
31
 
import olive.backend.errors as errors
32
 
import olive.backend.fileops as fileops
 
31
import bzrlib.errors as errors
33
32
 
34
33
class OliveRename:
35
34
    """ Display the Rename dialog and perform the needed actions. """
78
77
        
79
78
        # Rename the file
80
79
        try:
81
 
            fileops.rename(source, destination)
 
80
            wt1, path1 = WorkingTree.open_containing(source)
 
81
            wt2, path2 = WorkingTree.open_containing(source)
 
82
 
 
83
            if wt1.base != wt2.base:
 
84
                self.dialog.error_dialog(_('Not the same branch'),
 
85
                                         _('The destination is not in the same branch.'))
 
86
                return
 
87
            wt1.rename_one(source, destination)
82
88
        except errors.NotBranchError:
83
89
            self.dialog.error_dialog(_('File is not in a branch'),
84
90
                                     _('The selected file is not in a branch.'))
85
91
            return
86
 
        except errors.NotSameBranchError:
87
 
            self.dialog.error_dialog(_('Not the same branch'),
88
 
                                     _('The destination is not in the same branch.'))
89
 
            return
90
 
        except:
91
 
            raise
92
92
 
93
93
        self.close()
94
94
        self.comm.refresh_right()