mercurial/merge.py
changeset 19799 ab3e42225dbc
parent 19798 76df01e56e7f
child 19800 4894e0d9462d
--- a/mercurial/merge.py	Mon Sep 23 17:43:33 2013 -0700
+++ b/mercurial/merge.py	Mon Sep 23 20:07:30 2013 -0700
@@ -656,19 +656,21 @@
     -c  -C  dirty  rev  |  linear   same  cross
      n   n    n     n   |    ok     (1)     x
      n   n    n     y   |    ok     ok     ok
-     n   n    y     *   |   merge   (2)    (2)
+     n   n    y     n   |   merge   (2)    (2)
+     n   n    y     y   |   merge   (3)    (3)
      n   y    *     *   |    ---  discard  ---
-     y   n    y     *   |    ---    (3)    ---
+     y   n    y     *   |    ---    (4)    ---
      y   n    n     *   |    ---    ok     ---
-     y   y    *     *   |    ---    (4)    ---
+     y   y    *     *   |    ---    (5)    ---
 
     x = can't happen
     * = don't-care
     1 = abort: not a linear update (merge or update --check to force update)
     2 = abort: crosses branches (use 'hg merge' to merge or
                  use 'hg update -C' to discard changes)
-    3 = abort: uncommitted local changes
-    4 = incompatible options (checked in commands.py)
+    3 = abort: uncommitted changes (commit or update --clean to discard changes)
+    4 = abort: uncommitted local changes
+    5 = incompatible options (checked in commands.py)
 
     Return the same tuple as applyupdates().
     """
@@ -726,10 +728,14 @@
                     # note: the <node> variable contains a random identifier
                     if repo[node].node() in foreground:
                         pa = p1  # allow updating to successors
-                    elif dirty:
+                    elif dirty and onode is None:
                         msg = _("crosses branches (merge branches or use"
                                 " --clean to discard changes)")
                         raise util.Abort(msg)
+                    elif dirty:
+                        msg = _("uncommitted changes")
+                        hint = _("commit or update --clean to discard changes")
+                        raise util.Abort(msg, hint=hint)
                     else:  # node is none
                         msg = _("not a linear update")
                         hint = _("merge or update --check to force update")