# HG changeset patch # User Martin von Zweigbergk # Date 1547689599 28800 # Node ID 092c5d05ba010beac5b3aa6cf90b1699fefa448e # Parent 784ab13b340f59d11094f3c65d6ca95b9a65c1ee commit: print "commit message saved in" message also if bookmark update fails The bookmark update is done within the same transaction, so if fails, the commit will also be rolled back. I just happened to notice this while messing with this code; we have not had reports of crashing bookmark updates from our users. The same applies to the clearing of the merge state, although I don't think that's currently tied into the transaction. Differential Revision: https://phab.mercurial-scm.org/D5621 diff -r 784ab13b340f -r 092c5d05ba01 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Jan 17 22:07:58 2019 -0800 +++ b/mercurial/localrepo.py Wed Jan 16 17:46:39 2019 -0800 @@ -2475,16 +2475,16 @@ parent2=hookp2) tr = self.transaction('commit') ret = self.commitctx(cctx, True) + # update bookmarks, dirstate and mergestate + bookmarks.update(self, [p1, p2], ret) + cctx.markcommitted(ret) + ms.reset() + tr.close() except: # re-raises if edited: self.ui.write( _('note: commit message saved in %s\n') % msgfn) raise - # update bookmarks, dirstate and mergestate - bookmarks.update(self, [p1, p2], ret) - cctx.markcommitted(ret) - ms.reset() - tr.close() finally: lockmod.release(tr, lock, wlock)