changeset 41383:092c5d05ba01

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
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 16 Jan 2019 17:46:39 -0800
parents 784ab13b340f
children 57c462db87fd
files mercurial/localrepo.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)