[Request] [+ ] D8646: update: suggest --merge while `hg up` across topo branches

khanchi97 (Sushil khanchi) phabricator at mercurial-scm.org
Mon Jun 22 02:12:57 UTC 2020


khanchi97 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Before this patch, during `hg up` across topological branches with
  dirty working directory we suggested the user to "commit or update
  --clean to discard"
  
  I think suggesting --merge is better than --clean (which discard
  changes with no backup). We can keep all the three options, but
  probably then we will have sacrifice length of message.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8646

AFFECTED FILES
  mercurial/merge.py
  tests/test-merge5.t
  tests/test-update-branches.t

CHANGE DETAILS

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
@@ -129,19 +129,19 @@
 
   $ revtest 'none dirty same'   dirty 2 3
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   parent=2
   M foo
 
   $ revtest 'none dirtysub same'   dirtysub 2 3
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   parent=2
   M sub/suba
 
   $ revtest 'none dirty cross'  dirty 3 4
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   parent=3
   M foo
 
@@ -154,7 +154,7 @@
 
   $ revtest 'none dirtysub cross'  dirtysub 3 4
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   parent=3
   M sub/suba
 
@@ -368,7 +368,7 @@
 
   $ revtest 'dirty cross'  dirty 3 4
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   parent=3
   M foo
 
@@ -572,7 +572,7 @@
   $ echo conflict > a
   $ hg up --hidden 3
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   [255]
 
 Test that we still warn also when there are conflicts
@@ -673,7 +673,7 @@
   $ hg up --quiet 2
   $ hg up 5
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   [255]
 
 Test that we don't crash when updating from a pruned changeset (i.e. has no
diff --git a/tests/test-merge5.t b/tests/test-merge5.t
--- a/tests/test-merge5.t
+++ b/tests/test-merge5.t
@@ -26,7 +26,7 @@
 
   $ hg update 1
   abort: uncommitted changes
-  (commit or update --clean to discard changes)
+  (commit or update --merge to take along changes)
   [255]
   $ mv c a
 
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1644,7 +1644,7 @@
                         pass  # allow updating to successors
                     else:
                         msg = _(b"uncommitted changes")
-                        hint = _(b"commit or update --clean to discard changes")
+                        hint = _(b"commit or update --merge to take along changes")
                         raise error.UpdateAbort(msg, hint=hint)
                 else:
                     # Allow jumping branches if clean and specific rev given



To: khanchi97, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200622/4707703d/attachment.html>


More information about the Mercurial-patches mailing list