##// END OF EJS Templates
bookmarks: fixes bug where a deleted bookmark may still be treated as current when track.current option is set
Alex Unden -
r7817:cb516e78 default
parent child Browse files
Show More
@@ -100,7 +100,7 b' def setcurrent(repo, mark):'
100 100 refs = parse(repo)
101 101
102 102 # do not update if we do update to a rev equal to the current bookmark
103 if (mark not in refs and
103 if (mark and mark not in refs and
104 104 current(repo) and refs[current(repo)] == repo.changectx('.').node()):
105 105 return
106 106 if mark not in refs:
@@ -146,6 +146,8 b' def bookmark(ui, repo, mark=None, rev=No'
146 146 raise util.Abort(_("bookmark name required"))
147 147 if mark not in marks:
148 148 raise util.Abort(_("a bookmark of this name does not exist"))
149 if mark == current(repo):
150 setcurrent(repo, None)
149 151 del marks[mark]
150 152 write(repo, marks)
151 153 return
@@ -42,3 +42,14 b" hg commit -m'test'"
42 42
43 43 echo % list bookmarks
44 44 hg bookmark
45
46 echo % delete bookmarks
47 hg bookmark -d Y
48 hg bookmark -d Z
49
50 echo % list bookmarks
51 hg bookmark
52
53 echo % update to tip
54 hg update tip
55
@@ -18,3 +18,8 b' 0 files updated, 0 files merged, 0 files'
18 18 % list bookmarks
19 19 * Y 0:719295282060
20 20 Z -1:000000000000
21 % delete bookmarks
22 % list bookmarks
23 no bookmarks set
24 % update to tip
25 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now