# HG changeset patch # User Benoit Boissinot # Date 1300027344 -3600 # Node ID 8ee4b00ddfd8f3691c305bc89643ea93df6035b8 # Parent 7359cb753a54c89eface2b18438b50736870848b bookmarks: fix update of the current bookmark during rename We need to get rid of the previous bookmark after changing current bookmark. diff -r 7359cb753a54 -r 8ee4b00ddfd8 mercurial/commands.py --- a/mercurial/commands.py Sun Mar 13 14:26:32 2011 +0100 +++ b/mercurial/commands.py Sun Mar 13 15:42:24 2011 +0100 @@ -487,9 +487,9 @@ if mark is None: raise util.Abort(_("new bookmark name required")) marks[mark] = marks[rename] - del marks[rename] if repo._bookmarkcurrent == rename: bookmarks.setcurrent(repo, mark) + del marks[rename] bookmarks.write(repo) return diff -r 7359cb753a54 -r 8ee4b00ddfd8 tests/test-bookmarks-current.t --- a/tests/test-bookmarks-current.t Sun Mar 13 14:26:32 2011 +0100 +++ b/tests/test-bookmarks-current.t Sun Mar 13 15:42:24 2011 +0100 @@ -36,6 +36,10 @@ list bookmarks + $ cat .hg/bookmarks.current + Z (no-eol) + $ cat .hg/bookmarks + 0000000000000000000000000000000000000000 Z $ hg bookmarks * Z -1:000000000000