[PATCH 05 of 12] phases: add a phase template keyword

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Tue Oct 18 12:27:02 CDT 2011


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1318163104 -7200
# Node ID 3c425f06d6bfab5b32e0da230c9fc0a615814ae5
# Parent  1b70b32f8fa33c37bbf34e0eee53313af66598a5
phases: add a phase template keyword

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -273,10 +273,14 @@ def shownode(repo, ctx, templ, **args):
     """:node: String. The changeset identification hash, as a 40 hexadecimal
     digit string.
     """
     return ctx.hex()
 
+def showphase(repo, ctx, templ, **args):
+    """:rev: Integer. The changeset phase."""
+    return ctx.phase()
+
 def showrev(repo, ctx, templ, **args):
     """:rev: Integer. The repository-local changeset revision number."""
     return ctx.rev()
 
 def showtags(**args):
@@ -310,10 +314,11 @@ keywords = {
     'files': showfiles,
     'latesttag': showlatesttag,
     'latesttagdistance': showlatesttagdistance,
     'manifest': showmanifest,
     'node': shownode,
+    'phase': showphase,
     'rev': showrev,
     'tags': showtags,
 }
 
 # tell hggettext to extract docstrings from these functions:


More information about the Mercurial-devel mailing list