Patchwork [6,of,6,V2] summary: display obsolete state of parents

login
register
mail settings
Submitter Denis Laxalde
Date March 28, 2017, 9:09 p.m.
Message ID <390382cc1218e11ad725.1490735344@marimba>
Download mbox | patch
Permalink /patch/19796/
State Accepted
Headers show

Comments

Denis Laxalde - March 28, 2017, 9:09 p.m.
# HG changeset patch
# User Denis Laxalde <denis@laxalde.org>
# Date 1490437808 -3600
#      Sat Mar 25 11:30:08 2017 +0100
# Node ID 390382cc1218e11ad7258d54bce590288cafbad2
# Parent  2c19dbbb54ff65847d93665072f4452ab9e357e8
# Available At https://bitbucket.org/dlax/hg-work
#              hg pull https://bitbucket.org/dlax/hg-work -r 390382cc1218
# EXP-Topic obsolete-ui
summary: display obsolete state of parents

Extend the "parent: " lines in summary to display "(obsolete)" when the parent
is obsolete.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4826,6 +4826,8 @@  def summary(ui, repo, **opts):
                 ui.write(_(' (empty repository)'))
             else:
                 ui.write(_(' (no revision checked out)'))
+        if p.obsolete():
+            ui.write(_(' (obsolete)'))
         if p.troubled():
             ui.write(' ('
                      + ', '.join(ui.label(trouble, 'trouble.%s' % trouble)
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -851,6 +851,17 @@  test summary output
   phases: 4 draft
   unstable: 2 changesets
   bumped: 1 changesets
+  $ hg up -r 'obsolete()'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg summary
+  parent: 6:3de5eca88c00  (obsolete)
+   add obsolete_e
+  branch: default
+  commit: (clean)
+  update: 3 new changesets (update)
+  phases: 4 draft
+  unstable: 2 changesets
+  bumped: 1 changesets
 
 Test incoming/outcoming with changesets obsoleted remotely, known locally
 ===============================================================================