changeset 19798:76df01e56e7f

update: improve error message for clean non-linear update
author Siddharth Agarwal <sid0@fb.com>
date Mon, 23 Sep 2013 17:43:33 -0700
parents a9abdb168425
children ab3e42225dbc
files mercurial/merge.py tests/test-issue1502.t tests/test-merge5.t tests/test-pull-update.t tests/test-update-branches.t
diffstat 5 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Sep 23 19:02:32 2013 -0700
+++ b/mercurial/merge.py	Mon Sep 23 17:43:33 2013 -0700
@@ -664,7 +664,7 @@
 
     x = can't happen
     * = don't-care
-    1 = abort: crosses branches (use 'hg merge' or 'hg update -c')
+    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
@@ -731,9 +731,9 @@
                                 " --clean to discard changes)")
                         raise util.Abort(msg)
                     else:  # node is none
-                        msg = _("crosses branches (merge branches or update"
-                                " --check to force update)")
-                        raise util.Abort(msg)
+                        msg = _("not a linear update")
+                        hint = _("merge or update --check to force update")
+                        raise util.Abort(msg, hint=hint)
                 else:
                     # Allow jumping branches if clean and specific rev given
                     pa = p1
--- a/tests/test-issue1502.t	Mon Sep 23 19:02:32 2013 -0700
+++ b/tests/test-issue1502.t	Mon Sep 23 17:43:33 2013 -0700
@@ -19,7 +19,8 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
-  not updating: crosses branches (merge branches or update --check to force update)
+  not updating: not a linear update
+  (merge or update --check to force update)
 
   $ hg -R foo1 book branchy
   $ hg -R foo1 book
--- a/tests/test-merge5.t	Mon Sep 23 19:02:32 2013 -0700
+++ b/tests/test-merge5.t	Mon Sep 23 17:43:33 2013 -0700
@@ -14,7 +14,8 @@
   $ hg update 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg update
-  abort: crosses branches (merge branches or update --check to force update)
+  abort: not a linear update
+  (merge or update --check to force update)
   [255]
   $ rm b
   $ hg update -c
--- a/tests/test-pull-update.t	Mon Sep 23 19:02:32 2013 -0700
+++ b/tests/test-pull-update.t	Mon Sep 23 17:43:33 2013 -0700
@@ -25,7 +25,8 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
-  not updating: crosses branches (merge branches or update --check to force update)
+  not updating: not a linear update
+  (merge or update --check to force update)
 
   $ cd ../tt
 
@@ -38,7 +39,8 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
-  not updating: crosses branches (merge branches or update --check to force update)
+  not updating: not a linear update
+  (merge or update --check to force update)
 
   $ HGMERGE=true hg merge
   merging foo
--- a/tests/test-update-branches.t	Mon Sep 23 19:02:32 2013 -0700
+++ b/tests/test-update-branches.t	Mon Sep 23 17:43:33 2013 -0700
@@ -94,7 +94,8 @@
   parent=5
 
   $ norevtest 'none clean same'   clean 2
-  abort: crosses branches (merge branches or update --check to force update)
+  abort: not a linear update
+  (merge or update --check to force update)
   parent=2