Patchwork [09,of,12] bookmark: use 'applychanges' when stripping

login
register
mail settings
Submitter Boris Feld
Date July 14, 2017, 5:54 p.m.
Message ID <32399e89b8ed9662b07d.1500054847@FB>
Download mbox | patch
Permalink /patch/22368/
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 1499701068 -7200
#      Mon Jul 10 17:37:48 2017 +0200
# Node ID 32399e89b8ed9662b07d6a656a447e6ef5bafc1b
# Parent  0d37c4628a9cc6491e35ad69e8c780ccaf3d26bc
# EXP-Topic tr.changes.bookmarks
bookmark: use 'applychanges' when stripping

Patch

diff -r 0d37c4628a9c -r 32399e89b8ed hgext/strip.py
--- a/hgext/strip.py	Mon Jul 10 17:30:20 2017 +0200
+++ b/hgext/strip.py	Mon Jul 10 17:37:48 2017 +0200
@@ -78,9 +78,7 @@ 
             with repo.transaction('strip') as tr:
                 if repo._activebookmark in bookmarks:
                     bookmarksmod.deactivate(repo)
-                for bookmark in bookmarks:
-                    del repomarks[bookmark]
-                repomarks.recordchange(tr)
+                repomarks.applychanges(repo, tr, [(b, None) for b in bookmarks])
             for bookmark in sorted(bookmarks):
                 ui.write(_("bookmark '%s' deleted\n") % bookmark)
 
@@ -157,9 +155,8 @@ 
                     revs.update(set(rsrevs))
             if not revs:
                 with repo.lock(), repo.transaction('bookmark') as tr:
-                    for bookmark in bookmarks:
-                        del repomarks[bookmark]
-                    repomarks.recordchange(tr)
+                    bmchanges = [(b, None) for b in bookmarks]
+                    repomarks.applychanges(repo, tr, bmchanges)
                 for bookmark in sorted(bookmarks):
                     ui.write(_("bookmark '%s' deleted\n") % bookmark)