Patchwork [4,of,4,V4] update: also suggest --merge when non-linear update is aborted

login
register
mail settings
Submitter via Mercurial-devel
Date Feb. 16, 2017, 4:59 p.m.
Message ID <23ce2ec6c9b701f0eaca.1487264355@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/18560/
State Superseded
Headers show

Comments

via Mercurial-devel - Feb. 16, 2017, 4:59 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1487140898 28800
#      Tue Feb 14 22:41:38 2017 -0800
# Node ID 23ce2ec6c9b701f0eacac61df7048cfd36fa47fc
# Parent  572ffc6ab9724bb7b1d4d3315fd8deaf9d52461a
update: also suggest --merge when non-linear update is aborted

Patch

diff -r 572ffc6ab972 -r 23ce2ec6c9b7 mercurial/merge.py
--- a/mercurial/merge.py	Mon Feb 13 00:05:55 2017 -0800
+++ b/mercurial/merge.py	Tue Feb 14 22:41:38 2017 -0800
@@ -1570,7 +1570,8 @@ 
                         pass # allow updating to successors
                     else:
                         msg = _("uncommitted changes")
-                        hint = _("commit or update --clean to discard changes")
+                        hint = _("commit, or use --clean to discard changes, "
+                                 "or use --merge to allow update")
                         raise error.UpdateAbort(msg, hint=hint)
                 else:
                     # Allow jumping branches if clean and specific rev given
diff -r 572ffc6ab972 -r 23ce2ec6c9b7 tests/test-merge5.t
--- a/tests/test-merge5.t	Mon Feb 13 00:05:55 2017 -0800
+++ b/tests/test-merge5.t	Tue Feb 14 22:41:38 2017 -0800
@@ -26,7 +26,7 @@ 
 
   $ hg update 1
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   [255]
   $ mv c a
 
diff -r 572ffc6ab972 -r 23ce2ec6c9b7 tests/test-subrepo-svn.t
--- a/tests/test-subrepo-svn.t	Mon Feb 13 00:05:55 2017 -0800
+++ b/tests/test-subrepo-svn.t	Tue Feb 14 22:41:38 2017 -0800
@@ -472,7 +472,7 @@ 
   $ echo "updating should (maybe) fail" > obstruct/other
   $ hg co tip
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   [255]
 
 Point to a Subversion branch which has since been deleted and recreated
diff -r 572ffc6ab972 -r 23ce2ec6c9b7 tests/test-update-branches.t
--- a/tests/test-update-branches.t	Mon Feb 13 00:05:55 2017 -0800
+++ b/tests/test-update-branches.t	Tue Feb 14 22:41:38 2017 -0800
@@ -123,19 +123,19 @@ 
 
   $ revtest 'none dirty same'   dirty 2 3
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   parent=2
   M foo
 
   $ revtest 'none dirtysub same'   dirtysub 2 3
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   parent=2
   M sub/suba
 
   $ revtest 'none dirty cross'  dirty 3 4
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   parent=3
   M foo
 
@@ -147,7 +147,7 @@ 
 
   $ revtest 'none dirtysub cross'  dirtysub 3 4
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   parent=3
   M sub/suba
 
@@ -319,7 +319,7 @@ 
 
   $ revtest 'dirty cross'  dirty 3 4
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   parent=3
   M foo
 
@@ -537,7 +537,7 @@ 
   $ hg up --quiet 2
   $ hg up 5
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit, or use --clean to discard changes, or use --merge to allow update)
   [255]
 
 Test that we don't crash when updating from a pruned changeset (i.e. has no