/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/__init__.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-12-18 09:35:14 UTC
  • Revision ID: szilveszter.farkas@gmail.com-20061218093514-02lljnn69hdfzu6b
Do not allow merge if there are local changes (Fixed: #73770).

Show diffs side-by-side

added added

removed removed

Lines of Context:
229
229
    def on_menuitem_branch_merge_activate(self, widget):
230
230
        """ Branch/Merge... menu handler. """
231
231
        from merge import MergeDialog
232
 
        merge = MergeDialog(self.wt, self.wtpath)
233
 
        merge.display()
 
232
        
 
233
        if self.check_for_changes():
 
234
            error_dialog(_('There are local changes in the branch'),
 
235
                         _('Please commit or revert the changes before merging.'))
 
236
        else:
 
237
            merge = MergeDialog(self.wt, self.wtpath)
 
238
            merge.display()
234
239
 
235
240
    def on_menuitem_branch_missing_revisions_activate(self, widget):
236
241
        """ Branch/Missing revisions menu handler. """
837
842
            drive = model[active][0]
838
843
            self.set_path(drive + '\\')
839
844
            self.refresh_right(drive + '\\')
 
845
    
 
846
    def check_for_changes(self):
 
847
        """ Check whether there were changes in the current working tree. """
 
848
        old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
 
849
        delta = self.wt.changes_from(old_tree)
 
850
 
 
851
        changes = False
 
852
        
 
853
        if len(delta.added) or len(delta.removed) or len(delta.renamed) or len(delta.modified):
 
854
            changes = True
 
855
        
 
856
        return changes
840
857
 
841
858
import ConfigParser
842
859