Give proper error message when refusing to overwrite existing branchv210917
commit5b7ca5aaece48e3d05b63a393f5011df1d8ec69d
authorFrej Drejhammar <frej.drejhammar@gmail.com>
Fri, 27 Aug 2021 13:47:26 +0000 (27 15:47 +0200)
committerFrej Drejhammar <frej.drejhammar@gmail.com>
Fri, 27 Aug 2021 14:04:40 +0000 (27 16:04 +0200)
tree80887d4e1ad315dadfd6abf169c2df84cede055e
parent4227621eed939247411d242b0b11e64c900c2428
Give proper error message when refusing to overwrite existing branch

If fast-export was asked to export a Mercurial branch to Git and a
branch of the same name already existed in the Git repo but it was not
created by fast export, fast-export would crash while trying to format
an error message claiming that the destination branch was modified
behind its back.

This patch extends fast-export to detect the situation above and give
a proper error message which hopefully is less confusing to the user.

Credits for discovering the original crash goes to Shun-ichi Goto
<gotoh@taiyo.co.jp>.

Closes: #269.
hg-fast-export.py