comparison mercurial/templater.py @ 28178:96f2d50fb9f6

templater: factor out type conversion of revset() result This makes it clear why we have to do repo[int(x)].
author Yuya Nishihara <yuya@tcha.org>
date Fri, 12 Feb 2016 18:39:48 +0900
parents cfe7da66f555
children 5c11702fe2a3
comparison
equal deleted inserted replaced
28177:ab8107c923b4 28178:96f2d50fb9f6
579 return m(repo) 579 return m(repo)
580 580
581 if len(args) > 1: 581 if len(args) > 1:
582 formatargs = list([a[0](context, mapping, a[1]) for a in args[1:]]) 582 formatargs = list([a[0](context, mapping, a[1]) for a in args[1:]])
583 revs = query(revsetmod.formatspec(raw, *formatargs)) 583 revs = query(revsetmod.formatspec(raw, *formatargs))
584 revs = list([str(r) for r in revs]) 584 revs = list(revs)
585 else: 585 else:
586 revsetcache = mapping['cache'].setdefault("revsetcache", {}) 586 revsetcache = mapping['cache'].setdefault("revsetcache", {})
587 if raw in revsetcache: 587 if raw in revsetcache:
588 revs = revsetcache[raw] 588 revs = revsetcache[raw]
589 else: 589 else:
590 revs = query(raw) 590 revs = query(raw)
591 revs = list([str(r) for r in revs]) 591 revs = list(revs)
592 revsetcache[raw] = revs 592 revsetcache[raw] = revs
593 593
594 return templatekw.showrevslist("revision", revs, **mapping) 594 return templatekw.showrevslist("revision", revs, **mapping)
595 595
596 def rstdoc(context, mapping, args): 596 def rstdoc(context, mapping, args):