##// END OF EJS Templates
template: provide a termwidth keyword (issue5395)...
Simon Farnsworth -
r30088:d1f5f158 default
parent child Browse files
Show More
@@ -589,5 +589,10 b' def loadkeyword(ui, extname, registrarob'
589 589 for name, func in registrarobj._table.iteritems():
590 590 keywords[name] = func
591 591
592 @templatekeyword('termwidth')
593 def termwidth(repo, ctx, templ, **args):
594 """Integer. The width of the current terminal."""
595 return repo.ui.termwidth()
596
592 597 # tell hggettext to extract docstrings from these functions:
593 598 i18nfunctions = keywords.values()
@@ -3214,6 +3214,11 b' Test recursive evaluation:'
3214 3214 hg: parse error: fill expects an integer width
3215 3215 [255]
3216 3216
3217 $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}'
3218 bcc7ff960b8e:desc to be
3219 termwidth.1:wrapped desc
3220 termwidth.1:to be wrapped (no-eol)
3221
3217 3222 $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
3218 3223 {node|short} (no-eol)
3219 3224 $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}'
General Comments 0
You need to be logged in to leave comments. Login now