Comments
Patch
@@ -137,10 +137,15 @@
try:
return text.splitlines(True)[0].rstrip('\r\n')
except IndexError:
return ''
+def notfirstline(text):
+ """:notfirstline: Any text. Returns everything except the first line of
+ text."""
+ return ''.join(text.splitlines(True)[1:])
+
def hexfilter(text):
""":hex: Any text. Convert a binary Mercurial node identifier into
its long hexadecimal representation.
"""
return node.hex(text)
@@ -370,10 +375,11 @@
"isodatesec": isodatesec,
"json": json,
"jsonescape": jsonescape,
"localdate": localdate,
"nonempty": nonempty,
+ "notfirstline": notfirstline,
"obfuscate": obfuscate,
"permissions": permissions,
"person": person,
"rfc3339date": rfc3339date,
"rfc822date": rfc822date,
@@ -746,10 +746,11 @@
$ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
desc String. The text of the changeset description.
diffstat String. Statistics of changes with the following format:
firstline Any text. Returns the first line of text.
nonempty Any text. Returns '(none)' if the string is empty.
+ notfirstline Any text. Returns everything except the first line of text.
Test help hooks
$ cat > helphook1.py <<EOF
> from mercurial import help