equal
deleted
inserted
replaced
141 setcurrent(repo, mark) |
141 setcurrent(repo, mark) |
142 write(repo, marks) |
142 write(repo, marks) |
143 return |
143 return |
144 |
144 |
145 if delete: |
145 if delete: |
146 if mark == None: |
146 if mark is None: |
147 raise util.Abort(_("bookmark name required")) |
147 raise util.Abort(_("bookmark name required")) |
148 if mark not in marks: |
148 if mark not in marks: |
149 raise util.Abort(_("a bookmark of this name does not exist")) |
149 raise util.Abort(_("a bookmark of this name does not exist")) |
150 if mark == current(repo): |
150 if mark == current(repo): |
151 setcurrent(repo, None) |
151 setcurrent(repo, None) |
169 marks[mark] = repo.changectx('.').node() |
169 marks[mark] = repo.changectx('.').node() |
170 setcurrent(repo, mark) |
170 setcurrent(repo, mark) |
171 write(repo, marks) |
171 write(repo, marks) |
172 return |
172 return |
173 |
173 |
174 if mark == None: |
174 if mark is None: |
175 if rev: |
175 if rev: |
176 raise util.Abort(_("bookmark name required")) |
176 raise util.Abort(_("bookmark name required")) |
177 if len(marks) == 0: |
177 if len(marks) == 0: |
178 ui.status("no bookmarks set\n") |
178 ui.status("no bookmarks set\n") |
179 else: |
179 else: |
241 |
241 |
242 def commit(self, *k, **kw): |
242 def commit(self, *k, **kw): |
243 """Add a revision to the repository and |
243 """Add a revision to the repository and |
244 move the bookmark""" |
244 move the bookmark""" |
245 node = super(bookmark_repo, self).commit(*k, **kw) |
245 node = super(bookmark_repo, self).commit(*k, **kw) |
246 if node == None: |
246 if node is None: |
247 return None |
247 return None |
248 parents = repo.changelog.parents(node) |
248 parents = repo.changelog.parents(node) |
249 if parents[1] == nullid: |
249 if parents[1] == nullid: |
250 parents = (parents[0],) |
250 parents = (parents[0],) |
251 marks = parse(repo) |
251 marks = parse(repo) |