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

Stuart W Marks smarks at smarks.org
Wed Nov 11 23:10:48 CST 2009


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

diff -r 0d850f8beea6 -r 2c362fdf1ce2 mercurial/merge.py
--- a/mercurial/merge.py	Wed Nov 04 13:44:15 2009 -0600
+++ b/mercurial/merge.py	Wed Nov 11 20:54:19 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 0d850f8beea6 -r 2c362fdf1ce2 tests/test-merge5.out
--- a/tests/test-merge5.out	Wed Nov 04 13:44:15 2009 -0600
+++ b/tests/test-merge5.out	Wed Nov 11 20:54:19 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 0d850f8beea6 -r 2c362fdf1ce2 tests/test-up-local-change.out
--- a/tests/test-up-local-change.out	Wed Nov 04 13:44:15 2009 -0600
+++ b/tests/test-up-local-change.out	Wed Nov 11 20:54:19 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 0d850f8beea6 -r 2c362fdf1ce2 tests/test-update-branches.out
--- a/tests/test-update-branches.out	Wed Nov 04 13:44:15 2009 -0600
+++ b/tests/test-update-branches.out	Wed Nov 11 20:54:19 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