diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6619,7 +6619,9 @@ def update(ui, repo, node=None, rev=None ret = hg.update(repo, rev) if not ret and movemarkfrom: - if bookmarks.update(repo, [movemarkfrom], repo['.'].node()): + if movemarkfrom == repo['.'].node(): + pass # no-op update + elif bookmarks.update(repo, [movemarkfrom], repo['.'].node()): ui.status(_("updating bookmark %s\n") % repo._activebookmark) else: # this can happen with a non-linear update diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t --- a/tests/test-bookmarks.t +++ b/tests/test-bookmarks.t @@ -732,6 +732,19 @@ test non-linear update not clearing acti 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (activating bookmark four) +no-op update doesn't deactive bookmarks + + $ hg up + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg sum + parent: 3:9ba5f110a0b3 tip + y + branch: test + bookmarks: *four + commit: 2 unknown (clean) + update: (current) + phases: 4 draft + test clearing divergent bookmarks of linear ancestors $ hg bookmark Z -r 0