Use changectx directly

There's no need to call repo[revnode] when repo[rev] works perfectly
fine.

And since we have the context already we can just do ctx.hex() instead
of hexlifying ourselves.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras
2023-03-09 18:31:02 -06:00
parent 4a4d242e98
commit 8b1fd408ca

View File

@@ -561,10 +561,10 @@ def hg2git(repourl,m,marksfile,mappingfile,headsfile,tipfile,
max=tip
for rev in range(0,max):
revnode=repo[rev].node()
if repo[revnode].hidden():
ctx=repo[rev]
if ctx.hidden():
continue
mapping_cache[hexlify(revnode)] = b"%d" % rev
mapping_cache[ctx.hex()] = b"%d" % rev
if submodule_mappings:
# Make sure that all mercurial submodules are registered in the submodule-mappings file