2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
|
|
|
#chg-compatible
|
|
|
|
|
2019-02-07 15:54:57 +03:00
|
|
|
#testcases vfscachestore simplecachestore
|
2019-10-29 05:18:47 +03:00
|
|
|
$ setconfig treemanifest.flatcompat=False
|
2019-02-07 15:54:57 +03:00
|
|
|
|
2018-10-27 04:52:14 +03:00
|
|
|
TODO: Make this test compatibile with obsstore enabled.
|
|
|
|
$ setconfig experimental.evolution=
|
2017-03-10 01:45:23 +03:00
|
|
|
$ . "$TESTDIR/library.sh"
|
|
|
|
|
|
|
|
|
2018-01-30 04:31:53 +03:00
|
|
|
- Disable simplecache since it can cause certain reads to not actually hit the
|
|
|
|
- ondisk structures.
|
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> simplecache=!
|
|
|
|
> EOF
|
|
|
|
|
2017-03-10 01:45:23 +03:00
|
|
|
$ hginit master
|
|
|
|
$ cd master
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
2018-01-09 23:59:00 +03:00
|
|
|
> pushrebase=
|
|
|
|
> treemanifest=
|
2017-03-10 01:45:23 +03:00
|
|
|
> [treemanifest]
|
|
|
|
> server=True
|
|
|
|
> [remotefilelog]
|
|
|
|
> server=True
|
|
|
|
> EOF
|
2017-03-10 01:45:23 +03:00
|
|
|
|
2019-02-07 15:54:57 +03:00
|
|
|
#if simplecachestore
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [treemanifest]
|
|
|
|
> simplecacheserverstore=True
|
|
|
|
> cacheserverstore=False
|
|
|
|
> [extensions]
|
|
|
|
> simplecache=
|
|
|
|
> [simplecache]
|
|
|
|
> cachedir=$TESTTMP/master/.hg/hgsimplecache
|
|
|
|
> caches=local
|
|
|
|
> EOF
|
|
|
|
#endif
|
|
|
|
|
2017-03-10 01:45:23 +03:00
|
|
|
Test that local commits on the server produce trees
|
2017-03-10 01:45:23 +03:00
|
|
|
$ mkdir subdir
|
|
|
|
$ echo x > subdir/x
|
|
|
|
$ hg commit -qAm 'add subdir/x'
|
|
|
|
|
2017-07-14 21:47:12 +03:00
|
|
|
Create client
|
|
|
|
$ cd ..
|
2017-03-10 01:45:23 +03:00
|
|
|
$ hgcloneshallow ssh://user@dummy/master client -q
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' 5fbe397e5ac6cb7ee263c5c67613c4665306d143
|
|
|
|
2 trees fetched over * (glob)
|
2020-01-09 18:44:55 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
2017-03-10 01:45:23 +03:00
|
|
|
$ cd client
|
2017-07-14 21:47:12 +03:00
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
2018-01-09 23:59:00 +03:00
|
|
|
> treemanifest=
|
2017-07-14 21:47:12 +03:00
|
|
|
> [treemanifest]
|
|
|
|
> demanddownload=True
|
2017-11-07 04:26:08 +03:00
|
|
|
> sendtrees=True
|
2017-07-14 21:47:12 +03:00
|
|
|
> EOF
|
|
|
|
|
|
|
|
Test committing auto-downloads server trees and produces local trees
|
|
|
|
$ [ -d $CACHEDIR/master/packs/manifests/ ]
|
|
|
|
$ [ -d .hg/store/packs/manifests/ ]
|
|
|
|
[1]
|
|
|
|
|
2017-03-10 01:45:23 +03:00
|
|
|
$ mkdir subdir2
|
|
|
|
$ echo z >> subdir2/z
|
|
|
|
$ hg commit -qAm "add subdir2/z"
|
|
|
|
|
2017-07-14 21:47:12 +03:00
|
|
|
$ hg debugdatapack $CACHEDIR/master/packs/manifests/*.dataidx
|
2019-10-29 05:18:47 +03:00
|
|
|
$TESTTMP/hgcache/master/packs/manifests/a812081e090d54a6456c803a3b6b150fee534e24:
|
2017-11-06 08:45:40 +03:00
|
|
|
subdir:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
|
|
|
bc0c2c938b92 000000000000 43 (missing)
|
2017-07-14 21:47:12 +03:00
|
|
|
|
2017-11-06 08:45:40 +03:00
|
|
|
(empty name):
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-10-29 05:18:47 +03:00
|
|
|
5fbe397e5ac6 000000000000 49 (missing)
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2017-03-10 01:45:23 +03:00
|
|
|
|
2017-07-14 21:47:12 +03:00
|
|
|
$ hg debugdatapack .hg/store/packs/manifests/*.dataidx
|
2019-10-29 05:18:47 +03:00
|
|
|
.hg/store/packs/manifests/d4f05b2454a18da827121dfaf9995f1fcb3962a2:
|
2017-11-06 08:45:40 +03:00
|
|
|
subdir2:
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
|
|
|
ddb35f099a64 000000000000 43 (missing)
|
2017-07-14 21:47:12 +03:00
|
|
|
|
2017-11-06 08:45:40 +03:00
|
|
|
(empty name):
|
2017-11-06 05:45:21 +03:00
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-10-29 05:18:47 +03:00
|
|
|
22c7050fc6d1 000000000000 99 (missing)
|
2017-11-07 06:09:15 +03:00
|
|
|
|
2017-07-14 21:47:12 +03:00
|
|
|
|
2018-03-17 01:16:37 +03:00
|
|
|
Test pushing only flat manifests without pushrebase creates trees
|
2019-10-29 05:18:47 +03:00
|
|
|
$ hg push
|
2017-03-10 01:45:23 +03:00
|
|
|
pushing to ssh://user@dummy/master
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
2018-03-12 21:10:07 +03:00
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
|
|
|
$ hg --cwd ../master debugindex .hg/store/meta/subdir2/00manifest.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
|
|
|
0 0 44 -1 1 ddb35f099a64 000000000000 000000000000
|
|
|
|
$ hg debugdatapack .hg/store/packs/manifests/*.datapack
|
2019-10-29 05:18:47 +03:00
|
|
|
.hg/store/packs/manifests/d4f05b2454a18da827121dfaf9995f1fcb3962a2:
|
2018-03-12 21:10:07 +03:00
|
|
|
subdir2:
|
|
|
|
Node Delta Base Delta Length Blob Size
|
|
|
|
ddb35f099a64 000000000000 43 (missing)
|
|
|
|
|
|
|
|
(empty name):
|
|
|
|
Node Delta Base Delta Length Blob Size
|
2019-10-29 05:18:47 +03:00
|
|
|
22c7050fc6d1 000000000000 99 (missing)
|
2018-03-12 21:10:07 +03:00
|
|
|
|
|
|
|
$ hg --cwd ../master debugindex -m
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
2019-10-29 05:18:47 +03:00
|
|
|
0 0 50 -1 0 5fbe397e5ac6 000000000000 000000000000
|
|
|
|
1 50 62 0 1 22c7050fc6d1 5fbe397e5ac6 000000000000
|
2018-03-12 21:10:07 +03:00
|
|
|
$ hg --cwd ../master debugindex .hg/store/00manifesttree.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
2019-10-29 05:18:47 +03:00
|
|
|
0 0 50 -1 0 5fbe397e5ac6 000000000000 000000000000
|
|
|
|
1 50 62 0 1 22c7050fc6d1 5fbe397e5ac6 000000000000
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg -R ../master debugstrip -r tip
|
2019-10-29 05:18:47 +03:00
|
|
|
saved backup bundle to $TESTTMP/master/.hg/strip-backup/af56a207a2d7-529d209b-backup.hg
|
2018-03-12 21:10:07 +03:00
|
|
|
$ hg phase -dfr .
|
2017-03-10 01:45:23 +03:00
|
|
|
|
2017-07-14 21:47:12 +03:00
|
|
|
Test pushing only flat fails if forcetreereceive is on
|
|
|
|
$ cat >> ../master/.hg/hgrc <<EOF
|
|
|
|
> [pushrebase]
|
|
|
|
> forcetreereceive=True
|
|
|
|
> EOF
|
2017-03-10 01:45:23 +03:00
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
2018-01-09 23:59:00 +03:00
|
|
|
> pushrebase=
|
2017-03-10 01:45:23 +03:00
|
|
|
> EOF
|
2018-02-02 21:04:15 +03:00
|
|
|
$ hg push --to mybook --config treemanifest.sendtrees=False
|
2017-03-10 01:45:23 +03:00
|
|
|
pushing to ssh://user@dummy/master
|
|
|
|
searching for changes
|
2017-07-14 21:47:12 +03:00
|
|
|
remote: error: pushes must contain tree manifests when the server has pushrebase.forcetreereceive enabled
|
|
|
|
abort: push failed on remote
|
|
|
|
[255]
|
|
|
|
|
2017-11-02 03:10:05 +03:00
|
|
|
Test pushing flat and tree
|
2017-07-14 21:47:12 +03:00
|
|
|
$ cat >> $TESTTMP/myhook.sh <<EOF
|
2020-01-15 08:00:48 +03:00
|
|
|
> set -e
|
2017-07-14 21:47:12 +03:00
|
|
|
> [[ \$(hg log -r \$HG_NODE -T '{file_adds}') == 'subdir2/z' ]] && exit 1
|
|
|
|
> exit 2
|
|
|
|
> EOF
|
2018-01-30 04:31:53 +03:00
|
|
|
$ cat >> $TESTTMP/myhook.py <<EOF
|
2019-01-30 03:25:33 +03:00
|
|
|
> from edenscm.mercurial import bundlerepo
|
2018-01-30 04:31:53 +03:00
|
|
|
> def myhook(ui=None, repo=None, hooktype=None, **hookargs):
|
|
|
|
> node = hookargs.get('node', None)
|
|
|
|
> ctx = repo[node]
|
|
|
|
> # Test comparing a flat and tree manifest
|
|
|
|
> ctx.p1().manifest().diff(ctx.manifest())
|
|
|
|
> EOF
|
2017-07-14 21:47:12 +03:00
|
|
|
$ chmod a+x $TESTTMP/myhook.sh
|
|
|
|
$ cp ../master/.hg/hgrc ../master/.hg/hgrc.bak
|
|
|
|
$ cat >> ../master/.hg/hgrc <<EOF
|
|
|
|
> [hooks]
|
2018-01-30 04:31:53 +03:00
|
|
|
> prepushrebase.myhookpy=python:$TESTTMP/myhook.py:myhook
|
2017-07-14 21:47:12 +03:00
|
|
|
> prepushrebase.myhook=$TESTTMP/myhook.sh
|
|
|
|
> EOF
|
|
|
|
$ hg push --to mybook
|
|
|
|
pushing to ssh://user@dummy/master
|
|
|
|
searching for changes
|
|
|
|
remote: prepushrebase.myhook hook exited with status 1
|
|
|
|
abort: push failed on remote
|
|
|
|
[255]
|
2017-11-02 03:10:05 +03:00
|
|
|
|
2017-11-02 03:10:05 +03:00
|
|
|
Test pushing tree-only commit with commit hooks
|
|
|
|
$ hg up -q '.^'
|
|
|
|
$ mkdir subdir2
|
|
|
|
$ echo >> subdir2/z
|
|
|
|
$ hg commit -qAm 'add subdir2/z (treeonly)' --config treemanifest.treeonly=True
|
|
|
|
$ hg push --to mybook -r .
|
2017-11-02 03:10:05 +03:00
|
|
|
pushing to ssh://user@dummy/master
|
|
|
|
searching for changes
|
|
|
|
remote: prepushrebase.myhook hook exited with status 1
|
|
|
|
abort: push failed on remote
|
|
|
|
[255]
|
2017-07-14 21:47:12 +03:00
|
|
|
$ mv ../master/.hg/hgrc.bak ../master/.hg/hgrc
|
|
|
|
|
|
|
|
Test pushing only trees (no flats) with pushrebase creates trees on the server
|
2017-11-02 03:10:05 +03:00
|
|
|
$ hg push --to mybook -r .
|
2017-07-14 21:47:12 +03:00
|
|
|
pushing to ssh://user@dummy/master
|
|
|
|
searching for changes
|
2017-07-24 21:42:24 +03:00
|
|
|
remote: pushing 1 changeset:
|
2019-10-29 05:18:47 +03:00
|
|
|
remote: 4d563be8759a add subdir2/z (treeonly)
|
2017-03-10 01:45:23 +03:00
|
|
|
$ ls ../master/.hg/store/meta
|
|
|
|
subdir
|
|
|
|
subdir2
|
2017-11-02 03:10:05 +03:00
|
|
|
- Verify it doesn't put anything in the pack directory
|
|
|
|
$ ls_l ../master/.hg/store | grep pack
|
|
|
|
[1]
|
2017-03-10 01:45:23 +03:00
|
|
|
$ cd ../master
|
2017-07-14 21:47:12 +03:00
|
|
|
|
|
|
|
Verify flat was updated and tree was updated, even though only tree was sent
|
2017-03-10 01:45:23 +03:00
|
|
|
$ hg debugdata .hg/store/00manifesttree.i 1
|
|
|
|
subdir\x00bc0c2c938b929f98b1c31a8c5994396ebb096bf0t (esc)
|
2017-11-02 03:10:05 +03:00
|
|
|
subdir2\x0002fd4859c40acf72a0ce0f75c2f8bef76935f3dct (esc)
|
2017-05-10 23:48:34 +03:00
|
|
|
|
2017-07-14 21:47:12 +03:00
|
|
|
$ hg debugdata .hg/store/meta/subdir2/00manifest.i 0
|
2017-11-02 03:10:05 +03:00
|
|
|
z\x00cc31c19aff7dbbbed214ec304839a8003fdd0b10 (esc)
|
2017-07-14 21:47:12 +03:00
|
|
|
|
2017-05-10 23:48:34 +03:00
|
|
|
Test stripping trees
|
|
|
|
$ hg up -q tip
|
|
|
|
$ echo a >> subdir/a
|
|
|
|
$ hg commit -Aqm 'modify subdir/a'
|
|
|
|
$ hg debugindex .hg/store/00manifesttree.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
2019-10-29 05:18:47 +03:00
|
|
|
0 0 50 -1 0 5fbe397e5ac6 000000000000 000000000000
|
|
|
|
1 50 62 0 1 fc64d44480b1 5fbe397e5ac6 000000000000
|
|
|
|
2 112 61 1 2 43eec525087d fc64d44480b1 000000000000
|
2017-05-10 23:48:34 +03:00
|
|
|
$ hg debugindex .hg/store/meta/subdir/00manifest.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
|
|
|
0 0 44 -1 0 bc0c2c938b92 000000000000 000000000000
|
|
|
|
1 44 54 0 2 126c4ddee02e bc0c2c938b92 000000000000
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg debugstrip -r tip
|
2017-05-10 23:48:34 +03:00
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2019-10-29 05:18:47 +03:00
|
|
|
saved backup bundle to $TESTTMP/master/.hg/strip-backup/158d5964f506-73555d7d-backup.hg
|
2017-05-10 23:48:34 +03:00
|
|
|
$ hg debugindex .hg/store/00manifesttree.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
2019-10-29 05:18:47 +03:00
|
|
|
0 0 50 -1 0 5fbe397e5ac6 000000000000 000000000000
|
|
|
|
1 50 62 0 1 fc64d44480b1 5fbe397e5ac6 000000000000
|
2017-05-10 23:48:34 +03:00
|
|
|
$ hg debugindex .hg/store/meta/subdir/00manifest.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
|
|
|
0 0 44 -1 0 bc0c2c938b92 000000000000 000000000000
|
2018-01-25 20:34:18 +03:00
|
|
|
|
2018-03-29 02:05:43 +03:00
|
|
|
Test stripping merge commits where filelogs arent affected
|
|
|
|
$ rsync -a .hg/ $TESTTMP/backup.hg/
|
|
|
|
$ echo a >> subdir/a
|
|
|
|
$ hg commit -Aqm one
|
|
|
|
$ hg up -q '.^'
|
|
|
|
$ echo b >> subdir/b
|
|
|
|
$ hg commit -Aqm two
|
|
|
|
$ hg merge -q 'first(children(.^))'
|
|
|
|
$ hg commit -m 'merge'
|
|
|
|
$ hg log -r . -T '{rev}\n'
|
|
|
|
4
|
|
|
|
$ hg debugindex .hg/store/meta/subdir/00manifest.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
|
|
|
0 0 44 -1 0 bc0c2c938b92 000000000000 000000000000
|
|
|
|
1 44 54 0 2 126c4ddee02e bc0c2c938b92 000000000000
|
|
|
|
2 98 54 0 3 abeda9251d1d bc0c2c938b92 000000000000
|
2018-05-31 04:18:26 +03:00
|
|
|
3 152 54 2 4 d1018f351d1e abeda9251d1d 126c4ddee02e
|
2018-03-29 02:05:43 +03:00
|
|
|
- Verify rev 3 (from the merge commit) is gone after the strip
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg debugstrip -r tip
|
2018-03-29 02:05:43 +03:00
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
2019-10-29 05:18:47 +03:00
|
|
|
saved backup bundle to $TESTTMP/master/.hg/strip-backup/9f5a7a12b9ff-4c1164ca-backup.hg
|
2018-03-29 02:05:43 +03:00
|
|
|
$ hg debugindex .hg/store/meta/subdir/00manifest.i
|
|
|
|
rev offset length delta linkrev nodeid p1 p2
|
|
|
|
0 0 44 -1 0 bc0c2c938b92 000000000000 000000000000
|
|
|
|
1 44 54 0 2 126c4ddee02e bc0c2c938b92 000000000000
|
|
|
|
2 98 54 0 3 abeda9251d1d bc0c2c938b92 000000000000
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg debugstrip -qr 'children(.^)'
|
2018-03-29 02:05:43 +03:00
|
|
|
$ rm -rf .hg
|
|
|
|
$ cp -R $TESTTMP/backup.hg .hg
|
|
|
|
$ rm -rf $TESTTMP/backup.hg
|
|
|
|
|
2018-01-25 20:34:18 +03:00
|
|
|
Test fetching from the server populates the cache
|
|
|
|
$ cd ../
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master client2 -q -U
|
|
|
|
$ cd client2
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> treemanifest=
|
2018-10-09 17:53:22 +03:00
|
|
|
> pushrebase=
|
2018-01-25 20:34:18 +03:00
|
|
|
> [treemanifest]
|
|
|
|
> demanddownload=True
|
|
|
|
> sendtrees=True
|
|
|
|
> treeonly=True
|
|
|
|
> EOF
|
2018-05-21 19:00:38 +03:00
|
|
|
$ rm -rf .hg/store/00manifest*
|
2018-01-25 20:34:18 +03:00
|
|
|
$ clearcache
|
|
|
|
$ hg status --change tip > /dev/null
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' 5fbe397e5ac6cb7ee263c5c67613c4665306d143
|
2018-01-25 20:34:18 +03:00
|
|
|
2 trees fetched over * (glob)
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' fc64d44480b1e632a2561bf8a8500b004eaa8d9a, based on 5fbe397e5ac6cb7ee263c5c67613c4665306d143, found via 4d563be8759a
|
2018-01-25 20:34:18 +03:00
|
|
|
2 trees fetched over * (glob)
|
2019-02-07 15:54:57 +03:00
|
|
|
#if simplecachestore
|
|
|
|
$ find ../master/.hg/hgsimplecache/trees/v2/get -type f | wc -l
|
2019-10-29 05:18:47 +03:00
|
|
|
\s*6 (re)
|
2019-02-07 15:54:57 +03:00
|
|
|
$ find ../master/.hg/hgsimplecache/trees/v2/nodeinfo -type f | wc -l
|
|
|
|
\s*4 (re)
|
|
|
|
#else
|
2018-05-21 19:00:38 +03:00
|
|
|
$ find ../master/.hg/cache/trees/v2/get -type f | wc -l
|
2019-10-29 05:18:47 +03:00
|
|
|
\s*6 (re)
|
2018-05-21 19:00:38 +03:00
|
|
|
$ find ../master/.hg/cache/trees/v2/nodeinfo -type f | wc -l
|
2018-02-08 04:17:28 +03:00
|
|
|
\s*4 (re)
|
2019-02-07 15:54:57 +03:00
|
|
|
#endif
|
2018-01-25 20:34:18 +03:00
|
|
|
|
|
|
|
- Move the revlogs away to show that the cache is answering prefetches
|
|
|
|
$ mv ../master/.hg/store/meta ../master/.hg/store/meta.bak
|
|
|
|
$ clearcache
|
|
|
|
$ hg status --change tip > /dev/null
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' 5fbe397e5ac6cb7ee263c5c67613c4665306d143
|
2018-01-25 20:34:18 +03:00
|
|
|
2 trees fetched over * (glob)
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' fc64d44480b1e632a2561bf8a8500b004eaa8d9a, based on 5fbe397e5ac6cb7ee263c5c67613c4665306d143, found via 4d563be8759a
|
2018-01-25 20:34:18 +03:00
|
|
|
2 trees fetched over * (glob)
|
2018-05-21 19:00:38 +03:00
|
|
|
|
|
|
|
- Corrupt the cache with the wrong value for a key and verify it notices
|
|
|
|
- (by going past the cache and failing to access the revlog)
|
2019-02-07 15:54:57 +03:00
|
|
|
#if simplecachestore
|
2019-10-29 05:18:47 +03:00
|
|
|
$ cp ../master/.hg/hgsimplecache/trees/v2/get/bf/d3db72113838ac7ebcf260374e4bf2884b3ddd:v2 ../master/.hg/hgsimplecache/trees/v2/get/d4/395b5ffa18499864439ac2b1a731ff7b7491fa:v2
|
2019-02-07 15:54:57 +03:00
|
|
|
#else
|
2019-10-29 05:18:47 +03:00
|
|
|
$ cp ../master/.hg/cache/trees/v2/get/bf/d3db72113838ac7ebcf260374e4bf2884b3ddd ../master/.hg/cache/trees/v2/get/d4/395b5ffa18499864439ac2b1a731ff7b7491fa
|
2019-02-07 15:54:57 +03:00
|
|
|
#endif
|
2018-05-21 19:00:38 +03:00
|
|
|
$ clearcache
|
test-fb-hgext-treemanifest-server.t: silence spurious errors
Summary:
The test frequently fails with spurious remote errors such as:
remote: ** Unknown exception encountered with possibly-broken third-party extension treemanifest.
remote: ** Please disable treemanifest and try your action again.
remote: ** If that fixes the bug please report it to the extension author.
remote: ** Python 2.7.11 (default, Feb 5 2019, 17:19:11) [GCC 5.x 20180625 (Facebook) 5.5.0+]
remote: ** Mercurial Distributed SCM (version 4.4.2_dev)
remote: ** Extensions loaded: remotefilelog, rebase, simplecache, treemanifest, conflictinfo, debugshell, errorredirect, githelp, mergedriver, progressfile, pushrebase
remote: Traceback (most recent call last):
remote: File "<string>", line 44, in <module>
remote: File "<string>", line 42, in __run
remote: File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 162, in _run_module_as_main
remote: "__main__", fname, loader, pkg_name)
remote: File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 72, in _run_code
remote: exec code in run_globals
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/hg.py", line 42, in <module>
remote: entrypoint.run(False)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/entrypoint.py", line 80, in run
remote: dispatch.run()
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 99, in run
remote: status = (dispatch(req) or 0) & 255
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 393, in dispatch
remote: ret = _runcatch(req)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 575, in _runcatch
remote: return _callcatch(ui, _runcatchfunc)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 584, in _callcatch
remote: return scmutil.callcatch(ui, func)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/scmutil.py", line 135, in callcatch
remote: return func()
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 565, in _runcatchfunc
remote: return _dispatch(req)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 1353, in _dispatch
remote: lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 1053, in runcommand
remote: ret = _runcommand(ui, options, cmd, d)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 1365, in _runcommand
remote: return cmdfunc()
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/dispatch.py", line 1350, in <lambda>
remote: d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/util.py", line 1337, in check
remote: return func(*args, **kwargs)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/commands/__init__.py", line 5635, in serve
remote: s.serve_forever()
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/sshserver.py", line 107, in serve_forever
remote: while self.serve_one():
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/sshserver.py", line 139, in serve_one
remote: self.handlers[rsp.__class__](self, rsp)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/sshserver.py", line 88, in sendstream
remote: for chunk in gen:
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/bundle2.py", line 710, in getchunks
remote: self._getcorechunk(), self._compopts
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/bundle2.py", line 732, in _getcorechunk
remote: for chunk in part.getchunks(ui=self.ui):
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/bundle2.py", line 1165, in getchunks
remote: pycompat.raisewithtb(exc, tb)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/bundle2.py", line 1141, in getchunks
remote: for chunk in self._payloadchunks():
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/bundle2.py", line 1181, in _payloadchunks
remote: chunk = buff.read(preferedchunksize)
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/util.py", line 2062, in read
remote: for chunk in self.iter:
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/mercurial/util.py", line 2033, in splitbig
remote: for chunk in chunks:
remote: File "/data/users/xavierd/fbsource/fbcode/buck-out/dev/gen/scm/hg/hg#link-tree/edenscm/hgext/treemanifest/__init__.py", line 2255, in _generatepackstream
remote: for subname, subnode, subtext, x, x, x in subtrees:
remote: RuntimeError: std::exception
They don't seem to affect what the test expect (missing node on the server), so
let's disable these
Reviewed By: DurhamG
Differential Revision: D14446457
fbshipit-source-id: 0ecb114bfcdeef1a3fcfef5a927f725401f90d4e
2019-03-15 01:58:11 +03:00
|
|
|
The server sometimes throws spurious errors, see: D14446457
|
|
|
|
$ hg status --change tip 2>&1 > /dev/null | grep -v '^remote:'
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' 5fbe397e5ac6cb7ee263c5c67613c4665306d143
|
2018-05-21 19:00:38 +03:00
|
|
|
2 trees fetched over * (glob)
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' fc64d44480b1e632a2561bf8a8500b004eaa8d9a, based on 5fbe397e5ac6cb7ee263c5c67613c4665306d143, found via 4d563be8759a
|
|
|
|
abort: "unable to find the following nodes locally or on the server: ('', fc64d44480b1e632a2561bf8a8500b004eaa8d9a)"
|
2018-05-21 19:00:38 +03:00
|
|
|
|
|
|
|
- Verify the cache remediates itself from the corruption
|
|
|
|
- (now that the revlogs are back)
|
|
|
|
$ clearcache
|
2018-01-25 20:34:18 +03:00
|
|
|
$ mv ../master/.hg/store/meta.bak ../master/.hg/store/meta
|
2018-05-21 19:00:38 +03:00
|
|
|
$ hg status --change tip > /dev/null
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' 5fbe397e5ac6cb7ee263c5c67613c4665306d143
|
2018-05-21 19:00:38 +03:00
|
|
|
2 trees fetched over * (glob)
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' fc64d44480b1e632a2561bf8a8500b004eaa8d9a, based on 5fbe397e5ac6cb7ee263c5c67613c4665306d143, found via 4d563be8759a
|
2018-05-21 19:00:38 +03:00
|
|
|
2 trees fetched over * (glob)
|
2018-01-25 20:34:18 +03:00
|
|
|
|
|
|
|
- Ensure the server evicts the cache
|
|
|
|
$ cat >> ../master/.hg/hgrc <<EOF
|
|
|
|
> [treemanifest]
|
|
|
|
> servermaxcachesize=0
|
|
|
|
> servercacheevictionpercent=90
|
|
|
|
> EOF
|
2019-02-07 15:54:57 +03:00
|
|
|
#if simplecachestore
|
|
|
|
$ find ../master/.hg/hgsimplecache/trees/v2/nodeinfo -type f | xargs -n 1 -I{} cp {} {}2
|
|
|
|
$ find ../master/.hg/hgsimplecache/trees/v2/nodeinfo -type f | xargs -n 1 -I{} cp {} {}3
|
|
|
|
$ find ../master/.hg/hgsimplecache/trees/v2/nodeinfo -type f | xargs -n 1 -I{} mv {} {}4
|
|
|
|
$ find ../master/.hg/hgsimplecache/trees/v2/nodeinfo -type f | wc -l
|
|
|
|
\s*16 (re)
|
|
|
|
#else
|
2018-05-21 19:00:38 +03:00
|
|
|
$ find ../master/.hg/cache/trees/v2/nodeinfo -type f | xargs -n 1 -I{} cp {} {}2
|
|
|
|
$ find ../master/.hg/cache/trees/v2/nodeinfo -type f | xargs -n 1 -I{} cp {} {}3
|
|
|
|
$ find ../master/.hg/cache/trees/v2/nodeinfo -type f | xargs -n 1 -I{} mv {} {}4
|
|
|
|
$ find ../master/.hg/cache/trees/v2/nodeinfo -type f | wc -l
|
2018-02-08 04:17:28 +03:00
|
|
|
\s*16 (re)
|
2019-02-07 15:54:57 +03:00
|
|
|
#endif
|
2018-01-25 20:34:18 +03:00
|
|
|
$ clearcache
|
|
|
|
$ hg status --change tip
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' 5fbe397e5ac6cb7ee263c5c67613c4665306d143
|
2018-01-25 20:34:18 +03:00
|
|
|
2 trees fetched over * (glob)
|
2019-10-29 05:18:47 +03:00
|
|
|
fetching tree '' fc64d44480b1e632a2561bf8a8500b004eaa8d9a, based on 5fbe397e5ac6cb7ee263c5c67613c4665306d143, found via 4d563be8759a
|
2018-01-25 20:34:18 +03:00
|
|
|
2 trees fetched over * (glob)
|
|
|
|
A subdir2/z
|
2019-02-07 15:54:57 +03:00
|
|
|
simplecachestore doesn't have eviction policy
|
|
|
|
#if simplecachestore
|
|
|
|
$ find ../master/.hg/hgsimplecache/trees/v2/nodeinfo -type f | wc -l
|
|
|
|
\s*20 (re)
|
|
|
|
#else
|
2018-05-21 19:00:38 +03:00
|
|
|
$ find ../master/.hg/cache/trees/v2/nodeinfo -type f | wc -l
|
2018-02-08 04:17:28 +03:00
|
|
|
\s*8 (re)
|
2019-02-07 15:54:57 +03:00
|
|
|
#endif
|
2018-07-31 20:05:46 +03:00
|
|
|
|
|
|
|
Try pulling while treemanifest.blocksendflat is True
|
|
|
|
$ cat >> ../master/.hg/hgrc <<EOF
|
|
|
|
> [treemanifest]
|
|
|
|
> blocksendflat=True
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
- Pull to a treeonly repo
|
|
|
|
$ hg config treemanifest.treeonly
|
|
|
|
True
|
2019-10-29 05:18:47 +03:00
|
|
|
$ hg debugstrip -qr 4d563be8759a
|
2018-07-31 20:05:46 +03:00
|
|
|
$ hg pull
|
|
|
|
pulling from ssh://user@dummy/master
|
|
|
|
searching for changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 0 changes to 0 files
|
2019-10-29 05:18:47 +03:00
|
|
|
$ hg status --change 4d563be8759a
|
2018-07-31 20:05:46 +03:00
|
|
|
A subdir2/z
|
|
|
|
|
2018-10-09 17:53:17 +03:00
|
|
|
Attempt to push from a treeonly repo without sending trees
|
|
|
|
$ cd ../client2
|
|
|
|
$ hg up tip
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2020-01-09 18:44:55 +03:00
|
|
|
2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob) (?)
|
2018-10-09 17:53:17 +03:00
|
|
|
$ echo >> subdir2/z
|
|
|
|
$ hg commit -qm "Edit subdir2/z"
|
|
|
|
$ hg push --config treemanifest.sendtrees=False
|
|
|
|
pushing to ssh://user@dummy/master
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
2019-10-29 05:18:47 +03:00
|
|
|
remote: error: pretxnclose.checkmanifest hook failed: attempting to close transaction which includes commits (aa3c39e8a706a32cc5b0863f552985b682e1f55c) without manifests (18a44c7eeff67b47a4f985c5b318891544bad78f)
|
2018-10-09 17:53:19 +03:00
|
|
|
remote: transaction abort!
|
|
|
|
remote: rollback completed
|
2019-10-29 05:18:47 +03:00
|
|
|
remote: attempting to close transaction which includes commits (aa3c39e8a706a32cc5b0863f552985b682e1f55c) without manifests (18a44c7eeff67b47a4f985c5b318891544bad78f)
|
2018-10-09 17:53:19 +03:00
|
|
|
abort: push failed on remote
|
|
|
|
[255]
|
2018-10-09 17:53:17 +03:00
|
|
|
|
2018-10-09 17:53:19 +03:00
|
|
|
$ hg -R ../master export tip > /dev/null
|
2018-10-09 17:53:22 +03:00
|
|
|
|
|
|
|
Stripping in a treeonly server
|
|
|
|
$ cat >> ../master/.hg/hgrc <<EOF
|
|
|
|
> [treemanifest]
|
|
|
|
> treeonly=True
|
|
|
|
> EOF
|
|
|
|
$ hg push --to master
|
|
|
|
pushing to ssh://user@dummy/master
|
|
|
|
searching for changes
|
|
|
|
remote: pushing 1 changeset:
|
2019-10-29 05:18:47 +03:00
|
|
|
remote: aa3c39e8a706 Edit subdir2/z
|
2018-10-09 17:53:22 +03:00
|
|
|
|
|
|
|
$ cd ../master
|
|
|
|
$ ls -l .hg/store/meta/subdir2/00manifest.i
|
|
|
|
* 216 * .hg/store/meta/subdir2/00manifest.i (glob)
|
|
|
|
$ ls -l .hg/store/00manifesttree.i
|
|
|
|
* 366 * .hg/store/00manifesttree.i (glob)
|
2019-02-25 14:50:46 +03:00
|
|
|
$ hg debugstrip -r tip --config treemanifest.blocksendflat=False
|
2019-10-29 05:18:47 +03:00
|
|
|
saved backup bundle to $TESTTMP/master/.hg/strip-backup/aa3c39e8a706-26b0df45-backup.hg
|
2018-10-09 17:53:22 +03:00
|
|
|
$ ls -l .hg/store/meta/subdir2/00manifest.i
|
2018-10-09 17:53:24 +03:00
|
|
|
* 108 * .hg/store/meta/subdir2/00manifest.i (glob)
|
2018-10-09 17:53:22 +03:00
|
|
|
$ ls -l .hg/store/00manifesttree.i
|
2018-10-09 17:53:24 +03:00
|
|
|
* 240 * .hg/store/00manifesttree.i (glob)
|