From 8b1fd408caa72e869d597bc0badebc5d45415df2 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Thu, 9 Mar 2023 18:31:02 -0600 Subject: [PATCH] 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 --- hg-fast-export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hg-fast-export.py b/hg-fast-export.py index 352ff0d..505fd05 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -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