2017-04-27 20:44:34 +03:00
|
|
|
$ CACHEDIR=`pwd`/hgcache
|
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
$ . "$TESTDIR/library.sh"
|
|
|
|
|
|
|
|
Create server
|
|
|
|
$ hginit master
|
|
|
|
$ cd master
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> treemanifest=
|
2017-11-03 19:24:39 +03:00
|
|
|
> [treemanifest]
|
2018-02-02 21:04:17 +03:00
|
|
|
> server=True
|
|
|
|
> [remotefilelog]
|
|
|
|
> server=True
|
2017-11-03 19:24:39 +03:00
|
|
|
> EOF
|
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
$ mkdir subdir
|
|
|
|
$ echo x > subdir/x
|
|
|
|
$ hg commit -qAm 'add subdir/x'
|
|
|
|
$ cd ..
|
2017-04-27 20:44:34 +03:00
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
Create client2 - it will have only the first commit, so client1 will be pushing
|
|
|
|
two server and one local commits later.
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master client2 -q
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
|
|
|
$ cat >> client2/.hg/hgrc <<EOF
|
2017-04-27 20:44:34 +03:00
|
|
|
> [extensions]
|
2018-01-09 23:59:00 +03:00
|
|
|
> fastmanifest=
|
|
|
|
> treemanifest=
|
2017-04-27 20:44:34 +03:00
|
|
|
>
|
|
|
|
> [remotefilelog]
|
|
|
|
> reponame=master
|
|
|
|
> cachepath=$CACHEDIR
|
|
|
|
> usefastdatapack=True
|
|
|
|
>
|
|
|
|
> [fastmanifest]
|
|
|
|
> usetree=True
|
|
|
|
> usecache=False
|
|
|
|
> EOF
|
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
Create create two more server commits
|
|
|
|
$ cd master
|
|
|
|
$ echo x >> subdir/x
|
|
|
|
$ hg commit -m 'modify subdir/x'
|
|
|
|
$ echo x >> subdir/x
|
|
|
|
$ hg commit -m 'modify subdir/x again'
|
|
|
|
$ cd ..
|
2017-04-27 20:44:34 +03:00
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
Create client1 - it will have both server commits
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master client1 -q
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
|
|
|
$ cd client1
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
2017-04-27 20:44:34 +03:00
|
|
|
> [extensions]
|
2018-01-09 23:59:00 +03:00
|
|
|
> fastmanifest=
|
|
|
|
> treemanifest=
|
2017-04-27 20:44:34 +03:00
|
|
|
>
|
|
|
|
> [remotefilelog]
|
|
|
|
> reponame=master
|
|
|
|
> cachepath=$CACHEDIR
|
|
|
|
> usefastdatapack=True
|
|
|
|
>
|
|
|
|
> [fastmanifest]
|
|
|
|
> usetree=True
|
|
|
|
> usecache=False
|
|
|
|
> EOF
|
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
$ echo a > a
|
|
|
|
$ mkdir dir
|
|
|
|
$ echo b > dir/b
|
|
|
|
$ hg commit -Aqm 'initial commit'
|
|
|
|
2 trees fetched over * (glob)
|
|
|
|
|
2017-04-27 20:44:34 +03:00
|
|
|
$ ls .hg/store/packs/manifests
|
2018-02-02 21:04:17 +03:00
|
|
|
a235931ce2211c58acacdf765f4050d5c92a54e5.dataidx
|
|
|
|
a235931ce2211c58acacdf765f4050d5c92a54e5.datapack
|
|
|
|
fedab9b2d171527f5d1109c27e8ba5dc80b36f6c.histidx
|
|
|
|
fedab9b2d171527f5d1109c27e8ba5dc80b36f6c.histpack
|
2017-04-27 20:44:34 +03:00
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
Pushing with treemanifest disabled does not produce trees
|
2017-05-01 08:05:09 +03:00
|
|
|
(disable demand import so treemanifest.py is forced to load)
|
|
|
|
$ HGDEMANDIMPORT=disable hg push -q ../client2 --config extensions.treemanifest=! --config fastmanifest.usetree=False
|
2018-02-02 21:04:17 +03:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
2017-05-01 08:05:09 +03:00
|
|
|
$ ls ../client2/.hg/store/packs/manifests || true
|
2018-01-09 23:59:00 +03:00
|
|
|
* $ENOENT$ (glob)
|
2017-05-01 08:05:09 +03:00
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
$ hg -R ../client2 strip -q -r 'tip^^' --config extensions.treemanifest=! --config fastmanifest.usetree=False
|
|
|
|
$ rm -rf ../client2/.hg/store/packs
|
|
|
|
$ clearcache
|
2017-05-01 08:05:09 +03:00
|
|
|
|
2018-02-02 21:04:17 +03:00
|
|
|
Pushing with sendtrees=False does nothing and doesnt download any trees to the
|
|
|
|
cache.
|
|
|
|
# Prefetch client2 so we dont see any downloads related to what the target
|
|
|
|
# already has.
|
|
|
|
$ hg -R ../client2 prefetch -r 'all()'
|
|
|
|
2 trees fetched over * (glob)
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
|
|
|
# Push and expect only one bulk download of trees
|
2017-04-27 20:44:34 +03:00
|
|
|
$ hg push -q ../client2
|
2018-02-02 21:04:17 +03:00
|
|
|
4 trees fetched over * (glob)
|
|
|
|
2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
|
|
|
|
$ ls_l $CACHEDIR/master/packs/manifests
|
|
|
|
-r--r--r-- 1186 06f87527833ba45e5e277a5acf0a20d9e6ec2671.dataidx
|
|
|
|
-r--r--r-- 421 06f87527833ba45e5e277a5acf0a20d9e6ec2671.datapack
|
|
|
|
-r--r--r-- 1196 1b69dc04d7f9d9825351f0af940c80f956e372b9.histidx
|
|
|
|
-r--r--r-- 183 1b69dc04d7f9d9825351f0af940c80f956e372b9.histpack
|
|
|
|
-r--r--r-- 1106 4d21ecb6c95e12dcf807b793cd1c55eeed861734.dataidx
|
|
|
|
-r--r--r-- 211 4d21ecb6c95e12dcf807b793cd1c55eeed861734.datapack
|
|
|
|
-r--r--r-- 1252 940bb8bf7ddf4196fff7fd1e837cbed98cb19c19.histidx
|
|
|
|
-r--r--r-- 347 940bb8bf7ddf4196fff7fd1e837cbed98cb19c19.histpack
|
|
|
|
$ hg -R ../client2 strip -q -r 'tip^^' --config extensions.treemanifest=! --config fastmanifest.usetree=False
|
|
|
|
$ rm -rf ../client2/.hg/store/packs
|
|
|
|
$ clearcache
|
|
|
|
|
|
|
|
Pushing p2p with sendtrees=True puts the received packs in the local pack store
|
|
|
|
# Prefetch client2 so we dont see any downloads related to what the target
|
|
|
|
# already has.
|
|
|
|
$ hg -R ../client2 prefetch -r 'all()'
|
|
|
|
2 trees fetched over * (glob)
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
|
|
|
# Push and expect only one bulk download of trees
|
|
|
|
$ hg push -q ../client2 --config treemanifest.sendtrees=True
|
|
|
|
4 trees fetched over * (glob)
|
|
|
|
2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over * (glob)
|
2017-04-27 20:44:34 +03:00
|
|
|
$ ls ../client2/.hg/store/packs/manifests
|
2018-02-02 21:04:17 +03:00
|
|
|
52e40524fd1590fae9864853645b640b33e9cab4.dataidx
|
|
|
|
52e40524fd1590fae9864853645b640b33e9cab4.datapack
|
|
|
|
b838127394a8b2e240f6041002d2d8ba20666e3e.histidx
|
|
|
|
b838127394a8b2e240f6041002d2d8ba20666e3e.histpack
|