Patchwork [2,of,2] update: for "noconflict" updates, print "conflicting changes" on conflict

login
register
mail settings
Submitter via Mercurial-devel
Date March 7, 2017, 7:50 a.m.
Message ID <426835372fed3048a413.1488873038@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/18953/
State Accepted
Headers show

Comments

via Mercurial-devel - March 7, 2017, 7:50 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1488871287 28800
#      Mon Mar 06 23:21:27 2017 -0800
# Node ID 426835372fed3048a413eb210ed527886912cbfc
# Parent  76aa7c5b624792a316c6e028b77a59aee95e5a3b
update: for "noconflict" updates, print "conflicting changes" on conflict

With experimental.updatecheck=noconflict, if the update is aborted
because of conlicts, "uncommitted changes" is not quite
accurate. Let's use "conflicting changes" instead. Also fix the hint
to recomment --clean, not --merge, since that's what we do for other
failed updates.
Yuya Nishihara - March 7, 2017, 1:40 p.m.
On Mon, 06 Mar 2017 23:50:38 -0800, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1488871287 28800
> #      Mon Mar 06 23:21:27 2017 -0800
> # Node ID 426835372fed3048a413eb210ed527886912cbfc
> # Parent  76aa7c5b624792a316c6e028b77a59aee95e5a3b
> update: for "noconflict" updates, print "conflicting changes" on conflict

Thanks, queued these.

(I only read the first paragraph of Ryan's comment, so missed this one.)

Patch

diff -r 76aa7c5b6247 -r 426835372fed mercurial/merge.py
--- a/mercurial/merge.py	Mon Mar 06 23:19:57 2017 -0800
+++ b/mercurial/merge.py	Mon Mar 06 23:21:27 2017 -0800
@@ -1602,8 +1602,8 @@ 
         if updatecheck == 'noconflict':
             for f, (m, args, msg) in actionbyfile.iteritems():
                 if m not in ('g', 'k', 'r'):
-                    msg = _("uncommitted changes")
-                    hint = _("commit or update --merge to allow merge")
+                    msg = _("conflicting changes")
+                    hint = _("commit or update --clean to discard changes")
                     raise error.Abort(msg, hint=hint)
 
         # Prompt and create actions. Most of this is in the resolve phase
diff -r 76aa7c5b6247 -r 426835372fed tests/test-update-branches.t
--- a/tests/test-update-branches.t	Mon Mar 06 23:19:57 2017 -0800
+++ b/tests/test-update-branches.t	Mon Mar 06 23:21:27 2017 -0800
@@ -295,8 +295,8 @@ 
   $ hg up -qC 3
   $ echo dirty >> a
   $ hg up -q 4
-  abort: uncommitted changes
-  (commit or update --merge to allow merge)
+  abort: conflicting changes
+  (commit or update --clean to discard changes)
   [255]
   $ hg up -m 4
   merging a