comparison tests/test-command-template.t @ 20369:9c6b86dd2ed2

template: add shortest(node) template function Adds a '{shortest(node)}' template function that results in the shortest hex node that uniquely identifies the changeset at that time. The minimum length can be specified as an optional second argument and defaults to 4. This is useful for producing prettier log output, like so: @ durham shortestnode | 77cf template: add pad function for padding output | o durham | b183 template: add shortestnode keyword | o pierre-yves @ | 6545 backout: add a message after backout that need manual commit | | o durham manifestcache |/ 93f0 manifest cache | | o durham catperf | | c765 cat: increase perf when catting single files | | | o durham |/ 9c53 changectx: increase perf of walk function |
author Durham Goode <durham@fb.com>
date Fri, 17 Jan 2014 00:10:37 -0800
parents d4838302305c
children aa51392da507
comparison
equal deleted inserted replaced
20368:cc00cd6c51c2 20369:9c6b86dd2ed2
1624 1624
1625 Test branches inside if statement: 1625 Test branches inside if statement:
1626 1626
1627 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n' 1627 $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'
1628 no 1628 no
1629
1630 Test shortest(node) function:
1631
1632 $ echo b > b
1633 $ hg ci -qAm b
1634 $ hg log --template '{shortest(node)}\n'
1635 d97c
1636 f776
1637 $ hg log --template '{shortest(node, 10)}\n'
1638 d97c383ae3
1639 f7769ec2ab