diff --git a/hg-fast-export.py b/hg-fast-export.py index eab315d..1658830 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -493,7 +493,12 @@ def verify_heads(ui,repo,cache,force,ignore_unnamed_heads,branchesmap): sanitized_name=sanitize_name(b,"branch",branchesmap) sha1=get_git_sha1(sanitized_name) c=cache.get(sanitized_name) - if sha1!=c: + if not c and sha1: + stderr_buffer.write( + b'Error: Branch [%s] already exists and was not created by hg-fast-export, ' + b'export would overwrite unrelated branch\n' % b) + if not force: return False + elif sha1!=c: stderr_buffer.write( b'Error: Branch [%s] modified outside hg-fast-export:' b'\n%s (repo) != %s (cache)\n' % (b, b'' if sha1 is None else sha1, c)