mirror of
https://github.com/frej/fast-export.git
synced 2026-07-20 06:00:36 +02:00
Warn if one of the marks, mapping, or heads files are empty
This commit is contained in:
@@ -359,6 +359,10 @@ def verify_heads(ui,repo,cache,force,branchesmap):
|
|||||||
def hg2git(repourl,m,marksfile,mappingfile,headsfile,tipfile,
|
def hg2git(repourl,m,marksfile,mappingfile,headsfile,tipfile,
|
||||||
authors={},branchesmap={},tagsmap={},
|
authors={},branchesmap={},tagsmap={},
|
||||||
sob=False,force=False,hgtags=False,notes=False,encoding='',fn_encoding=''):
|
sob=False,force=False,hgtags=False,notes=False,encoding='',fn_encoding=''):
|
||||||
|
def check_cache(filename, contents):
|
||||||
|
if len(contents) == 0:
|
||||||
|
sys.stderr.write('Warning: %s does not contain any data, this will probably make an incremental import fail\n' % filename)
|
||||||
|
|
||||||
_max=int(m)
|
_max=int(m)
|
||||||
|
|
||||||
old_marks=load_cache(marksfile,lambda s: int(s)-1)
|
old_marks=load_cache(marksfile,lambda s: int(s)-1)
|
||||||
@@ -366,6 +370,12 @@ def hg2git(repourl,m,marksfile,mappingfile,headsfile,tipfile,
|
|||||||
heads_cache=load_cache(headsfile)
|
heads_cache=load_cache(headsfile)
|
||||||
state_cache=load_cache(tipfile)
|
state_cache=load_cache(tipfile)
|
||||||
|
|
||||||
|
if len(state_cache) != 0:
|
||||||
|
for (name, data) in [(marksfile, old_marks),
|
||||||
|
(mappingfile, mapping_cache),
|
||||||
|
(headsfile, state_cache)]:
|
||||||
|
check_cache(name, data)
|
||||||
|
|
||||||
ui,repo=setup_repo(repourl)
|
ui,repo=setup_repo(repourl)
|
||||||
|
|
||||||
if not verify_heads(ui,repo,heads_cache,force,branchesmap):
|
if not verify_heads(ui,repo,heads_cache,force,branchesmap):
|
||||||
|
|||||||
Reference in New Issue
Block a user