# HG changeset patch # User Matt Mackall # Date 1444863797 18000 # Node ID 71a485130beb356c6613db93ddca60590b75f86a # Parent b73eb98c024321c28f07a67e44118c925d0dee72 bookmarks: don't deactivate on no-op update (issue4901) diff -r b73eb98c0243 -r 71a485130beb mercurial/commands.py --- a/mercurial/commands.py Thu Oct 15 00:32:20 2015 +0100 +++ b/mercurial/commands.py Wed Oct 14 18:03:17 2015 -0500 @@ -6619,7 +6619,9 @@ 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 -r b73eb98c0243 -r 71a485130beb tests/test-bookmarks.t --- a/tests/test-bookmarks.t Thu Oct 15 00:32:20 2015 +0100 +++ b/tests/test-bookmarks.t Wed Oct 14 18:03:17 2015 -0500 @@ -732,6 +732,19 @@ 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