[PATCH 06 of 18] phases: add a phase template keyword
pierre-yves.david at logilab.fr
pierre-yves.david at logilab.fr
Mon Oct 10 07:28:02 CDT 2011
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1318163104 -7200
# Node ID 2d7d038c49b2a5e33b21ce0006adb845c48665b9
# Parent 5bcc03cf015f47f835e437100d56d9650a33e2c3
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