[PATCH 2 of 3] destutil: make messages at updating to the closed head usual form

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Fri Mar 25 21:57:36 EDT 2016


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1458957211 -32400
#      Sat Mar 26 10:53:31 2016 +0900
# Node ID 38fff615b9baa28152cc346e90b5cc2927aae7ec
# Parent  dc5ed2fb19f5d5d34d62cf6ece1f38269eb11684
destutil: make messages at updating to the closed head usual form

This patch makes messages at updating to the closed head usual form
for Mercurial as below:

    one line description of the problem with no period
    (a suggestion about how to move forward or get more info)

diff --git a/mercurial/destutil.py b/mercurial/destutil.py
--- a/mercurial/destutil.py
+++ b/mercurial/destutil.py
@@ -397,10 +397,9 @@ def _statusotherbranchheads(ui, repo):
         #  ========= ==========
         otherheads = repo.revs('%ln - parents()', heads)
         if repo['.'].closesbranch():
-            ui.status(_('updated to a closed branch head, '
-                        'because all descendant heads are closed.\n'
-                        'beware of re-opening closed head '
-                        'by subsequent commit here.\n'))
+            ui.status(_('no open descendant branch heads, '
+                        'updating to a closed head\n'
+                        '(committing will reopen the branch)\n'))
             if otherheads:
                 ui.status(_('%i other heads for branch "%s"\n') %
                           (len(otherheads), currentbranch))
diff --git a/tests/test-convert-mtn.t b/tests/test-convert-mtn.t
--- a/tests/test-convert-mtn.t
+++ b/tests/test-convert-mtn.t
@@ -260,8 +260,8 @@ convert incrementally
   $ cd repo.mtn-hg
   $ hg up -C
   12 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to a closed branch head, because all descendant heads are closed.
-  beware of re-opening closed head by subsequent commit here.
+  no open descendant branch heads, updating to a closed head
+  (committing will reopen the branch)
   all heads for branch "com.selenic.test" are closed.
   $ glog
   @  14 "largefile" files: large-file
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
@@ -194,8 +194,8 @@ if on the closed branch head:
   $ hg commit --close-branch -m 6
   $ norevtest "on closed branch head" clean 6
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to a closed branch head, because all descendant heads are closed.
-  beware of re-opening closed head by subsequent commit here.
+  no open descendant branch heads, updating to a closed head
+  (committing will reopen the branch)
   1 other heads for branch "default"
   parent=6
 
@@ -214,8 +214,8 @@ if all descendant branch heads are close
 
   $ norevtest "all descendant branch heads are closed" clean 3
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to a closed branch head, because all descendant heads are closed.
-  beware of re-opening closed head by subsequent commit here.
+  no open descendant branch heads, updating to a closed head
+  (committing will reopen the branch)
   1 other heads for branch "default"
   parent=6
 
@@ -230,8 +230,8 @@ if on the closed branch head:
   $ hg commit --close-branch -m 7
   $ norevtest "all heads of branch default are closed" clean 6
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to a closed branch head, because all descendant heads are closed.
-  beware of re-opening closed head by subsequent commit here.
+  no open descendant branch heads, updating to a closed head
+  (committing will reopen the branch)
   all heads for branch "default" are closed.
   parent=6
 
@@ -242,8 +242,8 @@ if not on the closed branch head:
 
   $ norevtest "all heads of branch default are closed" clean 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to a closed branch head, because all descendant heads are closed.
-  beware of re-opening closed head by subsequent commit here.
+  no open descendant branch heads, updating to a closed head
+  (committing will reopen the branch)
   all heads for branch "default" are closed.
   parent=7
 
@@ -286,8 +286,8 @@ if all branch heads are closed
 
   $ norevtest "all branches are closed" clean null
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to a closed branch head, because all descendant heads are closed.
-  beware of re-opening closed head by subsequent commit here.
+  no open descendant branch heads, updating to a closed head
+  (committing will reopen the branch)
   all heads for branch "foobar" are closed.
   parent=4
 


More information about the Mercurial-devel mailing list