sapling/tests/test-treemanifest-peertopeer.t
Jun Wu 3d461ae600 check-ext: make checks stricter
Summary:
Enhance check-ext script to be more strict:

 - Only one foreign extension is allowed: `remotenames`
 - Require explicit path for in-repo extensions to avoid wrong extensions
   being tested

This would make the test more predicatable since system extensions
will be less likely to be imported. Explicit path is better than
setting `PYTHONPATH` since `hgext/name.py` could override
`hgext3rd/name.py` regardless of `PYTHONPATH`.

Test Plan: arc unit

Reviewers: phillco, durham, ikostia, #mercurial, stash

Reviewed By: stash

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5271430

Signature: t1:5271430:1497861776:7dd35ec7c522cd9b26aa0871cb4306b4f1b8993a
2017-06-19 08:02:38 -07:00

77 lines
2.0 KiB
Perl

$ CACHEDIR=`pwd`/hgcache
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
$ export PYTHONPATH
$ . "$TESTDIR/library.sh"
$ hg init client1
$ cd client1
$ cat >> .hg/hgrc <<EOF
> [extensions]
> fastmanifest=$TESTDIR/../fastmanifest
> treemanifest=$TESTDIR/../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=$TESTDIR/../fastmanifest
> treemanifest=$TESTDIR/../treemanifest
>
> [remotefilelog]
> reponame=master
> cachepath=$CACHEDIR
> usefastdatapack=True
>
> [fastmanifest]
> usetree=True
> usecache=False
> EOF
$ ls .hg/store/packs/manifests
15f45e8ca8affec27464278498594f94a3624815.histidx
15f45e8ca8affec27464278498594f94a3624815.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
15f45e8ca8affec27464278498594f94a3624815.histidx
15f45e8ca8affec27464278498594f94a3624815.histpack
fb1ee78215bfece34ca8e233fcf5e9fd69ec52bd.dataidx
fb1ee78215bfece34ca8e233fcf5e9fd69ec52bd.datapack