tests/test-command-template.t
changeset 34337 89aec1834a86
parent 34336 6367318327f0
child 34534 b3073e175c17
equal deleted inserted replaced
34336:6367318327f0 34337:89aec1834a86
  3117   [255]
  3117   [255]
  3118   $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
  3118   $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
  3119   hg: parse error: None is not iterable
  3119   hg: parse error: None is not iterable
  3120   [255]
  3120   [255]
  3121 
  3121 
       
  3122 Test new-style inline templating of non-list/dict type:
       
  3123 
       
  3124   $ hg log -R latesttag -r tip -T '{manifest}\n'
       
  3125   11:2bc6e9006ce2
       
  3126   $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n'
       
  3127   string length: 15
       
  3128   $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n'
       
  3129   11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc
       
  3130 
       
  3131 Test manifest can be join()-ed as before, though it's silly:
       
  3132 
       
  3133   $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n'
       
  3134   11:2bc6e9006ce2
       
  3135 
  3122 Test the sub function of templating for expansion:
  3136 Test the sub function of templating for expansion:
  3123 
  3137 
  3124   $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
  3138   $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n'
  3125   xx
  3139   xx
  3126 
  3140