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
|
Replace (path,rev,chunk) IN (....) query since it didn't use an index
It turns out mysql doesn't optimize '(a,b,c) IN ((x,y,z),(m,n,o),...)' queries,
so we want to avoid using them.
2014-03-11 01:52:31 +04:00
|
|
|
|
|
|
|
# Populate the db with an initial commit
|
|
|
|
|
|
|
|
$ initclient client
|
|
|
|
$ cd client
|
|
|
|
$ echo x > x
|
|
|
|
$ hg commit -qAm x
|
|
|
|
$ echo y > y
|
|
|
|
$ hg commit -qAm y
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg up 'desc(x)'
|
Replace (path,rev,chunk) IN (....) query since it didn't use an index
It turns out mysql doesn't optimize '(a,b,c) IN ((x,y,z),(m,n,o),...)' queries,
so we want to avoid using them.
2014-03-11 01:52:31 +04:00
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ echo z > z
|
|
|
|
$ hg commit -qAm z
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ initserver master masterrepo
|
|
|
|
$ cd master
|
|
|
|
$ hg log
|
|
|
|
$ hg pull -q ../client
|
|
|
|
|
|
|
|
# Strip middle commit, verify sync fails
|
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg debugstrip -r 'desc(y)' --config hgsql.bypass=True
|
2015-12-07 23:56:03 +03:00
|
|
|
- The huge number in the output below is because we're trying to apply rev 0
|
|
|
|
(which contains the generaldelta bit in the offset int) to a non-rev 0
|
|
|
|
location (so the generaldelta bit isn't stripped before the comparison)
|
2020-04-16 22:21:08 +03:00
|
|
|
$ hg log -l 1 2>&1 | egrep 'Corruption.*offset'
|
|
|
|
*CorruptionException: revision offset doesn't match prior length (12884967424 offset vs 3 length): data/z.i (glob)
|
Replace (path,rev,chunk) IN (....) query since it didn't use an index
It turns out mysql doesn't optimize '(a,b,c) IN ((x,y,z),(m,n,o),...)' queries,
so we want to avoid using them.
2014-03-11 01:52:31 +04:00
|
|
|
|
|
|
|
# Recover middle commit, but on top, then try syncing (succeeds)
|
|
|
|
|
2016-05-11 23:54:24 +03:00
|
|
|
$ hg unbundle -q $TESTTMP/master/.hg/strip-backup/d34c38483be9-3839604f-backup.hg --config hgsql.bypass=True
|
Replace (path,rev,chunk) IN (....) query since it didn't use an index
It turns out mysql doesn't optimize '(a,b,c) IN ((x,y,z),(m,n,o),...)' queries,
so we want to avoid using them.
2014-03-11 01:52:31 +04:00
|
|
|
$ hg log -l 1
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: d34c38483be9
|
Replace (path,rev,chunk) IN (....) query since it didn't use an index
It turns out mysql doesn't optimize '(a,b,c) IN ((x,y,z),(m,n,o),...)' queries,
so we want to avoid using them.
2014-03-11 01:52:31 +04:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: y
|
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
# Attempt to pull new commit should fail because base rev is wrong due to reordering
|
|
|
|
|
|
|
|
$ cd client
|
|
|
|
$ echo a > a
|
|
|
|
$ hg commit -qAm a
|
|
|
|
$ cd ../master
|
2020-04-16 22:21:08 +03:00
|
|
|
$ hg pull ../client 2>&1 | egrep 'Corruption.*node'
|
|
|
|
*CorruptionException: expected node d34c38483be9d08f205eaae60c380a29b48e0189 at rev 1 of 00changelog.i but found bc3a71defa4a8fb6e8e5c192c02a26d94853d281 (glob)
|
Replace (path,rev,chunk) IN (....) query since it didn't use an index
It turns out mysql doesn't optimize '(a,b,c) IN ((x,y,z),(m,n,o),...)' queries,
so we want to avoid using them.
2014-03-11 01:52:31 +04:00
|
|
|
|
|
|
|
# Fix ordering, can pull now
|
|
|
|
|
2020-07-07 00:00:16 +03:00
|
|
|
$ hg debugstrip -r 'desc(z)' --config hgsql.bypass=True
|
2016-05-11 23:54:24 +03:00
|
|
|
$ hg unbundle -q $TESTTMP/master/.hg/strip-backup/bc3a71defa4a-48128f20-backup.hg --config hgsql.bypass=True
|
Replace (path,rev,chunk) IN (....) query since it didn't use an index
It turns out mysql doesn't optimize '(a,b,c) IN ((x,y,z),(m,n,o),...)' queries,
so we want to avoid using them.
2014-03-11 01:52:31 +04:00
|
|
|
$ hg pull ../client
|
|
|
|
pulling from ../client
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|