Mercurial > public > mercurial-scm > hg-stable
diff mercurial/debugcommands.py @ 49921:c84844cd523a
verify: also check dirstate
The dirstate already is capable of verifying its integrity (although v2
features are not yet checked), let's run that code in `hg verify`.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Mon, 02 May 2022 11:27:20 +0200 |
parents | fdd227585d5a |
children | 88b81dc2d82b |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Mon May 02 17:47:38 2022 +0200 +++ b/mercurial/debugcommands.py Mon May 02 11:27:20 2022 +0200 @@ -87,6 +87,7 @@ upgrade, url as urlmod, util, + verify, vfs as vfsmod, wireprotoframing, wireprotoserver, @@ -554,15 +555,9 @@ @command(b'debugcheckstate', [], b'') def debugcheckstate(ui, repo): """validate the correctness of the current dirstate""" - parent1, parent2 = repo.dirstate.parents() - m1 = repo[parent1].manifest() - m2 = repo[parent2].manifest() - errors = 0 - for err in repo.dirstate.verify(m1, m2): - ui.warn(err) - errors += 1 + errors = verify.verifier(repo)._verify_dirstate() if errors: - errstr = _(b".hg/dirstate inconsistent with current parent's manifest") + errstr = _(b"dirstate inconsistent with current parent's manifest") raise error.Abort(errstr)