mercurial/commands.py
changeset 25111 1ef96a3b8b89
parent 25082 e30b66bb7d4d
child 25119 49c583ca48c4
--- a/mercurial/commands.py	Fri May 15 12:19:51 2015 +0800
+++ b/mercurial/commands.py	Thu May 14 17:38:38 2015 +0200
@@ -5869,7 +5869,7 @@
     """summarize working directory state
 
     This generates a brief summary of the working directory state,
-    including parents, branch, commit status, and available updates.
+    including parents, branch, commit status, phase and available updates.
 
     With the --remote option, this will check the default paths for
     incoming and outgoing changes. This can be time-consuming.
@@ -5997,6 +5997,25 @@
         ui.write(_('update: %d new changesets, %d branch heads (merge)\n') %
                  (new, len(bheads)))
 
+    t = []
+    draft = len(repo.revs('draft()'))
+    if draft:
+        t.append(_('%d draft') % draft)
+    secret = len(repo.revs('secret()'))
+    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])
+
     cmdutil.summaryhooks(ui, repo)
 
     if opts.get('remote'):