mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
8da9d7b37f
Summary: This adds a remote tree datastore to the store, so if we don't have a tree on local disk, we can reach out to the server for it. This also makes a small change to fastmanifest to use get() instead of getmissing() to test if the tree is available. getmissing() would indicate the tree is missing if it wasn't local, while get() will attempt to fetch it from the server. Test Plan: Added a test Reviewers: #mercurial, quark Reviewed By: quark Subscribers: quark, stash, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4864645 Signature: t1:4864645:1492627823:7afff5db54c895507507e57ab7263f4dbf10b5f7
66 lines
1.4 KiB
Raku
66 lines
1.4 KiB
Raku
$ . "$TESTDIR/library.sh"
|
|
|
|
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
|
|
$ export PYTHONPATH
|
|
|
|
$ hginit master
|
|
$ cd master
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [extensions]
|
|
> treemanifest=
|
|
> [treemanifest]
|
|
> server=True
|
|
> [remotefilelog]
|
|
> server=True
|
|
> EOF
|
|
$ echo x > x
|
|
$ hg commit -qAm 'add x'
|
|
$ cd ..
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master client -q
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
|
|
$ cd client
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [extensions]
|
|
> fastmanifest=
|
|
> treemanifest=
|
|
>
|
|
> [remotefilelog]
|
|
> usefastdatapack=True
|
|
>
|
|
> [treemanifest]
|
|
> autocreatetrees=True
|
|
>
|
|
> [fastmanifest]
|
|
> usetree=True
|
|
> usecache=False
|
|
> EOF
|
|
|
|
Test auto creating trees for merge commit
|
|
$ cd ../master
|
|
$ hg up -q null
|
|
$ echo z >> z
|
|
$ hg commit -qAm 'add z'
|
|
$ hg up -q 0
|
|
$ hg merge -q -r 1
|
|
$ hg commit -qAm 'merge'
|
|
|
|
$ cd ../client
|
|
$ hg pull
|
|
pulling from ssh://user@dummy/master
|
|
searching for changes
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 2 changesets with 0 changes to 0 files
|
|
(run 'hg update' to get a working copy)
|
|
$ hg manifest -r tip
|
|
x
|
|
z
|
|
$ hg debughistorypack $TESTTMP/hgcache/master/packs/manifests/5efcf6ea7ccfd8b6ac303c0f6b5a9cd73682e295
|
|
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
|
13532a598745 bc0c2c938b92 000000000000 92f4ca0e667c
|
|
ddb35f099a64 000000000000 000000000000 d32fd17cb041
|