Patchwork [08,of,12] bookmark: use 'applychanges' in the convert extension

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 5:54 p.m.
Message ID <0d37c4628a9cc6491e35.1500054846@FB>
Download mbox | patch
Permalink /patch/22367/
State Accepted
Headers show

Comments

Boris Feld - July 14, 2017, 5:54 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499700620 -7200
#      Mon Jul 10 17:30:20 2017 +0200
# Node ID 0d37c4628a9cc6491e35ad69e8c780ccaf3d26bc
# Parent  85ce60fb04bbbf060d7657209802b6a0e0cc030a
# EXP-Topic tr.changes.bookmarks
bookmark: use 'applychanges' in the convert extension

Patch

diff -r 85ce60fb04bb -r 0d37c4628a9c hgext/convert/hg.py
--- a/hgext/convert/hg.py	Mon Jul 10 17:28:53 2017 +0200
+++ b/hgext/convert/hg.py	Mon Jul 10 17:30:20 2017 +0200
@@ -425,9 +425,9 @@ 
             tr = self.repo.transaction('bookmark')
             self.ui.status(_("updating bookmarks\n"))
             destmarks = self.repo._bookmarks
-            for bookmark in updatedbookmark:
-                destmarks[bookmark] = nodemod.bin(updatedbookmark[bookmark])
-            destmarks.recordchange(tr)
+            changes = [(bookmark, nodemod.bin(updatedbookmark[bookmark]))
+                       for bookmark in updatedbookmark]
+            destmarks.applychanges(self.repo, tr, changes)
             tr.close()
         finally:
             lockmod.release(lock, wlock, tr)