[PATCH 2 of 2] Map the verbose option of identify command to display nearest surrounding tags

Gilles Moris gilles.moris at free.fr
Tue Feb 10 15:52:17 CST 2009


1 file changed, 16 insertions(+)
mercurial/commands.py |   16 ++++++++++++++++


# HG changeset patch
# User Gilles Moris <gilles.moris at free.fr>
# Date 1234301938 -3600
# Node ID 2247b5c57b2d46e263fc68613f59075daae7cd68
# Parent  7ac8dcbc6eeffa86e944ec41a00f8e8fb789e08e
Map the verbose option of identify command to display nearest surrounding tags.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1583,6 +1583,22 @@
 
     ui.write("%s\n" % ' '.join(output))
 
+    if ui.verbose:
+        if isinstance(ctx, context.workingctx):
+            ctx = ctx.parents()[0]
+
+        output = ['based on']
+        for c, d in cmdutil.nearesttagsdateh(repo, ctx, fwd=False):
+            output.append('/'.join([ '%s+%d' % (t, d)  for t in c.tags() ]))
+        if len(output) > 1:
+            ui.write("%s\n" % ' '.join(output))
+
+        output = ['fixed in']
+        for c, d in cmdutil.nearesttagsdateh(repo, ctx, fwd=True):
+            output.append('/'.join([ '%s-%d' % (t, d)  for t in c.tags() ]))
+        if len(output) > 1:
+            ui.write("%s\n" % ' '.join(output))
+
 def import_(ui, repo, patch1, *patches, **opts):
     """import an ordered set of patches
 


More information about the Mercurial-devel mailing list