From 2958556becee7b0f71f80fd53d56f9f23eba9c94 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 12 Apr 2014 12:52:00 -0500 Subject: [PATCH] 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 --- git-remote-hg | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/git-remote-hg b/git-remote-hg index 6580227..fdc6a30 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -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)