Mercurial > hg
comparison tests/test-remotefilelog-partial-shallow.t @ 40495:3a333a582d7b
remotefilelog: import pruned-down remotefilelog extension from hg-experimental
This is remotefilelog as of my recent patches for compatibility with
current tip of hg, minus support for old versions of Mercurial and
some FB-specific features like their treemanifest extension and
fetching linkrev data from a patched phabricator. The file extutil.py
moved from hgext3rd to remotefilelog.
This is not yet ready to be landed, consider it a preview for
now. Planned changes include:
* replace lz4 with zstd
* rename some capabilities, requirements and wireproto commands to mark
them as experimental
* consolidate bits of shallowutil with related functions (eg readfile)
I'm certainly open to other (small) changes, but my rough mission is
to land this largely as-is so we can use it as a model of the
functionality we need going forward for lazy-fetching of file contents
from a server.
# no-check-commit because of a few foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D4782
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 27 Sep 2018 13:03:19 -0400 |
parents | |
children | 95a079ea1e19 |
comparison
equal
deleted
inserted
replaced
40494:9aeb9e2d28a7 | 40495:3a333a582d7b |
---|---|
1 $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH | |
2 $ export PYTHONPATH | |
3 | |
4 $ . "$TESTDIR/remotefilelog-library.sh" | |
5 | |
6 $ hginit master | |
7 $ cd master | |
8 $ cat >> .hg/hgrc <<EOF | |
9 > [remotefilelog] | |
10 > server=True | |
11 > EOF | |
12 $ echo x > foo | |
13 $ echo y > bar | |
14 $ hg commit -qAm one | |
15 | |
16 $ cd .. | |
17 | |
18 # partial shallow clone | |
19 | |
20 $ hg clone --shallow ssh://user@dummy/master shallow --noupdate --config remotefilelog.includepattern=foo | |
21 streaming all changes | |
22 3 files to transfer, 336 bytes of data | |
23 transferred 336 bytes in * seconds (*/sec) (glob) | |
24 searching for changes | |
25 no changes found | |
26 $ cat >> shallow/.hg/hgrc <<EOF | |
27 > [remotefilelog] | |
28 > cachepath=$PWD/hgcache | |
29 > debug=True | |
30 > includepattern=foo | |
31 > reponame = master | |
32 > [extensions] | |
33 > remotefilelog= | |
34 > EOF | |
35 $ ls shallow/.hg/store/data | |
36 bar.i | |
37 | |
38 # update partial clone | |
39 | |
40 $ cd shallow | |
41 $ hg update | |
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
43 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | |
44 $ cat foo | |
45 x | |
46 $ cat bar | |
47 y | |
48 $ cd .. | |
49 | |
50 # pull partial clone | |
51 | |
52 $ cd master | |
53 $ echo a >> foo | |
54 $ echo b >> bar | |
55 $ hg commit -qm two | |
56 $ cd ../shallow | |
57 $ hg pull | |
58 pulling from ssh://user@dummy/master | |
59 searching for changes | |
60 adding changesets | |
61 adding manifests | |
62 adding file changes | |
63 added 1 changesets with 0 changes to 0 files | |
64 new changesets a9688f18cb91 | |
65 (run 'hg update' to get a working copy) | |
66 $ hg update | |
67 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
68 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | |
69 $ cat foo | |
70 x | |
71 a | |
72 $ cat bar | |
73 y | |
74 b | |
75 | |
76 $ cd .. |