Patchwork [06,of,12] bookmark: use 'applychanges' when updating a bookmark through pushkey

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 5:54 p.m.
Message ID <1fc04ebe411862e96483.1500054844@FB>
Download mbox | patch
Permalink /patch/22366/
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 1499700268 -7200
#      Mon Jul 10 17:24:28 2017 +0200
# Node ID 1fc04ebe411862e9648382fa2a0790d8bdaf3862
# Parent  76dde98a2c0bc24ab110ba3ecc06698c735adf57
# EXP-Topic tr.changes.bookmarks
bookmark: use 'applychanges' when updating a bookmark through pushkey

Patch

diff -r 76dde98a2c0b -r 1fc04ebe4118 mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Mon Jul 10 17:22:17 2017 +0200
+++ b/mercurial/bookmarks.py	Mon Jul 10 17:24:28 2017 +0200
@@ -402,12 +402,12 @@ 
         if existing != old and existing != new:
             return False
         if new == '':
-            del marks[key]
+            changes = [(key, None)]
         else:
             if new not in repo:
                 return False
-            marks[key] = repo[new].node()
-        marks.recordchange(tr)
+            changes = [(key, repo[new].node())]
+        marks.applychanges(repo, tr, changes)
         tr.close()
         return True
     finally: