Store marks only on success

Commit 2594a79 (remote-hg: fix bad state issue) originally introduced
this code in order to avoid synchronization issues while pushing,
because `git fast-export` might end up writing the marks before a crash
in the remote helper occurs.

However, the problem is in `git fast-export`; the marks should only be
written after both have finished successfully.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras
2014-04-12 12:52:00 -05:00
parent 4ea2fa76b3
commit 2958556bec

View File

@@ -1255,12 +1255,10 @@ def main(args):
die('unhandled command: %s' % line)
sys.stdout.flush()
marks.store()
def bye():
if not marks:
return
if not is_tmp:
marks.store()
else:
if is_tmp:
shutil.rmtree(dirname)
atexit.register(bye)