Show More
@@ -252,17 +252,7 b' def reposetup(ui, repo):' | |||||
252 | key = self._bookmarks[key] |
|
252 | key = self._bookmarks[key] | |
253 | return super(bookmark_repo, self).lookup(key) |
|
253 | return super(bookmark_repo, self).lookup(key) | |
254 |
|
254 | |||
255 |
def |
|
255 | def _bookmarksupdate(self, parents, node): | |
256 | """Add a revision to the repository and |
|
|||
257 | move the bookmark""" |
|
|||
258 | wlock = self.wlock() # do both commit and bookmark with lock held |
|
|||
259 | try: |
|
|||
260 | node = super(bookmark_repo, self).commitctx(ctx, error) |
|
|||
261 | if node is None: |
|
|||
262 | return None |
|
|||
263 | parents = self.changelog.parents(node) |
|
|||
264 | if parents[1] == nullid: |
|
|||
265 | parents = (parents[0],) |
|
|||
266 |
|
|
256 | marks = self._bookmarks | |
267 |
|
|
257 | update = False | |
268 |
|
|
258 | if ui.configbool('bookmarks', 'track.current'): | |
@@ -277,6 +267,20 b' def reposetup(ui, repo):' | |||||
277 |
|
|
267 | update = True | |
278 |
|
|
268 | if update: | |
279 |
|
|
269 | write(self) | |
|
270 | ||||
|
271 | def commitctx(self, ctx, error=False): | |||
|
272 | """Add a revision to the repository and | |||
|
273 | move the bookmark""" | |||
|
274 | wlock = self.wlock() # do both commit and bookmark with lock held | |||
|
275 | try: | |||
|
276 | node = super(bookmark_repo, self).commitctx(ctx, error) | |||
|
277 | if node is None: | |||
|
278 | return None | |||
|
279 | parents = self.changelog.parents(node) | |||
|
280 | if parents[1] == nullid: | |||
|
281 | parents = (parents[0],) | |||
|
282 | ||||
|
283 | self._bookmarksupdate(parents, node) | |||
280 | return node |
|
284 | return node | |
281 | finally: |
|
285 | finally: | |
282 | wlock.release() |
|
286 | wlock.release() | |
@@ -290,20 +294,8 b' def reposetup(ui, repo):' | |||||
290 | # We have more heads than before |
|
294 | # We have more heads than before | |
291 | return result |
|
295 | return result | |
292 | node = self.changelog.tip() |
|
296 | node = self.changelog.tip() | |
293 | marks = self._bookmarks |
|
297 | ||
294 | update = False |
|
298 | self._bookmarksupdate(parents, node) | |
295 | if ui.configbool('bookmarks', 'track.current'): |
|
|||
296 | mark = self._bookmarkcurrent |
|
|||
297 | if mark and marks[mark] in parents: |
|
|||
298 | marks[mark] = node |
|
|||
299 | update = True |
|
|||
300 | else: |
|
|||
301 | for mark, n in marks.items(): |
|
|||
302 | if n in parents: |
|
|||
303 | marks[mark] = node |
|
|||
304 | update = True |
|
|||
305 | if update: |
|
|||
306 | write(self) |
|
|||
307 | return result |
|
299 | return result | |
308 |
|
300 | |||
309 | def _findtags(self): |
|
301 | def _findtags(self): |
General Comments 0
You need to be logged in to leave comments.
Login now