# HG changeset patch # User Pierre-Yves David # Date 2014-09-28 22:21:38 # Node ID 0f8120c1ecf5da0a9fd49637871cc3187bffeb47 # Parent 8319f7e78395be64b949493ef07f07260d037a8b pull: perform bookmark updates in the transaction diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -357,7 +357,7 @@ def _diverge(ui, b, path, localmarks): 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 @@ def updatefromremote(ui, repo, remotemar _("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")) diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1015,6 +1015,7 @@ def _pullbookmarks(pullop): remotebookmarks = pullop.remotebookmarks bookmod.updatefromremote(repo.ui, repo, remotebookmarks, pullop.remote.url(), + pullop.gettransaction, explicit=pullop.explicitbookmarks) def _pullobsolete(pullop):