tests/test-command-template.t
changeset 24241 e7baf88c29c3
parent 24240 bd504d90588d
child 24280 6c55e37ba5f2
equal deleted inserted replaced
24240:bd504d90588d 24241:e7baf88c29c3
  2284 Test branches inside if statement:
  2284 Test branches inside if statement:
  2285 
  2285 
  2286   $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
  2286   $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
  2287   no
  2287   no
  2288 
  2288 
       
  2289 Test get function:
       
  2290 
       
  2291   $ hg log -r 0 --template '{get(extras, "branch")}\n'
       
  2292   default
       
  2293   $ hg log -r 0 --template '{get(files, "should_fail")}\n'
       
  2294   hg: parse error: get() expects a dict as first argument
       
  2295   [255]
       
  2296 
  2289 Test shortest(node) function:
  2297 Test shortest(node) function:
  2290 
  2298 
  2291   $ echo b > b
  2299   $ echo b > b
  2292   $ hg ci -qAm b
  2300   $ hg ci -qAm b
  2293   $ hg log --template '{shortest(node)}\n'
  2301   $ hg log --template '{shortest(node)}\n'