From 5acd0028b4f97525acbe2ef4898e38aeb00c53f3 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sat, 13 Aug 2016 11:10:29 +0200 Subject: [PATCH] Ensure transaction safe notes update on push --- git-remote-hg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git-remote-hg b/git-remote-hg index 9493acb..a8e4784 100755 --- a/git-remote-hg +++ b/git-remote-hg @@ -1550,6 +1550,12 @@ def update_notes(revs, desc): dest.write('done\n') dest.flush() proc.wait() + # fail hard if this fails + # that prevents the marks file from being written + # so we can have a fresh look with a fetch + if proc.returncode: + die('notes update failed with return %d; recover with git fetch' % + (proc.returncode)) def do_push(parser): if os.environ.get('GIT_REMOTE_HG_DEBUG_PUSH'):