diff mercurial/merge.py @ 6350:6aa4a3fa4e60

update: no -C needed to switch branches without outstanding changes
author Matt Mackall <mpm@selenic.com>
date Sat, 22 Mar 2008 13:30:08 -0500
parents fda369b5779c
children cdc458b12f0f
line wrap: on
line diff
--- a/mercurial/merge.py	Sat Mar 22 19:01:09 2008 +0100
+++ b/mercurial/merge.py	Sat Mar 22 13:30:08 2008 -0500
@@ -364,8 +364,11 @@
                     raise util.Abort(_("there is nothing to merge, just use "
                                        "'hg update' or look at 'hg heads'"))
         elif not (overwrite or branchmerge):
-            raise util.Abort(_("update spans branches, use 'hg merge' "
-                               "or 'hg update -C' to lose changes"))
+            if wc.files() or wc.deleted():
+                raise util.Abort(_("update spans branches, use 'hg merge' "
+                                   "or 'hg update -C' to lose changes"))
+            # Allow jumping branches if there are no changes
+            overwrite = True
         if branchmerge and not forcemerge:
             if wc.files() or wc.deleted():
                 raise util.Abort(_("outstanding uncommitted changes"))