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

Stuart W. Marks smarks at smarks.org
Sun Nov 15 19:35:25 CST 2009


Any chance this can make it in for 1.4?

This is just a change to an error message so that it doesn't wrap across lines, 
as requested by Dirkjan. Includes corresponding test changes. Tests run cleanly:

# Ran 355 tests, 26 skipped, 0 failed.

(tests skipped because git, bzr, p4, inotify, etc. not installed)

Thanks.

s'marks

-------- Original Message --------
Subject: [PATCH] update: shorten abort message for updating across branches 
when unclean
Date: Thu, 12 Nov 2009 05:10:48 -0000
From: Stuart W Marks <smarks at smarks.org>
To: dirkjan at ochtman.nl
CC: mercurial-devel at selenic.com

# 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
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel at selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list