Show More
@@ -1,210 +1,225 b'' | |||
|
1 | #testcases lfs-on lfs-off | |
|
2 | ||
|
3 | #if lfs-on | |
|
4 | $ cat >> $HGRCPATH <<EOF | |
|
5 | > [extensions] | |
|
6 | > lfs = | |
|
7 | > EOF | |
|
8 | #endif | |
|
1 | 9 | |
|
2 | 10 | $ . "$TESTDIR/narrow-library.sh" |
|
3 | 11 | |
|
4 | 12 | create full repo |
|
5 | 13 | |
|
6 | 14 | $ hg init master |
|
7 | 15 | $ cd master |
|
8 | 16 | $ cat >> .hg/hgrc <<EOF |
|
9 | 17 | > [narrow] |
|
10 | 18 | > serveellipses=True |
|
11 | 19 | > EOF |
|
12 | 20 | |
|
13 | 21 | $ mkdir inside |
|
14 | 22 | $ echo 1 > inside/f |
|
15 | 23 | $ mkdir inside2 |
|
16 | 24 | $ echo 1 > inside2/f |
|
17 | 25 | $ mkdir outside |
|
18 | 26 | $ echo 1 > outside/f |
|
19 | 27 | $ hg ci -Aqm 'initial' |
|
20 | 28 | |
|
21 | 29 | $ echo 2 > inside/f |
|
22 | 30 | $ hg ci -qm 'inside 2' |
|
23 | 31 | |
|
24 | 32 | $ echo 2 > inside2/f |
|
25 | 33 | $ hg ci -qm 'inside2 2' |
|
26 | 34 | |
|
27 | 35 | $ echo 2 > outside/f |
|
28 | 36 | $ hg ci -qm 'outside 2' |
|
29 | 37 | |
|
30 | 38 | $ cd .. |
|
31 | 39 | |
|
32 | 40 | $ hg clone --narrow ssh://user@dummy/master narrow --include inside |
|
33 | 41 | requesting all changes |
|
34 | 42 | adding changesets |
|
35 | 43 | adding manifests |
|
36 | 44 | adding file changes |
|
37 | 45 | added 3 changesets with 2 changes to 1 files |
|
38 | 46 | new changesets *:* (glob) |
|
39 | 47 | updating to branch default |
|
40 | 48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 49 | |
|
42 | 50 | $ hg clone --narrow ssh://user@dummy/master narrow2 --include inside --include inside2 |
|
43 | 51 | requesting all changes |
|
44 | 52 | adding changesets |
|
45 | 53 | adding manifests |
|
46 | 54 | adding file changes |
|
47 | 55 | added 4 changesets with 4 changes to 2 files |
|
48 | 56 | new changesets *:* (glob) |
|
49 | 57 | updating to branch default |
|
50 | 58 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
51 | 59 | |
|
52 | 60 | Can push to wider repo if change does not affect paths in wider repo that are |
|
53 | 61 | not also in narrower repo |
|
54 | 62 | |
|
55 | 63 | $ cd narrow |
|
56 | 64 | $ echo 3 > inside/f |
|
57 | 65 | $ hg ci -m 'inside 3' |
|
58 | 66 | $ hg push ssh://user@dummy/narrow2 |
|
59 | 67 | pushing to ssh://user@dummy/narrow2 |
|
60 | 68 | searching for changes |
|
61 | 69 | remote: adding changesets |
|
62 | 70 | remote: adding manifests |
|
63 | 71 | remote: adding file changes |
|
64 | 72 | remote: added 1 changesets with 1 changes to 1 files |
|
65 | 73 | |
|
66 | 74 | Can push to narrower repo if change affects only paths within remote's |
|
67 | 75 | narrow spec |
|
68 | 76 | |
|
69 | 77 | $ cd ../narrow2 |
|
70 | 78 | $ cat >> .hg/hgrc <<EOF |
|
71 | 79 | > [narrow] |
|
72 | 80 | > serveellipses=True |
|
73 | 81 | > EOF |
|
74 | 82 | $ hg co -r 'desc("inside 3")' |
|
75 | 83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
76 | 84 | $ echo 4 > inside/f |
|
77 | 85 | $ hg ci -m 'inside 4' |
|
78 | 86 | $ hg push ssh://user@dummy/narrow |
|
79 | 87 | pushing to ssh://user@dummy/narrow |
|
80 | 88 | searching for changes |
|
81 | 89 | remote: adding changesets |
|
82 | 90 | remote: adding manifests |
|
83 | 91 | remote: adding file changes |
|
84 | 92 | remote: added 1 changesets with 1 changes to 1 files |
|
85 | 93 | |
|
86 | 94 | Can push to narrow repo if change affects only paths outside remote's |
|
87 | 95 | narrow spec |
|
88 | 96 | |
|
89 | 97 | $ echo 3 > inside2/f |
|
90 | 98 | $ hg ci -m 'inside2 3' |
|
91 | 99 | TODO: this should be successful |
|
92 | 100 | $ hg push ssh://user@dummy/narrow |
|
93 | 101 | pushing to ssh://user@dummy/narrow |
|
94 | 102 | searching for changes |
|
95 | 103 | remote: adding changesets |
|
96 | 104 | remote: adding manifests |
|
97 | 105 | remote: adding file changes |
|
98 | 106 | remote: transaction abort! |
|
99 | 107 | remote: rollback completed |
|
100 | 108 | remote: abort: data/inside2/f.i@4a1aa07735e6: unknown parent! (reporevlogstore !) |
|
101 | 109 | remote: abort: data/inside2/f/index@4a1aa07735e6: no node! (reposimplestore !) |
|
102 | 110 | abort: stream ended unexpectedly (got 0 bytes, expected 4) |
|
103 | 111 | [255] |
|
104 | 112 | |
|
105 | 113 | Can pull from wider repo if change affects only paths outside remote's |
|
106 | 114 | narrow spec |
|
107 | 115 | $ echo 4 > inside2/f |
|
108 | 116 | $ hg ci -m 'inside2 4' |
|
109 | 117 | $ hg log -G -T '{rev} {node|short} {files}\n' |
|
110 | 118 | @ 7 d78a96df731d inside2/f |
|
111 | 119 | | |
|
112 | 120 | o 6 8c26f5218962 inside2/f |
|
113 | 121 | | |
|
114 | 122 | o 5 ba3480e2f9de inside/f |
|
115 | 123 | | |
|
116 | 124 | o 4 4e5edd526618 inside/f |
|
117 | 125 | | |
|
118 | 126 | o 3 81e7e07b7ab0 outside/f |
|
119 | 127 | | |
|
120 | 128 | o 2 f3993b8c0c2b inside2/f |
|
121 | 129 | | |
|
122 | 130 | o 1 8cd66ca966b4 inside/f |
|
123 | 131 | | |
|
124 | 132 | o 0 c8057d6f53ab inside/f inside2/f outside/f |
|
125 | 133 | |
|
126 | 134 | $ cd ../narrow |
|
127 | 135 | $ hg log -G -T '{rev} {node|short} {files}\n' |
|
128 | 136 | o 4 ba3480e2f9de inside/f |
|
129 | 137 | | |
|
130 | 138 | @ 3 4e5edd526618 inside/f |
|
131 | 139 | | |
|
132 | 140 | o 2 81e7e07b7ab0 outside/f |
|
133 | 141 | | |
|
134 | 142 | o 1 8cd66ca966b4 inside/f |
|
135 | 143 | | |
|
136 | 144 | o 0 c8057d6f53ab inside/f inside2/f outside/f |
|
137 | 145 | |
|
138 | 146 | $ hg pull ssh://user@dummy/narrow2 |
|
139 | 147 | pulling from ssh://user@dummy/narrow2 |
|
140 | 148 | searching for changes |
|
141 | 149 | adding changesets |
|
142 | 150 | adding manifests |
|
143 | 151 | adding file changes |
|
144 | 152 | added 1 changesets with 0 changes to 0 files |
|
145 | 153 | new changesets d78a96df731d |
|
146 | 154 | (run 'hg update' to get a working copy) |
|
147 | 155 | |
|
148 | 156 | Check that the resulting history is valid in the full repo |
|
149 | 157 | |
|
150 | 158 | $ cd ../narrow2 |
|
151 | 159 | $ hg push ssh://user@dummy/master |
|
152 | 160 | pushing to ssh://user@dummy/master |
|
153 | 161 | searching for changes |
|
154 | 162 | remote: adding changesets |
|
155 | 163 | remote: adding manifests |
|
156 | 164 | remote: adding file changes |
|
157 | 165 | remote: added 4 changesets with 4 changes to 2 files |
|
158 | 166 | $ cd ../master |
|
159 | 167 | $ hg verify |
|
160 | 168 | checking changesets |
|
161 | 169 | checking manifests |
|
162 | 170 | crosschecking files in changesets and manifests |
|
163 | 171 | checking files |
|
164 | 172 | checked 8 changesets with 10 changes to 3 files |
|
165 | 173 | |
|
166 | 174 | Can not push to wider repo if change affects paths in wider repo that are |
|
167 | 175 | not also in narrower repo |
|
168 | 176 | $ cd ../master |
|
169 | 177 | $ hg co -r 'desc("inside2 4")' |
|
170 | 178 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
171 | 179 | $ echo 5 > inside2/f |
|
172 | 180 | $ hg ci -m 'inside2 5' |
|
173 | 181 | $ hg log -G -T '{rev} {node|short} {files}\n' |
|
174 | 182 | @ 8 5970befb64ba inside2/f |
|
175 | 183 | | |
|
176 | 184 | o 7 d78a96df731d inside2/f |
|
177 | 185 | | |
|
178 | 186 | o 6 8c26f5218962 inside2/f |
|
179 | 187 | | |
|
180 | 188 | o 5 ba3480e2f9de inside/f |
|
181 | 189 | | |
|
182 | 190 | o 4 4e5edd526618 inside/f |
|
183 | 191 | | |
|
184 | 192 | o 3 81e7e07b7ab0 outside/f |
|
185 | 193 | | |
|
186 | 194 | o 2 f3993b8c0c2b inside2/f |
|
187 | 195 | | |
|
188 | 196 | o 1 8cd66ca966b4 inside/f |
|
189 | 197 | | |
|
190 | 198 | o 0 c8057d6f53ab inside/f inside2/f outside/f |
|
191 | 199 | |
|
192 | 200 | $ cd ../narrow |
|
193 | 201 | $ hg pull |
|
194 | 202 | pulling from ssh://user@dummy/master |
|
195 | 203 | searching for changes |
|
196 | 204 | adding changesets |
|
197 | 205 | adding manifests |
|
198 | 206 | adding file changes |
|
199 | 207 | added 1 changesets with 0 changes to 0 files |
|
200 | 208 | new changesets * (glob) |
|
201 | 209 | (run 'hg update' to get a working copy) |
|
202 | 210 | TODO: this should tell the user that their narrow clone does not have the |
|
203 | 211 | necessary content to be able to push to the target |
|
204 | $ hg push ssh://user@dummy/narrow2 | |
|
212 | ||
|
213 | TODO: lfs shouldn't abort like this | |
|
214 | $ hg push ssh://user@dummy/narrow2 || true | |
|
205 | 215 | pushing to ssh://user@dummy/narrow2 |
|
206 | 216 | searching for changes |
|
207 | 217 | remote: adding changesets |
|
208 | 218 | remote: adding manifests |
|
209 | 219 | remote: adding file changes |
|
210 | 220 | remote: added 1 changesets with 0 changes to 0 files |
|
221 | remote: error: pretxnchangegroup.lfs hook raised an exception: data/inside2/f.i@f59b4e021835: no match found (lfs-on !) | |
|
222 | remote: transaction abort! (lfs-on !) | |
|
223 | remote: rollback completed (lfs-on !) | |
|
224 | remote: abort: data/inside2/f.i@f59b4e021835: no match found! (lfs-on !) | |
|
225 | abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !) |
General Comments 0
You need to be logged in to leave comments.
Login now