sapling/tests/test-treemanifest-peertopeer.t
Durham Goode 3ca5e9b375 treemanifest: put bundle sending behind a config flag
The bundle2 part was always being generated, even for non-treemanifest repos
(because fastmanifest imports the treemanifest module, so the b2partsgenerator
gets registered). This cause pushes to break in any repo with fastmanifest
enabled.
2017-04-30 22:05:09 -07:00

77 lines
1.9 KiB
Raku

$ CACHEDIR=`pwd`/hgcache
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
$ export PYTHONPATH
$ . "$TESTDIR/library.sh"
$ hg init client1
$ cd client1
$ cat >> .hg/hgrc <<EOF
> [extensions]
> fastmanifest=
> treemanifest=
>
> [remotefilelog]
> reponame=master
> cachepath=$CACHEDIR
> usefastdatapack=True
>
> [fastmanifest]
> usetree=True
> usecache=False
> EOF
$ echo a > a
$ mkdir dir
$ echo b > dir/b
$ hg commit -Aqm 'initial commit'
$ hg init ../client2
$ cat >> ../client2/.hg/hgrc <<EOF
> [extensions]
> fastmanifest=
> treemanifest=
>
> [remotefilelog]
> reponame=master
> cachepath=$CACHEDIR
> usefastdatapack=True
>
> [fastmanifest]
> usetree=True
> usecache=False
> EOF
$ ls .hg/store/packs/manifests
36c63010eaf0a52d3536ced5e32bf4c6847a0e40.histidx
36c63010eaf0a52d3536ced5e32bf4c6847a0e40.histpack
fb1ee78215bfece34ca8e233fcf5e9fd69ec52bd.dataidx
fb1ee78215bfece34ca8e233fcf5e9fd69ec52bd.datapack
Pushing with treemanifest disabled does nothing
(disable demand import so treemanifest.py is forced to load)
$ HGDEMANDIMPORT=disable hg push -q ../client2 --config extensions.treemanifest=! --config fastmanifest.usetree=False
$ ls ../client2/.hg/store/packs/manifests || true
* No such file or directory (glob)
$ hg -R ../client2 strip -q -r tip
Pushing p2p with sendtrees=False does nothing
$ hg push -q ../client2
$ ls ../client2/.hg/store/packs/manifests || true
* No such file or directory (glob)
$ hg -R ../client2 strip -q -r tip
Pushing p2p puts the received packs in the local pack store
$ cat >> .hg/hgrc <<EOF
> [treemanifest]
> sendtrees=True
> EOF
$ hg push -q ../client2
$ ls ../client2/.hg/store/packs/manifests
36c63010eaf0a52d3536ced5e32bf4c6847a0e40.histidx
36c63010eaf0a52d3536ced5e32bf4c6847a0e40.histpack
fb1ee78215bfece34ca8e233fcf5e9fd69ec52bd.dataidx
fb1ee78215bfece34ca8e233fcf5e9fd69ec52bd.datapack