##// END OF EJS Templates
scmutil: pass ctx object to intrev()...
Yuya Nishihara -
r32654:4bec8cce default
parent child Browse files
Show More
@@ -1349,7 +1349,7 b' class changeset_printer(object):'
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')
@@ -376,9 +376,10 b' def walkrepos(path, followsym=False, see'
376 newdirs.append(d)
376 newdirs.append(d)
377 dirs[:] = newdirs
377 dirs[:] = newdirs
378
378
379 def intrev(rev):
379 def intrev(ctx):
380 """Return integer for a given revision that can be used in comparison or
380 """Return integer for a given basectx that can be used in comparison or
381 arithmetic operation"""
381 arithmetic operation"""
382 rev = ctx.rev()
382 if rev is None:
383 if rev is None:
383 return wdirrev
384 return wdirrev
384 return rev
385 return rev
@@ -466,7 +467,7 b' def meaningfulparents(repo, ctx):'
466 return parents
467 return parents
467 if repo.ui.debugflag:
468 if repo.ui.debugflag:
468 return [parents[0], repo['null']]
469 return [parents[0], repo['null']]
469 if parents[0].rev() >= intrev(ctx.rev()) - 1:
470 if parents[0].rev() >= intrev(ctx) - 1:
470 return []
471 return []
471 return parents
472 return parents
472
473
@@ -161,7 +161,7 b' def _formatrevnode(ctx):'
161 hexnode = ctx.hex()
161 hexnode = ctx.hex()
162 else:
162 else:
163 hexnode = ctx.hex()[:12]
163 hexnode = ctx.hex()[:12]
164 return '%d:%s' % (scmutil.intrev(ctx.rev()), hexnode)
164 return '%d:%s' % (scmutil.intrev(ctx), hexnode)
165
165
166 def getfiles(repo, ctx, revcache):
166 def getfiles(repo, ctx, revcache):
167 if 'files' not in revcache:
167 if 'files' not in revcache:
@@ -611,7 +611,7 b' def showphaseidx(repo, ctx, templ, **arg'
611 @templatekeyword('rev')
611 @templatekeyword('rev')
612 def showrev(repo, ctx, templ, **args):
612 def showrev(repo, ctx, templ, **args):
613 """Integer. The repository-local changeset revision number."""
613 """Integer. The repository-local changeset revision number."""
614 return scmutil.intrev(ctx.rev())
614 return scmutil.intrev(ctx)
615
615
616 def showrevslist(name, revs, **args):
616 def showrevslist(name, revs, **args):
617 """helper to generate a list of revisions in which a mapped template will
617 """helper to generate a list of revisions in which a mapped template will
General Comments 0
You need to be logged in to leave comments. Login now