Mercurial > public > mercurial-scm > hg-stable
diff mercurial/debugcommands.py @ 51077:810446d2d5ef
debug-delta-chaing: add a parameter to select revision to look at
This allows for much faster runtime when we are interrested in some revisions only.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 19 Sep 2023 01:24:10 +0200 |
parents | d7f975e49f20 |
children | 752e380c5702 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Mon Sep 18 23:37:06 2023 +0200 +++ b/mercurial/debugcommands.py Tue Sep 19 01:24:10 2023 +0200 @@ -746,7 +746,16 @@ @command( b'debugdeltachain', - cmdutil.debugrevlogopts + cmdutil.formatteropts, + [ + ( + b'r', + b'rev', + [], + _('restrict processing to these revlog revisions'), + ), + ] + + cmdutil.debugrevlogopts + + cmdutil.formatteropts, _(b'-c|-m|FILE'), optionalrepo=True, ) @@ -797,12 +806,16 @@ The sparse read can be enabled with experimental.sparse-read = True """ + revs = None + revs_opt = opts.pop('rev', []) + if revs_opt: + revs = [int(r) for r in revs_opt] revlog = cmdutil.openrevlog( repo, b'debugdeltachain', file_, pycompat.byteskwargs(opts) ) fm = ui.formatter(b'debugdeltachain', pycompat.byteskwargs(opts)) - lines = revlog_debug.debug_delta_chain(revlog) + lines = revlog_debug.debug_delta_chain(revlog, revs=revs) # first entry is the header header = next(lines) fm.plain(header)