Patchwork [02,of,12] bookmark: use 'applychanges' for bookmark deletion

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 5:54 p.m.
Message ID <e94048e3d4a0422207fc.1500054840@FB>
Download mbox | patch
Permalink /patch/22360/
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 1499699056 -7200
#      Mon Jul 10 17:04:16 2017 +0200
# Node ID e94048e3d4a0422207fce8c146c6be62fd701f85
# Parent  e94441a7d9e334c5b9e604b9f6cabe4182cd5550
# EXP-Topic tr.changes.bookmarks
bookmark: use 'applychanges' for bookmark deletion

Patch

diff -r e94441a7d9e3 -r e94048e3d4a0 mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Mon Jul 10 17:01:34 2017 +0200
+++ b/mercurial/bookmarks.py	Mon Jul 10 17:04:16 2017 +0200
@@ -715,13 +715,14 @@ 
     Raises an abort error if mark does not exist.
     """
     marks = repo._bookmarks
+    changes = []
     for mark in names:
         if mark not in marks:
             raise error.Abort(_("bookmark '%s' does not exist") % mark)
         if mark == repo._activebookmark:
             deactivate(repo)
-        del marks[mark]
-    marks.recordchange(tr)
+        changes.append((mark, None))
+    marks.applychanges(repo, tr, changes)
 
 def rename(repo, tr, old, new, force=False, inactive=False):
     """rename a bookmark from old to new