[PATCH stable] update: shorten abort message for updating across branches when unclean

Stuart W Marks smarks at smarks.org
Mon Nov 30 23:14:14 CST 2009


# HG changeset patch
# User Stuart W Marks <smarks at smarks.org>
# Date 1259644368 28800
# Node ID d83d2ede9f37e312a5a6a143dd244dcef74494ba
# Parent  2e67734e1453e44de0816c3f562005e89c09c21f
update: shorten abort message for updating across branches when unclean

The old message is too long, as it wraps across lines. Shorten it to
fit onto a single line. Minor tweaks to merge.update() docstring.

diff -r 2e67734e1453 -r d83d2ede9f37 mercurial/merge.py
--- a/mercurial/merge.py	Tue Dec 01 01:43:46 2009 +0100
+++ b/mercurial/merge.py	Mon Nov 30 21:12:48 2009 -0800
@@ -429,10 +429,9 @@
     x = can't happen
     * = don't-care
     1 = abort: crosses branches (use 'hg merge' or 'hg update -c')
-    2 = abort: crosses branches (use 'hg merge' to merge or
-                 use 'hg update -C' to discard changes)
-    3 = abort: uncommitted local changes
-    4 = incompatible options (checked in commands.py)
+    2 = abort: can't cross branches when there are uncommitted changes
+    3 = abort: uncommitted local changes [checked in commands.py]
+    4 = incompatible options [checked in commands.py]
     """
 
     onode = node
@@ -474,8 +473,8 @@
             if pa == p1 or pa == p2: # linear
                 pass # all good
             elif wc.files() or wc.deleted():
-                raise util.Abort(_("crosses branches (use 'hg merge' to merge "
-                                 "or use 'hg update -C' to discard changes)"))
+                raise util.Abort(_("can't cross branches when there are "
+                                   "uncommitted changes"))
             elif onode is None:
                 raise util.Abort(_("crosses branches (use 'hg merge' or use "
                                    "'hg update -c')"))
diff -r 2e67734e1453 -r d83d2ede9f37 tests/test-merge5.out
--- a/tests/test-merge5.out	Tue Dec 01 01:43:46 2009 +0100
+++ b/tests/test-merge5.out	Mon Nov 30 21:12:48 2009 -0800
@@ -2,6 +2,6 @@
 removing b
 created new head
 % should abort
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+abort: can't cross branches when there are uncommitted changes
 % should succeed
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
diff -r 2e67734e1453 -r d83d2ede9f37 tests/test-up-local-change.out
--- a/tests/test-up-local-change.out	Tue Dec 01 01:43:46 2009 +0100
+++ b/tests/test-up-local-change.out	Mon Nov 30 21:12:48 2009 -0800
@@ -111,7 +111,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     2
 
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+abort: can't cross branches when there are uncommitted changes
 failed
 abort: outstanding uncommitted changes (use 'hg status' to list changes)
 failed
diff -r 2e67734e1453 -r d83d2ede9f37 tests/test-update-branches.out
--- a/tests/test-update-branches.out	Tue Dec 01 01:43:46 2009 +0100
+++ b/tests/test-update-branches.out	Mon Nov 30 21:12:48 2009 -0800
@@ -32,11 +32,11 @@
 parent=2
 M foo
 % revtest none dirty same 2 3
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+abort: can't cross branches when there are uncommitted changes
 parent=2
 M foo
 % revtest none dirty cross 3 4
-abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes)
+abort: can't cross branches when there are uncommitted changes
 parent=3
 M foo
 % revtest -C dirty linear 1 2


More information about the Mercurial-devel mailing list