doctor: repair hgcommits directory too

Summary: Make `hg doctor` repair the `hgcommits` directory.

Reviewed By: singhsrb

Differential Revision: D23249534

fbshipit-source-id: fd252479638e1e8ed4665531a804d2862993d25e
This commit is contained in:
Jun Wu 2020-08-20 15:12:53 -07:00 committed by Jun Wu
parent 96083b81d9
commit 8af2cb0a03
2 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,7 @@ from bindings import (
revisionstore,
tracing,
treestate as rawtreestate,
zstore,
)
from .. import (
@ -71,6 +72,7 @@ def doctor(ui, **opts):
ui.write_err(_("changelog: cannot fix automatically (consider reclone)\n"))
return 1
repairsvfs(ui, svfs, "hgcommits/v1", zstore.zstore)
ml = repairsvfs(ui, svfs, "metalog", metalog.metalog)
repairvisibleheads(ui, ml, cl)
repairtreestate(ui, vfs, repopath, cl)

View File

@ -4,6 +4,10 @@
$ setconfig format.use-symlink-atomic-write=1
Enable writing to hgcommits/v1:
$ setconfig format.use-zstore-commit-data=1 format.use-zstore-commit-data-revlog-fallback=1
Test indexedlogdatapack
$ . "$TESTDIR/library.sh"
@ -51,6 +55,7 @@ Break the repo in various ways:
#else
$ echo foo > .hg/store/metalog/roots/meta
#endif
$ rm .hg/store/hgcommits/v1/index2-id
$ rm .hg/store/allheads/meta
Check the repo is broken (exit code is non-zero):
@ -63,6 +68,7 @@ Test that 'hg doctor' can fix them:
$ hg doctor
checking internal storage
mutation: repaired
hgcommits/v1: repaired
metalog: repaired
allheads: repaired
indexedlogdatastore: repaired