|
1 #require no-windows |
|
2 |
|
3 $ . "$TESTDIR/remotefilelog-library.sh" |
|
4 |
|
5 $ hg init master |
|
6 $ cd master |
|
7 $ cat >> .hg/hgrc <<EOF |
|
8 > [remotefilelog] |
|
9 > server=True |
|
10 > EOF |
|
11 $ echo x > x |
|
12 $ hg commit -qAm x |
|
13 |
|
14 $ cd .. |
|
15 |
|
16 # shallow clone from full |
|
17 |
|
18 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate |
|
19 streaming all changes |
|
20 2 files to transfer, 227 bytes of data |
|
21 transferred 227 bytes in * seconds (*/sec) (glob) |
|
22 searching for changes |
|
23 no changes found |
|
24 $ cd shallow |
|
25 $ cat .hg/requires |
|
26 dotencode |
|
27 exp-remotefilelog-repo-req-1 |
|
28 fncache |
|
29 generaldelta |
|
30 revlogv1 |
|
31 sparserevlog |
|
32 store |
|
33 |
|
34 $ hg update |
|
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
36 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) |
|
37 |
|
38 $ cat x |
|
39 x |
|
40 |
|
41 $ ls .hg/store/data |
|
42 $ echo foo > f |
|
43 $ hg add f |
|
44 $ hg ci -m 'local content' |
|
45 $ ls .hg/store/data |
|
46 4a0a19218e082a343a1b17e5333409af9d98f0f5 |
|
47 |
|
48 $ cd .. |
|
49 |
|
50 # shallow clone from shallow |
|
51 |
|
52 $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate |
|
53 streaming all changes |
|
54 3 files to transfer, 564 bytes of data |
|
55 transferred 564 bytes in * seconds (*/sec) (glob) |
|
56 searching for changes |
|
57 no changes found |
|
58 $ cd shallow2 |
|
59 $ cat .hg/requires |
|
60 dotencode |
|
61 exp-remotefilelog-repo-req-1 |
|
62 fncache |
|
63 generaldelta |
|
64 revlogv1 |
|
65 sparserevlog |
|
66 store |
|
67 $ ls .hg/store/data |
|
68 4a0a19218e082a343a1b17e5333409af9d98f0f5 |
|
69 |
|
70 $ hg update |
|
71 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
72 |
|
73 $ cat x |
|
74 x |
|
75 |
|
76 $ cd .. |
|
77 |
|
78 # full clone from shallow |
|
79 |
|
80 Note: the output to STDERR comes from a different process to the output on |
|
81 STDOUT and their relative ordering is not deterministic. As a result, the test |
|
82 was failing sporadically. To avoid this, we capture STDERR to a file and |
|
83 check its contents separately. |
|
84 |
|
85 $ TEMP_STDERR=full-clone-from-shallow.stderr.tmp |
|
86 $ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR |
|
87 streaming all changes |
|
88 remote: abort: Cannot clone from a shallow repo to a full repo. |
|
89 [255] |
|
90 $ cat $TEMP_STDERR |
|
91 abort: pull failed on remote |
|
92 $ rm $TEMP_STDERR |
|
93 |
|
94 # getbundle full clone |
|
95 |
|
96 $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc |
|
97 $ hgcloneshallow ssh://user@dummy/master shallow3 |
|
98 requesting all changes |
|
99 adding changesets |
|
100 adding manifests |
|
101 adding file changes |
|
102 added 1 changesets with 0 changes to 0 files |
|
103 new changesets b292c1e3311f |
|
104 updating to branch default |
|
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
106 |
|
107 $ ls shallow3/.hg/store/data |
|
108 $ cat shallow3/.hg/requires |
|
109 dotencode |
|
110 exp-remotefilelog-repo-req-1 |
|
111 fncache |
|
112 generaldelta |
|
113 revlogv1 |
|
114 sparserevlog |
|
115 store |