Patchwork [03,of,12] bookmark: use 'applychanges' for bookmark renaming

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 5:54 p.m.
Message ID <9f589c0e64901c5a15ad.1500054841@FB>
Download mbox | patch
Permalink /patch/22361/
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 1499699300 -7200
#      Mon Jul 10 17:08:20 2017 +0200
# Node ID 9f589c0e64901c5a15add541d5213574664fa218
# Parent  e94048e3d4a0422207fce8c146c6be62fd701f85
# EXP-Topic tr.changes.bookmarks
bookmark: use 'applychanges' for bookmark renaming

Patch

diff -r e94048e3d4a0 -r 9f589c0e6490 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