comparison mercurial/cmdutil.py @ 32676:4bec8cce6a09

scmutil: pass ctx object to intrev() This makes it slightly easier to sort basectx objects by key=scmutil.intrev. We're most likely to have ctx objects where changectx/workingctx abstraction is necessary, so this won't increase the abstraction overhead.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 03 Jun 2017 18:57:28 +0900
parents d3e1c5b4986c
children 55ff67ffcead
comparison
equal deleted inserted replaced
32675:7dab4c0cdb41 32676:4bec8cce6a09
1347 hexfunc = hex 1347 hexfunc = hex
1348 else: 1348 else:
1349 hexfunc = short 1349 hexfunc = short
1350 # as of now, wctx.node() and wctx.rev() return None, but we want to 1350 # as of now, wctx.node() and wctx.rev() return None, but we want to
1351 # show the same values as {node} and {rev} templatekw 1351 # show the same values as {node} and {rev} templatekw
1352 revnode = (scmutil.intrev(rev), hexfunc(bin(ctx.hex()))) 1352 revnode = (scmutil.intrev(ctx), hexfunc(bin(ctx.hex())))
1353 1353
1354 if self.ui.quiet: 1354 if self.ui.quiet:
1355 self.ui.write("%d:%s\n" % revnode, label='log.node') 1355 self.ui.write("%d:%s\n" % revnode, label='log.node')
1356 return 1356 return
1357 1357