##// END OF EJS Templates
debug-delta-chaing: add a parameter to select revision to look at...
marmoute -
r51965:810446d2 default
parent child Browse files
Show More
@@ -746,7 +746,16 b' def debugdate(ui, date, range=None, **op'
746
746
747 @command(
747 @command(
748 b'debugdeltachain',
748 b'debugdeltachain',
749 cmdutil.debugrevlogopts + cmdutil.formatteropts,
749 [
750 (
751 b'r',
752 b'rev',
753 [],
754 _('restrict processing to these revlog revisions'),
755 ),
756 ]
757 + cmdutil.debugrevlogopts
758 + cmdutil.formatteropts,
750 _(b'-c|-m|FILE'),
759 _(b'-c|-m|FILE'),
751 optionalrepo=True,
760 optionalrepo=True,
752 )
761 )
@@ -797,12 +806,16 b' def debugdeltachain(ui, repo, file_=None'
797
806
798 The sparse read can be enabled with experimental.sparse-read = True
807 The sparse read can be enabled with experimental.sparse-read = True
799 """
808 """
809 revs = None
810 revs_opt = opts.pop('rev', [])
811 if revs_opt:
812 revs = [int(r) for r in revs_opt]
800 revlog = cmdutil.openrevlog(
813 revlog = cmdutil.openrevlog(
801 repo, b'debugdeltachain', file_, pycompat.byteskwargs(opts)
814 repo, b'debugdeltachain', file_, pycompat.byteskwargs(opts)
802 )
815 )
803 fm = ui.formatter(b'debugdeltachain', pycompat.byteskwargs(opts))
816 fm = ui.formatter(b'debugdeltachain', pycompat.byteskwargs(opts))
804
817
805 lines = revlog_debug.debug_delta_chain(revlog)
818 lines = revlog_debug.debug_delta_chain(revlog, revs=revs)
806 # first entry is the header
819 # first entry is the header
807 header = next(lines)
820 header = next(lines)
808 fm.plain(header)
821 fm.plain(header)
@@ -801,7 +801,7 b' class DeltaChainAuditor:'
801 return p1, p2, compsize, uncompsize, deltatype, chain, chain_size
801 return p1, p2, compsize, uncompsize, deltatype, chain, chain_size
802
802
803
803
804 def debug_delta_chain(revlog):
804 def debug_delta_chain(revlog, revs=None):
805 auditor = DeltaChainAuditor(revlog)
805 auditor = DeltaChainAuditor(revlog)
806 r = revlog
806 r = revlog
807 start = r.start
807 start = r.start
@@ -818,8 +818,14 b' def debug_delta_chain(revlog):'
818 header += b'\n'
818 header += b'\n'
819 yield header
819 yield header
820
820
821 if revs is None:
822 all_revs = iter(r)
823 else:
824 revlog_size = len(r)
825 all_revs = sorted(rev for rev in revs if rev < revlog_size)
826
821 chainbases = {}
827 chainbases = {}
822 for rev in r:
828 for rev in all_revs:
823 p1, p2, comp, uncomp, deltatype, chain, chainsize = auditor.revinfo(rev)
829 p1, p2, comp, uncomp, deltatype, chain, chainsize = auditor.revinfo(rev)
824 chainbase = chain[0]
830 chainbase = chain[0]
825 chainid = chainbases.setdefault(chainbase, len(chainbases) + 1)
831 chainid = chainbases.setdefault(chainbase, len(chainbases) + 1)
@@ -296,7 +296,7 b' Show all commands + options'
296 debugdag: tags, branches, dots, spaces
296 debugdag: tags, branches, dots, spaces
297 debugdata: changelog, manifest, dir
297 debugdata: changelog, manifest, dir
298 debugdate: extended
298 debugdate: extended
299 debugdeltachain: changelog, manifest, dir, template
299 debugdeltachain: rev, changelog, manifest, dir, template
300 debugdirstateignorepatternshash:
300 debugdirstateignorepatternshash:
301 debugdirstate: nodates, dates, datesort, docket, all
301 debugdirstate: nodates, dates, datesort, docket, all
302 debugdiscovery: old, nonheads, rev, seed, local-as-revs, remote-as-revs, ssh, remotecmd, insecure, template
302 debugdiscovery: old, nonheads, rev, seed, local-as-revs, remote-as-revs, ssh, remotecmd, insecure, template
General Comments 0
You need to be logged in to leave comments. Login now