diff mercurial/commands.py @ 25382:6084926366b9

summary: move the parents phase marker to commit line (issue4688) The phase of the pending commit depends on the parent of the working directory and on the phases.newcommit configuration. First, this information rather depend on the commit line which describe the pending commit. Then, we only want to be advertised when the pending phase is going to be higher than the default new commit phase. So the format will change from $ hg summary parent: 2:ab91dfabc5ad foo parent: 3:24f1031ad244 tip bar branch: default commit: 1 modified, 1 unknown, 1 unresolved (merge) update: (current) phases: 1 secret (secret) to parent: 2:ab91dfabc5ad foo parent: 3:24f1031ad244 tip bar branch: default commit: 1 modified, 1 unknown, 1 unresolved (merge) (secret) update: (current) phases: 1 secret
author Gilles Moris <gilles.moris@free.fr>
date Fri, 29 May 2015 22:23:58 +0200
parents ae38370fe282
children d0c7ffc4c8bc
line wrap: on
line diff
--- a/mercurial/commands.py	Mon May 25 16:48:55 2015 -0700
+++ b/mercurial/commands.py	Fri May 29 22:23:58 2015 +0200
@@ -6004,6 +6004,14 @@
     elif pnode not in bheads:
         t += _(' (new branch head)')
 
+    if parents:
+        pendingphase = max(p.phase() for p in parents)
+    else:
+        pendingphase = phases.public
+
+    if pendingphase > phases.newcommitphase(ui):
+        t += ' (%s)' % phases.phasenames[pendingphase]
+
     if cleanworkdir:
         # i18n: column positioning for "hg summary"
         ui.status(_('commit: %s\n') % t.strip())
@@ -6034,16 +6042,8 @@
     if secret:
         t.append(_('%d secret') % secret)
 
-    if parents:
-        parentphase = max(p.phase() for p in parents)
-    else:
-        parentphase = phases.public
-
     if draft or secret:
-        ui.status(_('phases: %s (%s)\n') % (', '.join(t),
-                                            phases.phasenames[parentphase]))
-    else:
-        ui.note(_('phases: (%s)\n') % phases.phasenames[parentphase])
+        ui.status(_('phases: %s\n') % ', '.join(t))
 
     cmdutil.summaryhooks(ui, repo)