Patchwork [1,of,2] amend: collaborate with the transaction when moving bookmarks

login
register
mail settings
Submitter Pierre-Yves David
Date July 1, 2015, 6:04 a.m.
Message ID <cc88486e842ce1cf3b69.1435730667@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/9844/
State Accepted
Headers show

Comments

Pierre-Yves David - July 1, 2015, 6:04 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1435729009 25200
#      Tue Jun 30 22:36:49 2015 -0700
# Node ID cc88486e842ce1cf3b696606b98505ae52031afc
# Parent  c76e8d14383a44a740d986d87db6f58276fb57e8
amend: collaborate with the transaction when moving bookmarks

We have code moving bookmarks from the old changeset to the new one within the
transaction scope. Yet, this code was still writing to disk instead of
handing the change to the transaction. This changeset fix this.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2613,11 +2613,11 @@  def amend(ui, repo, commitfunc, old, ext
                 bms = repo.nodebookmarks(old.node())
                 if bms:
                     marks = repo._bookmarks
                     for bm in bms:
                         marks[bm] = newid
-                    marks.write()
+                    marks.recordchange(tr)
             #commit the whole amend process
             createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt)
             if createmarkers and newid != old.node():
                 # mark the new changeset as successor of the rewritten one
                 new = repo[newid]