Mercurial > evolve
comparison hgext/obsolete.py @ 273:87e4d1eec5e8
obsolete: add debugsuccessors command
It dumps obsolete changesets and their successors.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Tue, 19 Jun 2012 10:02:32 +0200 |
parents | 3ff969da57ef |
children | 6622a24f3b0f |
comparison
equal
deleted
inserted
replaced
272:78d01e341438 | 273:87e4d1eec5e8 |
---|---|
431 finally: | 431 finally: |
432 del repo._importoldobsolete | 432 del repo._importoldobsolete |
433 l.release() | 433 l.release() |
434 ui.status('%i obsolete marker converted\n' % cnt) | 434 ui.status('%i obsolete marker converted\n' % cnt) |
435 | 435 |
436 def cmddebugsuccessors(ui, repo): | |
437 """dump obsolete changesets and their successors | |
438 | |
439 Each line matches an existing marker, the first identifier is the | |
440 obsolete changeset identifier, followed by it successors. | |
441 """ | |
442 lock = repo.lock() | |
443 try: | |
444 allsuccessors = repo.obsoletestore.objects | |
445 for old in sorted(allsuccessors): | |
446 successors = [sorted(m['subjects']) for m in allsuccessors[old]] | |
447 for i, group in enumerate(sorted(successors)): | |
448 ui.write('%s' % short(old)) | |
449 for new in group: | |
450 ui.write(' %s' % short(new)) | |
451 ui.write('\n') | |
452 finally: | |
453 lock.release() | |
436 | 454 |
437 cmdtable = {'debugobsolete': (cmddebugobsolete, [], '<subject> <object>'), | 455 cmdtable = {'debugobsolete': (cmddebugobsolete, [], '<subject> <object>'), |
438 'debugconvertobsolete': (cmddebugconvertobsolete, [], ''), | 456 'debugconvertobsolete': (cmddebugconvertobsolete, [], ''), |
457 'debugsuccessors': (cmddebugsuccessors, [], ''), | |
439 } | 458 } |
440 | 459 |
441 ### Altering existing command | 460 ### Altering existing command |
442 ############################# | 461 ############################# |
443 | 462 |