comparison mercurial/debugcommands.py @ 47916:0fb328bb2459

debugrebuildfncache: add a cheaper option to rebuild the fncache On my repository, debugrebuildfncache takes 5-10min with the lock. With the flag added in this commit, it takes 10s. The tradeoff is that it only recovers from certain kinds of corruptions. It is intended to to recover faster from fncaches broken by a revlog split during a transaction that ends up being rolled back. Differential Revision: https://phab.mercurial-scm.org/D11265
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Fri, 06 Aug 2021 16:27:17 -0400
parents 855463b5fe49
children 357307feaf61
comparison
equal deleted inserted replaced
47915:308e843f24b1 47916:0fb328bb2459
2985 changedfiles = manifestonly | dsnotadded 2985 changedfiles = manifestonly | dsnotadded
2986 2986
2987 dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles) 2987 dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
2988 2988
2989 2989
2990 @command(b'debugrebuildfncache', [], b'') 2990 @command(
2991 def debugrebuildfncache(ui, repo): 2991 b'debugrebuildfncache',
2992 [
2993 (
2994 b'',
2995 b'only-data',
2996 False,
2997 _(b'only look for wrong .d files (much faster)'),
2998 )
2999 ],
3000 b'',
3001 )
3002 def debugrebuildfncache(ui, repo, **opts):
2992 """rebuild the fncache file""" 3003 """rebuild the fncache file"""
2993 repair.rebuildfncache(ui, repo) 3004 opts = pycompat.byteskwargs(opts)
3005 repair.rebuildfncache(ui, repo, opts.get(b"only_data"))
2994 3006
2995 3007
2996 @command( 3008 @command(
2997 b'debugrename', 3009 b'debugrename',
2998 [(b'r', b'rev', b'', _(b'revision to debug'), _(b'REV'))], 3010 [(b'r', b'rev', b'', _(b'revision to debug'), _(b'REV'))],