bookmark: use 'applychanges' for bookmark renaming
authorBoris Feld <boris.feld@octobus.net>
Mon, 10 Jul 2017 17:08:20 +0200
changeset 33482 916d4cde530e
parent 33481 67b5f81f17cf
child 33483 146c0371eadf
bookmark: use 'applychanges' for bookmark renaming
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Mon Jul 10 17:04:16 2017 +0200
+++ b/mercurial/bookmarks.py	Mon Jul 10 17:08:20 2017 +0200
@@ -739,11 +739,10 @@
     if old not in marks:
         raise error.Abort(_("bookmark '%s' does not exist") % old)
     marks.checkconflict(mark, force)
-    marks[mark] = marks[old]
+    changes = [(mark, marks[old]), (old, None)]
+    marks.applychanges(repo, tr, changes)
     if repo._activebookmark == old and not inactive:
         activate(repo, mark)
-    del marks[old]
-    marks.recordchange(tr)
 
 def addbookmarks(repo, tr, names, rev=None, force=False, inactive=False):
     """add a list of bookmarks