bookmark: use 'applychanges' for bookmark deletion
authorBoris Feld <boris.feld@octobus.net>
Mon, 10 Jul 2017 17:04:16 +0200
changeset 38882 67b5f81f17cf3a93b5ec5313954f8c6a0dd3eaa0
parent 38881 ef54789a947d8a4bc73894539ae45e19cb61c5f1
child 38883 916d4cde530e41cbf4a0efdd7b487d60100966ac
push id550
push usergszorc@mozilla.com
push dateSat, 15 Jul 2017 23:45:52 +0000
bookmark: use 'applychanges' for bookmark deletion
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -710,23 +710,24 @@ def checkformat(repo, mark):
     return mark
 
 def delete(repo, tr, names):
     """remove a mark from the bookmark store
 
     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
 
     If force is specified, then the new name can overwrite an existing
     bookmark.
 
     If inactive is specified, then do not activate the new bookmark.