tests/test-command-template.t
changeset 37499 75c13343cf38
parent 37418 afd7b0afe4a6
child 37709 7b2955624777
equal deleted inserted replaced
37498:aacfca6f9767 37499:75c13343cf38
  3215   [255]
  3215   [255]
  3216   $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
  3216   $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n'
  3217   hg: parse error: None is not iterable of mappings
  3217   hg: parse error: None is not iterable of mappings
  3218   [255]
  3218   [255]
  3219   $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
  3219   $ hg log -R latesttag -r tip -T '{extras % "{key}\n" % "{key}\n"}'
  3220   hg: parse error: <generator *> is not iterable of mappings (glob)
  3220   hg: parse error: list of strings is not mappable
  3221   [255]
  3221   [255]
  3222 
  3222 
  3223 Test new-style inline templating of non-list/dict type:
  3223 Test new-style inline templating of non-list/dict type:
  3224 
  3224 
  3225   $ hg log -R latesttag -r tip -T '{manifest}\n'
  3225   $ hg log -R latesttag -r tip -T '{manifest}\n'
  3252 
  3252 
  3253   $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
  3253   $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n'
  3254   9
  3254   9
  3255   $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
  3255   $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n'
  3256   10
  3256   10
       
  3257 
       
  3258 Test min/max over map operation:
       
  3259 
       
  3260   $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n'
       
  3261   at3
       
  3262   $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n'
       
  3263   t3
  3257 
  3264 
  3258 Test min/max of if() result
  3265 Test min/max of if() result
  3259 
  3266 
  3260   $ cd latesttag
  3267   $ cd latesttag
  3261   $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
  3268   $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n'
  3839 
  3846 
  3840   $ hg log -r0 -T '{files|json}\n'
  3847   $ hg log -r0 -T '{files|json}\n'
  3841   ["a"]
  3848   ["a"]
  3842   $ hg log -r0 -T '{extras|json}\n'
  3849   $ hg log -r0 -T '{extras|json}\n'
  3843   {"branch": "default"}
  3850   {"branch": "default"}
       
  3851 
       
  3852 Test json filter applied to map result:
       
  3853 
       
  3854   $ hg log -r0 -T '{json(extras % "{key}")}\n'
       
  3855   ["branch"]
  3844 
  3856 
  3845 Test localdate(date, tz) function:
  3857 Test localdate(date, tz) function:
  3846 
  3858 
  3847   $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
  3859   $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n'
  3848   1970-01-01 09:00 +0900
  3860   1970-01-01 09:00 +0900