Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 46479:c2435280ca63
copy-tracing: add a --compute flag to debugchangedfiles
This will help analysis of possible misbehaving cases.
Differential Revision: https://phab.mercurial-scm.org/D9946
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 02 Feb 2021 07:02:25 +0100 |
parents | 4f5e9a77ff7a |
children | 5aac1a1a5beb |
comparison
equal
deleted
inserted
replaced
46478:db9e33beb0fb | 46479:c2435280ca63 |
---|---|
482 ui.write(b' %s\n' % key) | 482 ui.write(b' %s\n' % key) |
483 for v in values: | 483 for v in values: |
484 ui.write(b' %s\n' % v) | 484 ui.write(b' %s\n' % v) |
485 | 485 |
486 | 486 |
487 @command(b'debugchangedfiles', [], b'REV') | 487 @command( |
488 def debugchangedfiles(ui, repo, rev): | 488 b'debugchangedfiles', |
489 [ | |
490 ( | |
491 b'', | |
492 b'compute', | |
493 False, | |
494 b"compute information instead of reading it from storage", | |
495 ), | |
496 ], | |
497 b'REV', | |
498 ) | |
499 def debugchangedfiles(ui, repo, rev, **opts): | |
489 """list the stored files changes for a revision""" | 500 """list the stored files changes for a revision""" |
490 ctx = scmutil.revsingle(repo, rev, None) | 501 ctx = scmutil.revsingle(repo, rev, None) |
491 sd = repo.changelog.sidedata(ctx.rev()) | 502 files = None |
492 files_block = sd.get(sidedata.SD_FILES) | 503 |
493 if files_block is not None: | 504 if opts['compute']: |
494 files = metadata.decode_files_sidedata(sd) | 505 files = metadata.compute_all_files_changes(ctx) |
506 else: | |
507 sd = repo.changelog.sidedata(ctx.rev()) | |
508 files_block = sd.get(sidedata.SD_FILES) | |
509 if files_block is not None: | |
510 files = metadata.decode_files_sidedata(sd) | |
511 if files is not None: | |
495 for f in sorted(files.touched): | 512 for f in sorted(files.touched): |
496 if f in files.added: | 513 if f in files.added: |
497 action = b"added" | 514 action = b"added" |
498 elif f in files.removed: | 515 elif f in files.removed: |
499 action = b"removed" | 516 action = b"removed" |