[Pkg-bazaar-commits] ./bzr-gtk/unstable r430: Handle conflicts appropriately

Aaron Bentley aaron at aaronbentley.com
Fri Apr 10 07:44:56 UTC 2009


------------------------------------------------------------
revno: 430
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: gtk-applymerge
timestamp: Sat 2008-02-23 01:37:01 -0500
message:
  Handle conflicts appropriately
modified:
  diff.py
-------------- next part --------------
=== modified file 'diff.py'
--- a/diff.py	2008-02-23 04:55:56 +0000
+++ b/diff.py	2008-02-23 06:37:01 +0000
@@ -36,7 +36,7 @@
 from bzrlib.patches import parse_patches
 from bzrlib.trace import warning
 from bzrlib.plugins.gtk.window import Window
-from dialog import error_dialog
+from dialog import error_dialog, info_dialog, warning_dialog
 
 
 class SelectCancelled(Exception):
@@ -476,8 +476,17 @@
                     self.directive, progress.DummyProgress())
                 merger.check_basis(True)
                 merger.merge_type = _mod_merge.Merge3Merger
+                conflict_count = merger.do_merge()
                 merger.set_pending()
-                conflict_count = merger.do_merge()
+                if conflict_count == 0:
+                    # No conflicts found.
+                    info_dialog(_('Merge successful'),
+                                _('All changes applied successfully.'))
+                else:
+                    # There are conflicts to be resolved.
+                    warning_dialog(_('Conflicts encountered'),
+                                   _('Please resolve the conflicts manually'
+                                     ' before committing.'))
                 self.destroy()
             except Exception, e:
                 error_dialog('Error', str(e))



More information about the Pkg-bazaar-commits mailing list