diff mercurial/merge.py @ 19800:4894e0d9462d

update: improve error message for dirty non-linear update with rev
author Siddharth Agarwal <sid0@fb.com>
date Mon, 23 Sep 2013 20:08:52 -0700
parents ab3e42225dbc
children 41abe2e3e3b7
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Sep 23 20:07:30 2013 -0700
+++ b/mercurial/merge.py	Mon Sep 23 20:08:52 2013 -0700
@@ -666,8 +666,8 @@
     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)
+    2 = abort: uncommitted changes (commit and merge, or update --clean to
+                 discard changes)
     3 = abort: uncommitted changes (commit or update --clean to discard changes)
     4 = abort: uncommitted local changes
     5 = incompatible options (checked in commands.py)
@@ -728,13 +728,14 @@
                     # note: the <node> variable contains a random identifier
                     if repo[node].node() in foreground:
                         pa = p1  # allow updating to successors
-                    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")
+                        if onode is None:
+                            hint = _("commit and merge, or update --clean to"
+                                     " discard changes")
+                        else:
+                            hint = _("commit or update --clean to discard"
+                                     " changes")
                         raise util.Abort(msg, hint=hint)
                     else:  # node is none
                         msg = _("not a linear update")