Show More
@@ -100,7 +100,7 b' def setcurrent(repo, mark):' | |||||
100 | refs = parse(repo) |
|
100 | refs = parse(repo) | |
101 |
|
101 | |||
102 | # do not update if we do update to a rev equal to the current bookmark |
|
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 | current(repo) and refs[current(repo)] == repo.changectx('.').node()): |
|
104 | current(repo) and refs[current(repo)] == repo.changectx('.').node()): | |
105 | return |
|
105 | return | |
106 | if mark not in refs: |
|
106 | if mark not in refs: | |
@@ -146,6 +146,8 b' def bookmark(ui, repo, mark=None, rev=No' | |||||
146 | raise util.Abort(_("bookmark name required")) |
|
146 | raise util.Abort(_("bookmark name required")) | |
147 | if mark not in marks: |
|
147 | if mark not in marks: | |
148 | raise util.Abort(_("a bookmark of this name does not exist")) |
|
148 | raise util.Abort(_("a bookmark of this name does not exist")) | |
|
149 | if mark == current(repo): | |||
|
150 | setcurrent(repo, None) | |||
149 | del marks[mark] |
|
151 | del marks[mark] | |
150 | write(repo, marks) |
|
152 | write(repo, marks) | |
151 | return |
|
153 | return |
@@ -42,3 +42,14 b" hg commit -m'test'" | |||||
42 |
|
42 | |||
43 | echo % list bookmarks |
|
43 | echo % list bookmarks | |
44 | hg bookmark |
|
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 | % list bookmarks |
|
18 | % list bookmarks | |
19 | * Y 0:719295282060 |
|
19 | * Y 0:719295282060 | |
20 | Z -1:000000000000 |
|
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