2456 ctx = scmutil.revsingle(repo, rev, None) |
2456 ctx = scmutil.revsingle(repo, rev, None) |
2457 for k, v in sorted(ctx.substate.items()): |
2457 for k, v in sorted(ctx.substate.items()): |
2458 ui.write(('path %s\n') % k) |
2458 ui.write(('path %s\n') % k) |
2459 ui.write((' source %s\n') % v[0]) |
2459 ui.write((' source %s\n') % v[0]) |
2460 ui.write((' revision %s\n') % v[1]) |
2460 ui.write((' revision %s\n') % v[1]) |
|
2461 |
|
2462 @command('debugsuccessorssets', |
|
2463 [], |
|
2464 _('[REV]')) |
|
2465 def debugsuccessorssets(ui, repo, *revs): |
|
2466 """show set of successors for revision |
|
2467 |
|
2468 A successors set of changeset A is a consistent group of revisions that |
|
2469 succeed A. It contains non-obsolete changesets only. |
|
2470 |
|
2471 In most cases a changeset A has a single successors set containing a single |
|
2472 successors (changeset A replaced by A'). |
|
2473 |
|
2474 A changeset that is made obsolete with no successors are called "pruned". |
|
2475 Such changesets have no successors sets at all. |
|
2476 |
|
2477 A changeset that has been "split" will have a successors set containing |
|
2478 more than one successors. |
|
2479 |
|
2480 A changeset that has been rewritten in multiple different ways is called |
|
2481 "divergent". Such changesets have multiple successor sets (each of which |
|
2482 may also be split, i.e. have multiple successors). |
|
2483 |
|
2484 Results are displayed as follows:: |
|
2485 |
|
2486 <rev1> |
|
2487 <successors-1A> |
|
2488 <rev2> |
|
2489 <successors-2A> |
|
2490 <successors-2B1> <successors-2B2> <successors-2B3> |
|
2491 |
|
2492 Here rev2 has two possible (i.e. divergent) successors sets. The first |
|
2493 holds one element, whereas the second holds three (i.e. the changeset has |
|
2494 been split). |
|
2495 """ |
|
2496 # passed to successorssets caching computation from one call to another |
|
2497 cache = {} |
|
2498 ctx2str = str |
|
2499 node2str = short |
|
2500 if ui.debug(): |
|
2501 def ctx2str(ctx): |
|
2502 return ctx.hex() |
|
2503 node2str = hex |
|
2504 for rev in scmutil.revrange(repo, revs): |
|
2505 ctx = repo[rev] |
|
2506 ui.write('%s\n'% ctx2str(ctx)) |
|
2507 for succsset in obsolete.successorssets(repo, ctx.node(), cache): |
|
2508 if succsset: |
|
2509 ui.write(' ') |
|
2510 ui.write(node2str(succsset[0])) |
|
2511 for node in succsset[1:]: |
|
2512 ui.write(' ') |
|
2513 ui.write(node2str(node)) |
|
2514 ui.write('\n') |
2461 |
2515 |
2462 @command('debugwalk', walkopts, _('[OPTION]... [FILE]...')) |
2516 @command('debugwalk', walkopts, _('[OPTION]... [FILE]...')) |
2463 def debugwalk(ui, repo, *pats, **opts): |
2517 def debugwalk(ui, repo, *pats, **opts): |
2464 """show how files match on given patterns""" |
2518 """show how files match on given patterns""" |
2465 m = scmutil.match(repo[None], pats, opts) |
2519 m = scmutil.match(repo[None], pats, opts) |