bookmark: use 'applychanges' when stripping

This commit is contained in:
Boris Feld 2017-07-10 17:37:48 +02:00
parent 316d61deba
commit 8cb892d933

View File

@ -78,9 +78,7 @@ def strip(ui, repo, revs, update=True, backup=True, force=None, bookmarks=None):
with repo.transaction('strip') as tr: with repo.transaction('strip') as tr:
if repo._activebookmark in bookmarks: if repo._activebookmark in bookmarks:
bookmarksmod.deactivate(repo) bookmarksmod.deactivate(repo)
for bookmark in bookmarks: repomarks.applychanges(repo, tr, [(b, None) for b in bookmarks])
del repomarks[bookmark]
repomarks.recordchange(tr)
for bookmark in sorted(bookmarks): for bookmark in sorted(bookmarks):
ui.write(_("bookmark '%s' deleted\n") % bookmark) ui.write(_("bookmark '%s' deleted\n") % bookmark)
@ -157,9 +155,8 @@ def stripcmd(ui, repo, *revs, **opts):
revs.update(set(rsrevs)) revs.update(set(rsrevs))
if not revs: if not revs:
with repo.lock(), repo.transaction('bookmark') as tr: with repo.lock(), repo.transaction('bookmark') as tr:
for bookmark in bookmarks: bmchanges = [(b, None) for b in bookmarks]
del repomarks[bookmark] repomarks.applychanges(repo, tr, bmchanges)
repomarks.recordchange(tr)
for bookmark in sorted(bookmarks): for bookmark in sorted(bookmarks):
ui.write(_("bookmark '%s' deleted\n") % bookmark) ui.write(_("bookmark '%s' deleted\n") % bookmark)