2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2018-01-04 18:22:19 +03:00
|
|
|
$ . "$TESTDIR/hgsql/library.sh"
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2017-04-07 21:05:00 +03:00
|
|
|
|
|
|
|
Populate the db with an initial commit
|
|
|
|
|
|
|
|
$ initserver master masterrepo
|
|
|
|
$ cd master
|
|
|
|
$ echo a > a
|
|
|
|
$ hg commit -Aqm 'add a'
|
|
|
|
$ echo b > b
|
|
|
|
$ hg commit -Aqm 'add b'
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg up -q 1f0dee641bb7258c56bd60e93edfa2405381c41e
|
2017-04-07 21:05:00 +03:00
|
|
|
$ echo c > c
|
|
|
|
$ hg commit -Aqm 'add c'
|
|
|
|
|
|
|
|
Run with a correct revlog
|
|
|
|
|
|
|
|
$ hg sqlverify
|
|
|
|
Verification passed
|
|
|
|
|
|
|
|
Run with incorrect local revlogs
|
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg debugstrip -r 7c3bad9141dcb46ff89abf5f61856facd56e476c --config hgsql.bypass=True
|
2017-04-07 21:05:00 +03:00
|
|
|
$ hg unbundle --config hgsql.bypass=True $TESTTMP/master/.hg/strip-backup/7c3bad9141dc-81844e36-backup.hg
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
2019-11-07 21:50:10 +03:00
|
|
|
added 1 changesets with 1 changes to 1 files
|
2017-04-07 21:05:00 +03:00
|
|
|
|
|
|
|
$ hg log -r tip --forcesync -T '{desc}\n'
|
|
|
|
add b
|
2018-02-12 20:36:26 +03:00
|
|
|
$ hg sqlverify >$TESTTMP/sqlverify.out 2>&1 || true
|
2020-04-16 22:21:08 +03:00
|
|
|
$ grep "Corruption.*linkrev" $TESTTMP/sqlverify.out || cat $TESTTMP/sqlverify.out
|
|
|
|
*CorruptionException: * with linkrev *, disk does not match mysql (glob)
|
2017-05-08 20:57:42 +03:00
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg debugstrip -q -r d67cd0334eeecfded222fed9009f0db4beb57585: --config hgsql.bypass=True --no-backup
|
2017-05-08 20:57:42 +03:00
|
|
|
$ hg log -r tip --forcesync -T '\n'
|
|
|
|
|
|
|
|
|
|
|
|
Run with correct changelog but incorrect revlogs
|
|
|
|
$ hg sqlverify
|
|
|
|
Verification passed
|
|
|
|
$ mkdir .hg/store/backups
|
|
|
|
$ cp .hg/store/00changelog* .hg/store/backups/
|
|
|
|
$ echo >> a
|
|
|
|
$ hg commit -qm "modify a" --config hgsql.bypass=True
|
|
|
|
$ cp .hg/store/backups/* .hg/store/
|
|
|
|
$ hg sqlverify
|
|
|
|
corruption: 'data/a.i:eb2346e7cf59326667069bf8647698840687803d' with linkrev 3 exists on local disk, but not in sql
|
|
|
|
corruption: '00manifest.i:05e2c764eb21dd7c597aab767cec621af1292344' with linkrev 3 exists on local disk, but not in sql
|
|
|
|
abort: Verification failed
|
|
|
|
[255]
|