changeset 22666:0f8120c1ecf5

pull: perform bookmark updates in the transaction
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 28 Sep 2014 15:21:38 -0700
parents 8319f7e78395
children 3acc3f95548c
files mercurial/bookmarks.py mercurial/exchange.py
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Sun Sep 28 00:41:55 2014 -0700
+++ b/mercurial/bookmarks.py	Sun Sep 28 15:21:38 2014 -0700
@@ -357,7 +357,7 @@
             n = '%s@%s' % (b, p)
     return n
 
-def updatefromremote(ui, repo, remotemarks, path, explicit=()):
+def updatefromremote(ui, repo, remotemarks, path, trfunc, explicit=()):
     ui.debug("checking for updated bookmarks\n")
     localmarks = repo._bookmarks
     (addsrc, adddst, advsrc, advdst, diverge, differ, invalid
@@ -397,10 +397,11 @@
                             _("importing bookmark %s\n") % (b, b)))
 
     if changed:
+        tr = trfunc()
         for b, node, writer, msg in sorted(changed):
             localmarks[b] = node
             writer(msg)
-        localmarks.write()
+        localmarks.recordchange(tr)
 
 def diff(ui, dst, src):
     ui.status(_("searching for changed bookmarks\n"))
--- a/mercurial/exchange.py	Sun Sep 28 00:41:55 2014 -0700
+++ b/mercurial/exchange.py	Sun Sep 28 15:21:38 2014 -0700
@@ -1015,6 +1015,7 @@
     remotebookmarks = pullop.remotebookmarks
     bookmod.updatefromremote(repo.ui, repo, remotebookmarks,
                              pullop.remote.url(),
+                             pullop.gettransaction,
                              explicit=pullop.explicitbookmarks)
 
 def _pullobsolete(pullop):