Mercurial > public > mercurial-scm > hg
diff hgext/bookmarks.py @ 7817:cb516e788238
bookmarks: fixes bug where a deleted bookmark may still be treated as current when track.current option is set
author | Alex Unden <alu@zpuppet.org> |
---|---|
date | Fri, 27 Feb 2009 02:01:45 -0800 |
parents | f420eafe59cd |
children | b6b9065c20b3 |
line wrap: on
line diff
--- a/hgext/bookmarks.py Sun Mar 01 00:30:01 2009 +0100 +++ b/hgext/bookmarks.py Fri Feb 27 02:01:45 2009 -0800 @@ -100,7 +100,7 @@ refs = parse(repo) # do not update if we do update to a rev equal to the current bookmark - if (mark not in refs and + if (mark and mark not in refs and current(repo) and refs[current(repo)] == repo.changectx('.').node()): return if mark not in refs: @@ -146,6 +146,8 @@ raise util.Abort(_("bookmark name required")) if mark not in marks: raise util.Abort(_("a bookmark of this name does not exist")) + if mark == current(repo): + setcurrent(repo, None) del marks[mark] write(repo, marks) return