##// END OF EJS Templates
phases: invalidate the phases set less often on retract boundary...
phases: invalidate the phases set less often on retract boundary We already have the information to update the phase set, so we do so directly instead of invalidating the cache. This show a sizeable speedup in our `perf::unbundle` benchmark on the many-draft mozilla-try repository. ### data-env-vars.name = mozilla-try-2023-03-22-zstd-sparse-revlog # benchmark.name = hg.perf.perf-unbundle # bin-env-vars.hg.flavor = no-rust # bin-env-vars.hg.py-re2-module = default # benchmark.variants.issue6528 = disabled # benchmark.variants.revs = last-10 before: 2.055259 seconds after: 1.887064 seconds (-8.18%) # benchmark.variants.revs = last-100 before: 2.409239 seconds after: 2.222429 seconds (-7.75%) # benchmark.variants.revs = last-1000 before: 3.945648 seconds after: 3.762480 seconds (-4.64%)

File last commit:

r51882:752c5a5b default
r52313:ac1c7518 default
Show More
admin_commands.py
49 lines | 1.5 KiB | text/x-python | PythonLexer
# admin_commands.py - command processing for admin* commands
#
# Copyright 2022 Mercurial Developers
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from .i18n import _
from .admin import verify
from . import error, registrar, transaction
table = {}
command = registrar.command(table)
@command(
b'admin::verify',
[
(b'c', b'check', [], _(b'add a check'), _(b'CHECK')),
(b'o', b'option', [], _(b'pass an option to a check'), _(b'OPTION')),
],
helpcategory=command.CATEGORY_MAINTENANCE,
)
def admin_verify(ui, repo, **opts):
"""verify the integrity of the repository
Alternative UI to `hg verify` with a lot more control over the
verification process and better error reporting.
"""
if not repo.url().startswith(b'file:'):
raise error.Abort(_(b"cannot verify bundle or remote repos"))
if transaction.has_abandoned_transaction(repo):
ui.warn(_(b"abandoned transaction found - run hg recover\n"))
checks = opts.get("check", [])
options = opts.get("option", [])
funcs = verify.get_checks(repo, ui, names=checks, options=options)
ui.status(_(b"running %d checks\n") % len(funcs))
# Done in two times so the execution is separated from the resolving step
for name, func in sorted(funcs.items(), key=lambda x: x[0]):
ui.status(_(b"running %s\n") % name)
errors = func()
if errors:
ui.warn(_(b"found %d errors\n") % len(errors))