# HG changeset patch # User Yuya Nishihara # Date 1573268990 -32400 # Node ID 2a8cd7edf4097f9c5a82327c134be4bd1d7a92ce # Parent 0ad5d6c4bfadd83f11d91941036a55e1781785f4 bookmarks: fix handling of multiple bookmarks with one to be deactivated Before, "hg bookmark --inactive Z Y" would ignore "Y" if "Z" were currently active. I'm pretty sure it is a bug. diff -r 0ad5d6c4bfad -r 2a8cd7edf409 mercurial/bookmarks.py --- a/mercurial/bookmarks.py Mon Nov 11 22:10:26 2019 +0900 +++ b/mercurial/bookmarks.py Sat Nov 09 12:09:50 2019 +0900 @@ -965,7 +965,7 @@ newact = mark if inactive and mark == repo._activebookmark: deactivate(repo) - return + continue tgt = cur if rev: ctx = scmutil.revsingle(repo, rev) @@ -976,6 +976,10 @@ changes.append((bm, None)) changes.append((mark, tgt)) + # nothing changed but for the one deactivated above + if not changes: + return + if hiddenrev: repo.ui.warn(_(b"bookmarking hidden changeset %s\n") % hiddenrev) diff -r 0ad5d6c4bfad -r 2a8cd7edf409 tests/test-bookmarks.t --- a/tests/test-bookmarks.t Mon Nov 11 22:10:26 2019 +0900 +++ b/tests/test-bookmarks.t Sat Nov 09 12:09:50 2019 +0900 @@ -608,6 +608,17 @@ $ hg bookmark --inactive Z $ hg bookmark Z +deactivate current 'Z', but also add 'Y' + + $ hg bookmark -d Y + $ hg bookmark --inactive Z Y + $ hg bookmark -l + X2 1:925d80f479bb + Y 2:db815d6d32e6 + Z 2:db815d6d32e6 + x y 2:db815d6d32e6 + $ hg bookmark Z + test clone $ hg bookmark -r 2 -i @