bookmarks: fix update of the current bookmark during rename
We need to get rid of the previous bookmark after changing current bookmark.
--- 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
--- 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