520 |
520 |
521 # inspired from mercurial.repair.stripbmrevset |
521 # inspired from mercurial.repair.stripbmrevset |
522 CONVERTBOOKREVSET = """ |
522 CONVERTBOOKREVSET = """ |
523 not public() and ( |
523 not public() and ( |
524 ancestors(bookmark(%s)) |
524 ancestors(bookmark(%s)) |
525 and not ( |
525 and not ancestors( |
526 ancestors( |
526 ( |
527 head() |
527 (head() and not bookmark(%s)) |
528 and not bookmark(%s) |
528 or (bookmark() - bookmark(%s)) |
529 ) |
529 ) - ( |
530 or ancestors( |
530 descendants(bookmark(%s)) |
531 bookmark() |
531 - bookmark(%s) |
532 and not bookmark(%s) |
|
533 ) |
532 ) |
534 ) |
533 ) |
535 ) |
534 ) |
536 """ |
535 """ |
537 |
536 |
538 def _findconvertbmarktopic(repo, bmark): |
537 def _findconvertbmarktopic(repo, bmark): |
539 """find revisions unambigiously defined by a bookmark |
538 """find revisions unambigiously defined by a bookmark |
540 |
539 |
541 find all changesets under the bookmark and under that bookmark only. |
540 find all changesets under the bookmark and under that bookmark only. |
542 """ |
541 """ |
543 return repo.revs(CONVERTBOOKREVSET, bmark, bmark, bmark) |
542 return repo.revs(CONVERTBOOKREVSET, bmark, bmark, bmark, bmark, bmark) |
544 |
543 |
545 def _applyconvertbmarktopic(ui, repo, revs, old, bmark, tr): |
544 def _applyconvertbmarktopic(ui, repo, revs, old, bmark, tr): |
546 """apply bookmark convertion to topic |
545 """apply bookmark convertion to topic |
547 |
546 |
548 Sets a topic as same as bname to all the changesets under the bookmark |
547 Sets a topic as same as bname to all the changesets under the bookmark |