Patchwork [01,of,10] bookmark: remove a useless 'recordchange' in the amend code

login
register
mail settings
Submitter Boris Feld
Date July 15, 2017, 11:42 a.m.
Message ID <982526b815da34df7d03.1500118969@FB>
Download mbox | patch
Permalink /patch/22394/
State Accepted
Headers show

Comments

Boris Feld - July 15, 2017, 11:42 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499701713 -7200
#      Mon Jul 10 17:48:33 2017 +0200
# Node ID 982526b815da34df7d0335b246afcbe48df3d112
# Parent  1adcb594eb6b075a9f3b676a1da5b56ed9e2a2ae
# EXP-Topic tr.changes.bookmarks
bookmark: remove a useless 'recordchange' in the amend code

We do not touch the bookmarks store in this code, just the active bookmark, not
covered by the transaction. So it seems we can safely drop this call and the
tests agree with us.

Patch

diff -r 1adcb594eb6b -r 982526b815da mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Mon Jul 10 19:40:23 2017 +0200
+++ b/mercurial/cmdutil.py	Mon Jul 10 17:48:33 2017 +0200
@@ -2750,7 +2750,7 @@ 
     base = old.p1()
 
     newid = None
-    with repo.wlock(), repo.lock(), repo.transaction('amend') as tr:
+    with repo.wlock(), repo.lock(), repo.transaction('amend'):
         # See if we got a message from -m or -l, if not, open the editor
         # with the message of the changeset to amend
         message = logmessage(ui, opts)
@@ -2768,7 +2768,6 @@ 
             node = commit(ui, repo, commitfunc, pats, opts)
         finally:
             repo._bookmarks.active = activebookmark
-            repo._bookmarks.recordchange(tr)
             ui.callhooks = True
         ctx = repo[node]