D5000: templatefuncs: add truncate parameter to pad

mbthomas (Mark Thomas) phabricator at mercurial-scm.org
Fri Oct 12 11:55:11 EDT 2018


mbthomas added a comment.


  This is necessary to recreate something like the original output for `hg absorb` using the template language.  It also allows inclusion of the commit message in the rows of the absorb output, using a template spec like:
  
    hg absorb -pn -T '{ifeq(linetype,"summary","\n{count} changesets affected",ifeq(linetype,"path","showing changes for {label("absorb.path",path)}","{label("absorb.node", pad(node, 7, truncate=true))} {label("yellow", pad(desc, 30, truncate=true))} {label("diff.{linetype}", "{diffchar}{inserted}{deleted}{hunk}")}"))}\n'

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5000

To: mbthomas, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list