Mercurial > hg
comparison tests/test-remotefilelog-clone-tree.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 | fc2766860796 |
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 $ echo treemanifest >> .hg/requires | |
9 $ cat >> .hg/hgrc <<EOF | |
10 > [remotefilelog] | |
11 > server=True | |
12 > EOF | |
13 # uppercase directory name to test encoding | |
14 $ mkdir -p A/B | |
15 $ echo x > A/B/x | |
16 $ hg commit -qAm x | |
17 | |
18 $ cd .. | |
19 | |
20 # shallow clone from full | |
21 | |
22 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate | |
23 streaming all changes | |
24 4 files to transfer, 449 bytes of data | |
25 transferred 449 bytes in * seconds (*/sec) (glob) | |
26 searching for changes | |
27 no changes found | |
28 $ cd shallow | |
29 $ cat .hg/requires | |
30 dotencode | |
31 fncache | |
32 generaldelta | |
33 remotefilelog | |
34 revlogv1 | |
35 store | |
36 treemanifest | |
37 $ find .hg/store/meta | sort | |
38 .hg/store/meta | |
39 .hg/store/meta/_a | |
40 .hg/store/meta/_a/00manifest.i | |
41 .hg/store/meta/_a/_b | |
42 .hg/store/meta/_a/_b/00manifest.i | |
43 | |
44 $ hg update | |
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
46 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) | |
47 | |
48 $ cat A/B/x | |
49 x | |
50 | |
51 $ ls .hg/store/data | |
52 $ echo foo > A/B/F | |
53 $ hg add A/B/F | |
54 $ hg ci -m 'local content' | |
55 $ ls .hg/store/data | |
56 ca31988f085bfb945cb8115b78fabdee40f741aa | |
57 | |
58 $ cd .. | |
59 | |
60 # shallow clone from shallow | |
61 | |
62 $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate | |
63 streaming all changes | |
64 5 files to transfer, 1008 bytes of data | |
65 transferred 1008 bytes in * seconds (*/sec) (glob) | |
66 searching for changes | |
67 no changes found | |
68 $ cd shallow2 | |
69 $ cat .hg/requires | |
70 dotencode | |
71 fncache | |
72 generaldelta | |
73 remotefilelog | |
74 revlogv1 | |
75 store | |
76 treemanifest | |
77 $ ls .hg/store/data | |
78 ca31988f085bfb945cb8115b78fabdee40f741aa | |
79 | |
80 $ hg update | |
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
82 | |
83 $ cat A/B/x | |
84 x | |
85 | |
86 $ cd .. | |
87 | |
88 # full clone from shallow | |
89 # - send stderr to /dev/null because the order of stdout/err causes | |
90 # flakiness here | |
91 $ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null | |
92 streaming all changes | |
93 remote: abort: Cannot clone from a shallow repo to a full repo. | |
94 [255] | |
95 | |
96 # getbundle full clone | |
97 | |
98 $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc | |
99 $ hgcloneshallow ssh://user@dummy/master shallow3 | |
100 requesting all changes | |
101 adding changesets | |
102 adding manifests | |
103 adding file changes | |
104 added 1 changesets with 0 changes to 0 files | |
105 new changesets 18d955ee7ba0 | |
106 updating to branch default | |
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
108 | |
109 $ ls shallow3/.hg/store/data | |
110 $ cat shallow3/.hg/requires | |
111 dotencode | |
112 fncache | |
113 generaldelta | |
114 remotefilelog | |
115 revlogv1 | |
116 store | |
117 treemanifest |