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

Stuart W Marks smarks at smarks.org
Mon Nov 30 00:48:21 CST 2009


# HG changeset patch
# User Stuart W Marks <smarks at smarks.org>
# Date 1259563676 28800
# Node ID 72b86e48744a6ecc6111decc49d4bc5125ece6dd
# Parent  0347eb4d2236b21dfd99fce9eb44349042606883
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.

diff -r 0347eb4d2236 -r 72b86e48744a mercurial/merge.py
--- a/mercurial/merge.py	Sat Nov 28 23:58:03 2009 +0100
+++ b/mercurial/merge.py	Sun Nov 29 22:47:56 2009 -0800
@@ -474,8 +474,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 0347eb4d2236 -r 72b86e48744a tests/test-merge5.out
--- a/tests/test-merge5.out	Sat Nov 28 23:58:03 2009 +0100
+++ b/tests/test-merge5.out	Sun Nov 29 22:47:56 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 0347eb4d2236 -r 72b86e48744a tests/test-up-local-change.out
--- a/tests/test-up-local-change.out	Sat Nov 28 23:58:03 2009 +0100
+++ b/tests/test-up-local-change.out	Sun Nov 29 22:47:56 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 0347eb4d2236 -r 72b86e48744a tests/test-update-branches.out
--- a/tests/test-update-branches.out	Sat Nov 28 23:58:03 2009 +0100
+++ b/tests/test-update-branches.out	Sun Nov 29 22:47:56 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