[PATCH 4 of 6 OBSOLETE-MARKERS] obsolete: display information in log if a changeset is obsolete

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat May 12 12:08:52 CDT 2012


# HG changeset patch
# User Pierre-Yves.David at ens-lyon.org
# Date 1336837293 -7200
# Node ID 0d39a100bf11a38b76abdc79b307c3518bd08efd
# Parent  e89cc71b7fa9f33de4f8decb941ef0d719fdcb62
obsolete: display information in log if a changeset is obsolete

This changeset add a new line in default log output if a changeset is obsolete:

    obsolete:     dead

I'm not very happy about it but having something to test obsolete marker is
useful. Moreover, this should not impact anybody as normal people avec not
expected to lay obsolete marker.

diff -r e89cc71b7fa9 -r 0d39a100bf11 mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sat May 12 17:39:49 2012 +0200
+++ b/mercurial/cmdutil.py	Sat May 12 17:41:33 2012 +0200
@@ -698,6 +698,8 @@
         for parent in parents:
             self.ui.write(_("parent:      %d:%s\n") % parent,
                           label='log.parent')
+        if ctx.obsolete():
+            self.ui.write(_("obsolete:    dead\n"))
 
         if self.ui.debugflag:
             mnode = ctx.manifestnode()
diff -r e89cc71b7fa9 -r 0d39a100bf11 tests/test-obsolete.t
--- a/tests/test-obsolete.t	Sat May 12 17:39:49 2012 +0200
+++ b/tests/test-obsolete.t	Sat May 12 17:41:33 2012 +0200
@@ -15,3 +15,11 @@
   abort: no revisions specified
   [255]
   $ hg obsolete "desc('kill_me')"
+  $ hg log -r .
+  changeset:   0:97b7c2d76b18
+  tag:         tip
+  obsolete:    dead
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add kill_me
+  


More information about the Mercurial-devel mailing list