mercurial/templater.py
changeset 31169 48a8b2e5fe31
parent 31024 0b8356705de6
child 31519 3725986b151a
--- a/mercurial/templater.py	Mon Feb 13 00:05:55 2017 -0800
+++ b/mercurial/templater.py	Sat Feb 25 16:26:58 2017 +0900
@@ -544,6 +544,19 @@
 
     return templatefilters.fill(text, width, initindent, hangindent)
 
+@templatefunc('formatnode(node)')
+def formatnode(context, mapping, args):
+    """Obtain the preferred form of a changeset hash. (DEPRECATED)"""
+    if len(args) != 1:
+        # i18n: "formatnode" is a keyword
+        raise error.ParseError(_("formatnode expects one argument"))
+
+    ui = mapping['ui']
+    node = evalstring(context, mapping, args[0])
+    if ui.debugflag:
+        return node
+    return templatefilters.short(node)
+
 @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])')
 def pad(context, mapping, args):
     """Pad text with a