2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2019-10-05 06:33:58 +03:00
|
|
|
(This test needs to re-run the hg process. Therefore hard to use single-process Python test)
|
|
|
|
|
|
|
|
Test indexedlogdatapack
|
|
|
|
|
|
|
|
$ . "$TESTDIR/library.sh"
|
|
|
|
|
|
|
|
$ newrepo master
|
|
|
|
$ setconfig remotefilelog.server=true remotefilelog.serverexpiration=-1
|
|
|
|
|
|
|
|
$ cd $TESTTMP
|
2019-12-10 07:00:32 +03:00
|
|
|
$ enable remotenames
|
2019-10-05 06:33:58 +03:00
|
|
|
$ setconfig remotefilelog.debug=false remotefilelog.indexedlogdatastore=true remotefilelog.fetchpacks=true
|
2019-12-10 07:00:32 +03:00
|
|
|
$ setconfig diff.git=true experimental.narrow-heads=true mutation.record=true mutation.enabled=true mutation.date="0 0" visibility.enabled=1
|
2019-10-05 06:33:58 +03:00
|
|
|
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master shallow -q
|
|
|
|
$ cd shallow
|
|
|
|
|
2019-12-10 07:00:32 +03:00
|
|
|
Make some commits
|
2019-10-05 06:33:58 +03:00
|
|
|
|
2019-12-10 07:00:32 +03:00
|
|
|
$ drawdag << 'EOS'
|
|
|
|
> B C # amend: B -> C
|
|
|
|
> |/
|
|
|
|
> A
|
|
|
|
> EOS
|
2019-10-05 06:33:58 +03:00
|
|
|
|
2019-12-10 07:00:32 +03:00
|
|
|
When everything looks okay:
|
2019-10-05 06:33:58 +03:00
|
|
|
|
|
|
|
$ hg doctor
|
2019-12-10 07:00:32 +03:00
|
|
|
mutation: looks okay
|
|
|
|
metalog: looks okay
|
|
|
|
allheads: looks okay
|
|
|
|
indexedlogdatastore: looks okay
|
2019-10-05 06:33:58 +03:00
|
|
|
|
2019-12-10 07:00:32 +03:00
|
|
|
Break the repo in various ways:
|
2019-10-05 06:33:58 +03:00
|
|
|
|
2019-12-10 07:00:32 +03:00
|
|
|
$ echo x > $TESTTMP/hgcache/master/indexedlogdatastore/latest
|
2019-10-05 06:33:58 +03:00
|
|
|
$ echo y > $TESTTMP/hgcache/master/indexedlogdatastore/0/index-node.sum
|
2019-12-10 07:00:32 +03:00
|
|
|
$ mkdir -p .hg/store/mutation/
|
|
|
|
$ echo v > .hg/store/mutation/log
|
|
|
|
$ echo xx > .hg/store/metalog/blobs/index-id
|
|
|
|
$ echo xx > .hg/store/metalog/roots/meta
|
|
|
|
$ rm .hg/store/allheads/meta
|
|
|
|
|
2019-12-11 01:43:00 +03:00
|
|
|
Check the repo is broken (exit code is non-zero):
|
2019-12-10 07:00:32 +03:00
|
|
|
|
2019-12-11 01:43:00 +03:00
|
|
|
$ hg log -GpT '{desc}\n' &>/dev/null
|
2019-12-10 07:00:32 +03:00
|
|
|
[255]
|
|
|
|
|
|
|
|
Test that 'hg doctor' can fix them:
|
|
|
|
|
2019-10-05 06:33:58 +03:00
|
|
|
$ hg doctor
|
2019-12-10 07:00:32 +03:00
|
|
|
mutation: repaired
|
|
|
|
metalog: repaired
|
|
|
|
allheads: repaired
|
|
|
|
indexedlogdatastore: repaired
|
|
|
|
|
|
|
|
Check the repo is usable again:
|
|
|
|
|
|
|
|
$ hg log -GpT '{desc}\n'
|
|
|
|
o C
|
|
|
|
| diff --git a/C b/C
|
|
|
|
| new file mode 100644
|
|
|
|
| --- /dev/null
|
|
|
|
| +++ b/C
|
|
|
|
| @@ -0,0 +1,1 @@
|
|
|
|
| +C
|
|
|
|
| \ No newline at end of file
|
|
|
|
|
|
|
|
|
o A
|
|
|
|
diff --git a/A b/A
|
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/A
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+A
|
|
|
|
\ No newline at end of file
|
|
|
|
|