Show More
@@ -294,7 +294,17 b' def deletedivergent(repo, deletefrom, bm' | |||||
294 | '''Delete divergent versions of bm on nodes in deletefrom. |
|
294 | '''Delete divergent versions of bm on nodes in deletefrom. | |
295 |
|
295 | |||
296 | Return True if at least one bookmark was deleted, False otherwise.''' |
|
296 | Return True if at least one bookmark was deleted, False otherwise.''' | |
297 | deleted = False |
|
297 | bms = divergent2delete(repo, deletefrom, bm) | |
|
298 | marks = repo._bookmarks | |||
|
299 | for b in bms: | |||
|
300 | del marks[b] | |||
|
301 | return bool(bms) | |||
|
302 | ||||
|
303 | def divergent2delete(repo, deletefrom, bm): | |||
|
304 | """find divergent versions of bm on nodes in deletefrom. | |||
|
305 | ||||
|
306 | the list of bookmark to delete.""" | |||
|
307 | todelete = [] | |||
298 | marks = repo._bookmarks |
|
308 | marks = repo._bookmarks | |
299 | divergent = [b for b in marks if b.split('@', 1)[0] == bm.split('@', 1)[0]] |
|
309 | divergent = [b for b in marks if b.split('@', 1)[0] == bm.split('@', 1)[0]] | |
300 | for mark in divergent: |
|
310 | for mark in divergent: | |
@@ -303,9 +313,8 b' def deletedivergent(repo, deletefrom, bm' | |||||
303 | continue |
|
313 | continue | |
304 | if mark and marks[mark] in deletefrom: |
|
314 | if mark and marks[mark] in deletefrom: | |
305 | if mark != bm: |
|
315 | if mark != bm: | |
306 |
|
|
316 | todelete.append(mark) | |
307 | deleted = True |
|
317 | return todelete | |
308 | return deleted |
|
|||
309 |
|
318 | |||
310 | def headsforactive(repo): |
|
319 | def headsforactive(repo): | |
311 | """Given a repo with an active bookmark, return divergent bookmark nodes. |
|
320 | """Given a repo with an active bookmark, return divergent bookmark nodes. |
General Comments 0
You need to be logged in to leave comments.
Login now