From cf0e5837b6c91f4f3f006116cbb36c249b69f58f Mon Sep 17 00:00:00 2001 From: Ondrej Stanek Date: Wed, 29 Apr 2020 15:56:36 +0200 Subject: [PATCH] Allow converting a repository with git and hg subrepos In the verification phase, fast-export falsely expects that both hg and git subrepositories should have the appropriate line in the subrepo-map file. The case is, that only hg subrepos need a line in subrepo-map that references a converted subrepo, while git subrepositories do not. --- hg-fast-export.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hg-fast-export.py b/hg-fast-export.py index c005836..a7b5d6c 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -525,14 +525,14 @@ def hg2git(repourl,m,marksfile,mappingfile,headsfile,tipfile, mapping_cache[revnode.encode('hex_codec')] = str(rev) if submodule_mappings: - # Make sure that all submodules are registered in the submodule-mappings file + # Make sure that all mercurial submodules are registered in the submodule-mappings file for rev in range(0,max): ctx=revsymbol(repo,str(rev)) if ctx.hidden(): continue if ctx.substate: for key in ctx.substate: - if key not in submodule_mappings: + if ctx.substate[key][2]=='hg' and key not in submodule_mappings: sys.stderr.write("Error: %s not found in submodule-mappings\n" % (key)) return 1