Patchwork [2,of,9] update: improve error message for clean non-linear update

login
register
mail settings
Submitter Siddharth Agarwal
Date Sept. 24, 2013, 4:50 a.m.
Message ID <eddb6f0b067c90910adb.1379998259@dev1091.prn1.facebook.com>
Download mbox | patch
Permalink /patch/2614/
State Accepted
Commit 76df01e56e7fe20e59b07117efbaf7aa46f1c8bb
Headers show

Comments

Siddharth Agarwal - Sept. 24, 2013, 4:50 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1379983413 25200
#      Mon Sep 23 17:43:33 2013 -0700
# Node ID eddb6f0b067c90910adb968dfb7eb798961e0ab2
# Parent  8c6dfa8dcc7a0afc32dad974efcd0070b05e4379
update: improve error message for clean non-linear update

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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
diff --git a/tests/test-issue1502.t b/tests/test-issue1502.t
--- a/tests/test-issue1502.t
+++ b/tests/test-issue1502.t
@@ -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
diff --git a/tests/test-merge5.t b/tests/test-merge5.t
--- a/tests/test-merge5.t
+++ b/tests/test-merge5.t
@@ -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
diff --git a/tests/test-pull-update.t b/tests/test-pull-update.t
--- a/tests/test-pull-update.t
+++ b/tests/test-pull-update.t
@@ -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
diff --git a/tests/test-update-branches.t b/tests/test-update-branches.t
--- a/tests/test-update-branches.t
+++ b/tests/test-update-branches.t
@@ -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