Patchwork [3,of,5,remotenames-ext] transition: modernize bookmark writing api usage

login
register
mail settings
Submitter Ryan McElroy
Date July 18, 2017, 12:54 p.m.
Message ID <5797e9f25309977de7b2.1500382480@devbig314.prn1.facebook.com>
Download mbox | patch
Permalink /patch/22485/
State Accepted
Headers show

Comments

Ryan McElroy - July 18, 2017, 12:54 p.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@fb.com>
# Date 1500381555 25200
#      Tue Jul 18 05:39:15 2017 -0700
# Node ID 5797e9f25309977de7b2e3d807adc741d8d56fd2
# Parent  7c52ae4a24a0ef41de841622916cfe28f15cd89f
transition: modernize bookmark writing api usage

Patch

diff --git a/remotenames.py b/remotenames.py
--- a/remotenames.py
+++ b/remotenames.py
@@ -1510,14 +1510,15 @@  def transition(repo, ui):
     """
     transmarks = ui.configlist('remotenames', 'transitionbookmarks')
     localmarks = repo._bookmarks
+    changes = []
     for mark in transmarks:
         if mark in localmarks:
-            del localmarks[mark]
+            changes.append((mark, None)) # delete this bookmark
     lock = tr = None
     try:
         lock = repo.lock()
         tr = repo.transaction("remotenames")
-        localmarks.recordchange(tr)
+        localmarks.applychanges(repo, tr, changes)
         tr.close()
     finally:
         lockmod.release(lock, tr)