2018-02-14 17:34:10 +03:00
|
|
|
$ . $TESTDIR/library.sh
|
|
|
|
|
|
|
|
setup configuration
|
|
|
|
$ setup_common_config
|
|
|
|
$ cd $TESTTMP
|
|
|
|
|
|
|
|
setup repo
|
|
|
|
|
|
|
|
$ hg init repo-hg
|
|
|
|
|
|
|
|
setup hg server repo
|
|
|
|
$ cd repo-hg
|
|
|
|
$ setup_hg_server
|
|
|
|
$ cd $TESTTMP
|
|
|
|
|
|
|
|
setup client repo2
|
2018-02-16 13:35:20 +03:00
|
|
|
$ hgclone_treemanifest ssh://user@dummy/repo-hg repo2 --noupdate -q
|
2018-02-14 17:34:10 +03:00
|
|
|
$ cd repo2
|
|
|
|
$ setup_hg_client
|
|
|
|
|
|
|
|
make a few commits on the server
|
|
|
|
$ cd $TESTTMP/repo-hg
|
|
|
|
$ hg debugdrawdag <<EOF
|
|
|
|
> C
|
|
|
|
> |
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOF
|
|
|
|
|
2018-04-25 14:14:04 +03:00
|
|
|
create master bookmark
|
|
|
|
|
|
|
|
$ hg bookmark master_bookmark -r tip
|
|
|
|
|
2018-02-14 17:34:10 +03:00
|
|
|
blobimport them into Mononoke storage and start Mononoke
|
|
|
|
$ cd ..
|
2018-06-13 01:28:33 +03:00
|
|
|
$ blobimport repo-hg/.hg repo
|
2018-02-14 17:34:10 +03:00
|
|
|
|
|
|
|
start mononoke
|
|
|
|
|
2018-03-22 22:20:53 +03:00
|
|
|
$ mononoke
|
2018-02-14 17:34:10 +03:00
|
|
|
$ wait_for_mononoke $TESTTMP/repo
|
|
|
|
|
|
|
|
Pull from Mononoke
|
|
|
|
$ cd repo2
|
|
|
|
$ hgmn pull -q
|
|
|
|
|
|
|
|
Make sure that cache is empty
|
|
|
|
$ [[ -a $TESTTMP/cachepath/repo/packs/manifests ]]
|
|
|
|
[1]
|
|
|
|
|
2018-06-04 20:20:42 +03:00
|
|
|
$ hgmn prefetch -r 0 -r1
|
|
|
|
$ hgmn prefetch -r 2
|
|
|
|
$ cat $TESTTMP/mononoke.out | grep 'Got request: Gettreepack'
|
|
|
|
* Got request: Gettreepack(GettreepackArgs { rootdir: b"", mfnodes: [HgNodeHash(Sha1(41b34f08c1356f6ad068e9ab9b43d984245111aa)), HgNodeHash(Sha1(eb79886383871977bccdb3000c275a279f0d4c99))], basemfnodes: [], directories: [] }), repo: $TESTTMP/repo (glob)
|
|
|
|
* Got request: Gettreepack(GettreepackArgs { rootdir: b"", mfnodes: [HgNodeHash(Sha1(7c9b4fd8b49377e2fead2e9610bb8db910a98c53))], basemfnodes: [HgNodeHash(Sha1(eb79886383871977bccdb3000c275a279f0d4c99))], directories: [] }), repo: $TESTTMP/repo (glob)
|
2018-02-14 17:34:10 +03:00
|
|
|
|
|
|
|
Make sure that new entries were downloaded
|
|
|
|
$ [[ -a $TESTTMP/cachepath/repo/packs/manifests ]]
|
2018-03-14 13:16:07 +03:00
|
|
|
$ ls $TESTTMP/cachepath/repo/packs/manifests | wc -l
|
|
|
|
8
|
|
|
|
|
2018-06-04 20:20:42 +03:00
|
|
|
Update to the revisions. Change the path to make sure that gettreepack command is
|
|
|
|
not sent because we've already downloaded all the trees
|
|
|
|
$ hgmn up 2 --config paths.default=ssh://brokenpath -q
|
2018-03-14 13:16:07 +03:00
|
|
|
$ ls
|
|
|
|
A
|
|
|
|
B
|
|
|
|
C
|
|
|
|
|
2018-06-04 20:20:42 +03:00
|
|
|
Change the path to make sure that no wireproto commands should be sent at all,
|
|
|
|
because everything has been already downloaded.
|
|
|
|
$ hgmn up 1 --config paths.default=ssh://brokenpath -q
|
2018-03-14 13:16:07 +03:00
|
|
|
$ ls
|
|
|
|
A
|
|
|
|
B
|