Show More
@@ -1,352 +1,348 b'' | |||
|
1 | Make status look into subrepositories by default: | |
|
2 | ||
|
3 | $ echo '[defaults]' >> $HGRCPATH | |
|
4 | ||
|
5 | 1 | Create test repository: |
|
6 | 2 | |
|
7 | 3 | $ hg init repo |
|
8 | 4 | $ cd repo |
|
9 | 5 | $ echo x1 > x.txt |
|
10 | 6 | |
|
11 | 7 | $ hg init foo |
|
12 | 8 | $ cd foo |
|
13 | 9 | $ echo y1 > y.txt |
|
14 | 10 | |
|
15 | 11 | $ hg init bar |
|
16 | 12 | $ cd bar |
|
17 | 13 | $ echo z1 > z.txt |
|
18 | 14 | |
|
19 | 15 | $ cd .. |
|
20 | 16 | $ echo 'bar = bar' > .hgsub |
|
21 | 17 | |
|
22 | 18 | $ cd .. |
|
23 | 19 | $ echo 'foo = foo' > .hgsub |
|
24 | 20 | |
|
25 | 21 | Add files --- .hgsub files must go first to trigger subrepos: |
|
26 | 22 | |
|
27 | 23 | $ hg add -S .hgsub |
|
28 | 24 | $ hg add -S foo/.hgsub |
|
29 | 25 | $ hg add -S foo/bar |
|
30 | 26 | adding foo/bar/z.txt |
|
31 | 27 | $ hg add -S |
|
32 | 28 | adding x.txt |
|
33 | 29 | adding foo/y.txt |
|
34 | 30 | |
|
35 | 31 | Test recursive status without committing anything: |
|
36 | 32 | |
|
37 | 33 | $ hg status -S |
|
38 | 34 | A .hgsub |
|
39 | 35 | A foo/.hgsub |
|
40 | 36 | A foo/bar/z.txt |
|
41 | 37 | A foo/y.txt |
|
42 | 38 | A x.txt |
|
43 | 39 | |
|
44 | 40 | Test recursive diff without committing anything: |
|
45 | 41 | |
|
46 | 42 | $ hg diff --nodates -S foo |
|
47 | 43 | diff -r 000000000000 foo/.hgsub |
|
48 | 44 | --- /dev/null |
|
49 | 45 | +++ b/foo/.hgsub |
|
50 | 46 | @@ -0,0 +1,1 @@ |
|
51 | 47 | +bar = bar |
|
52 | 48 | diff -r 000000000000 foo/y.txt |
|
53 | 49 | --- /dev/null |
|
54 | 50 | +++ b/foo/y.txt |
|
55 | 51 | @@ -0,0 +1,1 @@ |
|
56 | 52 | +y1 |
|
57 | 53 | diff -r 000000000000 foo/bar/z.txt |
|
58 | 54 | --- /dev/null |
|
59 | 55 | +++ b/foo/bar/z.txt |
|
60 | 56 | @@ -0,0 +1,1 @@ |
|
61 | 57 | +z1 |
|
62 | 58 | |
|
63 | 59 | Commits: |
|
64 | 60 | |
|
65 | 61 | $ hg commit -m 0-0-0 |
|
66 | 62 | committing subrepository foo |
|
67 | 63 | committing subrepository foo/bar |
|
68 | 64 | |
|
69 | 65 | $ cd foo |
|
70 | 66 | $ echo y2 >> y.txt |
|
71 | 67 | $ hg commit -m 0-1-0 |
|
72 | 68 | |
|
73 | 69 | $ cd bar |
|
74 | 70 | $ echo z2 >> z.txt |
|
75 | 71 | $ hg commit -m 0-1-1 |
|
76 | 72 | |
|
77 | 73 | $ cd .. |
|
78 | 74 | $ hg commit -m 0-2-1 |
|
79 | 75 | committing subrepository bar |
|
80 | 76 | |
|
81 | 77 | $ cd .. |
|
82 | 78 | $ hg commit -m 1-2-1 |
|
83 | 79 | committing subrepository foo |
|
84 | 80 | |
|
85 | 81 | Change working directory: |
|
86 | 82 | |
|
87 | 83 | $ echo y3 >> foo/y.txt |
|
88 | 84 | $ echo z3 >> foo/bar/z.txt |
|
89 | 85 | $ hg status -S |
|
90 | 86 | M foo/bar/z.txt |
|
91 | 87 | M foo/y.txt |
|
92 | 88 | $ hg diff --nodates -S |
|
93 | 89 | diff -r d254738c5f5e foo/y.txt |
|
94 | 90 | --- a/foo/y.txt |
|
95 | 91 | +++ b/foo/y.txt |
|
96 | 92 | @@ -1,2 +1,3 @@ |
|
97 | 93 | y1 |
|
98 | 94 | y2 |
|
99 | 95 | +y3 |
|
100 | 96 | diff -r 9647f22de499 foo/bar/z.txt |
|
101 | 97 | --- a/foo/bar/z.txt |
|
102 | 98 | +++ b/foo/bar/z.txt |
|
103 | 99 | @@ -1,2 +1,3 @@ |
|
104 | 100 | z1 |
|
105 | 101 | z2 |
|
106 | 102 | +z3 |
|
107 | 103 | |
|
108 | 104 | Status call crossing repository boundaries: |
|
109 | 105 | |
|
110 | 106 | $ hg status -S foo/bar/z.txt |
|
111 | 107 | M foo/bar/z.txt |
|
112 | 108 | $ hg status -S -I 'foo/?.txt' |
|
113 | 109 | M foo/y.txt |
|
114 | 110 | $ hg status -S -I '**/?.txt' |
|
115 | 111 | M foo/bar/z.txt |
|
116 | 112 | M foo/y.txt |
|
117 | 113 | $ hg diff --nodates -S -I '**/?.txt' |
|
118 | 114 | diff -r d254738c5f5e foo/y.txt |
|
119 | 115 | --- a/foo/y.txt |
|
120 | 116 | +++ b/foo/y.txt |
|
121 | 117 | @@ -1,2 +1,3 @@ |
|
122 | 118 | y1 |
|
123 | 119 | y2 |
|
124 | 120 | +y3 |
|
125 | 121 | diff -r 9647f22de499 foo/bar/z.txt |
|
126 | 122 | --- a/foo/bar/z.txt |
|
127 | 123 | +++ b/foo/bar/z.txt |
|
128 | 124 | @@ -1,2 +1,3 @@ |
|
129 | 125 | z1 |
|
130 | 126 | z2 |
|
131 | 127 | +z3 |
|
132 | 128 | |
|
133 | 129 | Status from within a subdirectory: |
|
134 | 130 | |
|
135 | 131 | $ mkdir dir |
|
136 | 132 | $ cd dir |
|
137 | 133 | $ echo a1 > a.txt |
|
138 | 134 | $ hg status -S |
|
139 | 135 | M foo/bar/z.txt |
|
140 | 136 | M foo/y.txt |
|
141 | 137 | ? dir/a.txt |
|
142 | 138 | $ hg diff --nodates -S |
|
143 | 139 | diff -r d254738c5f5e foo/y.txt |
|
144 | 140 | --- a/foo/y.txt |
|
145 | 141 | +++ b/foo/y.txt |
|
146 | 142 | @@ -1,2 +1,3 @@ |
|
147 | 143 | y1 |
|
148 | 144 | y2 |
|
149 | 145 | +y3 |
|
150 | 146 | diff -r 9647f22de499 foo/bar/z.txt |
|
151 | 147 | --- a/foo/bar/z.txt |
|
152 | 148 | +++ b/foo/bar/z.txt |
|
153 | 149 | @@ -1,2 +1,3 @@ |
|
154 | 150 | z1 |
|
155 | 151 | z2 |
|
156 | 152 | +z3 |
|
157 | 153 | |
|
158 | 154 | Status with relative path: |
|
159 | 155 | |
|
160 | 156 | $ hg status -S .. |
|
161 | 157 | M ../foo/bar/z.txt |
|
162 | 158 | M ../foo/y.txt |
|
163 | 159 | ? a.txt |
|
164 | 160 | $ hg diff --nodates -S .. |
|
165 | 161 | diff -r d254738c5f5e foo/y.txt |
|
166 | 162 | --- a/foo/y.txt |
|
167 | 163 | +++ b/foo/y.txt |
|
168 | 164 | @@ -1,2 +1,3 @@ |
|
169 | 165 | y1 |
|
170 | 166 | y2 |
|
171 | 167 | +y3 |
|
172 | 168 | diff -r 9647f22de499 foo/bar/z.txt |
|
173 | 169 | --- a/foo/bar/z.txt |
|
174 | 170 | +++ b/foo/bar/z.txt |
|
175 | 171 | @@ -1,2 +1,3 @@ |
|
176 | 172 | z1 |
|
177 | 173 | z2 |
|
178 | 174 | +z3 |
|
179 | 175 | $ cd .. |
|
180 | 176 | |
|
181 | 177 | Cleanup and final commit: |
|
182 | 178 | |
|
183 | 179 | $ rm -r dir |
|
184 | 180 | $ hg commit -m 2-3-2 |
|
185 | 181 | committing subrepository foo |
|
186 | 182 | committing subrepository foo/bar |
|
187 | 183 | |
|
188 | 184 | Log with the relationships between repo and its subrepo: |
|
189 | 185 | |
|
190 | 186 | $ hg log --template '{rev}:{node|short} {desc}\n' |
|
191 | 187 | 2:1326fa26d0c0 2-3-2 |
|
192 | 188 | 1:4b3c9ff4f66b 1-2-1 |
|
193 | 189 | 0:23376cbba0d8 0-0-0 |
|
194 | 190 | |
|
195 | 191 | $ hg -R foo log --template '{rev}:{node|short} {desc}\n' |
|
196 | 192 | 3:65903cebad86 2-3-2 |
|
197 | 193 | 2:d254738c5f5e 0-2-1 |
|
198 | 194 | 1:8629ce7dcc39 0-1-0 |
|
199 | 195 | 0:af048e97ade2 0-0-0 |
|
200 | 196 | |
|
201 | 197 | $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' |
|
202 | 198 | 2:31ecbdafd357 2-3-2 |
|
203 | 199 | 1:9647f22de499 0-1-1 |
|
204 | 200 | 0:4904098473f9 0-0-0 |
|
205 | 201 | |
|
206 | 202 | Status between revisions: |
|
207 | 203 | |
|
208 | 204 | $ hg status -S |
|
209 | 205 | $ hg status -S --rev 0:1 |
|
210 | 206 | M .hgsubstate |
|
211 | 207 | M foo/.hgsubstate |
|
212 | 208 | M foo/bar/z.txt |
|
213 | 209 | M foo/y.txt |
|
214 | 210 | $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 |
|
215 | 211 | diff -r af048e97ade2 -r d254738c5f5e foo/y.txt |
|
216 | 212 | --- a/foo/y.txt |
|
217 | 213 | +++ b/foo/y.txt |
|
218 | 214 | @@ -1,1 +1,2 @@ |
|
219 | 215 | y1 |
|
220 | 216 | +y2 |
|
221 | 217 | diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt |
|
222 | 218 | --- a/foo/bar/z.txt |
|
223 | 219 | +++ b/foo/bar/z.txt |
|
224 | 220 | @@ -1,1 +1,2 @@ |
|
225 | 221 | z1 |
|
226 | 222 | +z2 |
|
227 | 223 | |
|
228 | 224 | Test archiving to a directory tree: |
|
229 | 225 | |
|
230 | 226 | $ hg archive --subrepos ../archive |
|
231 | 227 | $ find ../archive | sort |
|
232 | 228 | ../archive |
|
233 | 229 | ../archive/.hg_archival.txt |
|
234 | 230 | ../archive/.hgsub |
|
235 | 231 | ../archive/.hgsubstate |
|
236 | 232 | ../archive/foo |
|
237 | 233 | ../archive/foo/.hgsub |
|
238 | 234 | ../archive/foo/.hgsubstate |
|
239 | 235 | ../archive/foo/bar |
|
240 | 236 | ../archive/foo/bar/z.txt |
|
241 | 237 | ../archive/foo/y.txt |
|
242 | 238 | ../archive/x.txt |
|
243 | 239 | |
|
244 | 240 | Test archiving to zip file (unzip output is unstable): |
|
245 | 241 | |
|
246 | 242 | $ hg archive --subrepos ../archive.zip |
|
247 | 243 | |
|
248 | 244 | Clone and test outgoing: |
|
249 | 245 | |
|
250 | 246 | $ cd .. |
|
251 | 247 | $ hg clone repo repo2 |
|
252 | 248 | updating to branch default |
|
253 | 249 | pulling subrepo foo from */repo/foo (glob) |
|
254 | 250 | requesting all changes |
|
255 | 251 | adding changesets |
|
256 | 252 | adding manifests |
|
257 | 253 | adding file changes |
|
258 | 254 | added 4 changesets with 7 changes to 3 files |
|
259 | 255 | pulling subrepo foo/bar from */repo/foo/bar (glob) |
|
260 | 256 | requesting all changes |
|
261 | 257 | adding changesets |
|
262 | 258 | adding manifests |
|
263 | 259 | adding file changes |
|
264 | 260 | added 3 changesets with 3 changes to 1 files |
|
265 | 261 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
266 | 262 | $ cd repo2 |
|
267 | 263 | $ hg outgoing -S |
|
268 | 264 | comparing with */repo (glob) |
|
269 | 265 | searching for changes |
|
270 | 266 | no changes found |
|
271 | 267 | comparing with */repo/foo (glob) |
|
272 | 268 | searching for changes |
|
273 | 269 | no changes found |
|
274 | 270 | comparing with */repo/foo/bar (glob) |
|
275 | 271 | searching for changes |
|
276 | 272 | no changes found |
|
277 | 273 | [1] |
|
278 | 274 | |
|
279 | 275 | Make nested change: |
|
280 | 276 | |
|
281 | 277 | $ echo y4 >> foo/y.txt |
|
282 | 278 | $ hg diff --nodates -S |
|
283 | 279 | diff -r 65903cebad86 foo/y.txt |
|
284 | 280 | --- a/foo/y.txt |
|
285 | 281 | +++ b/foo/y.txt |
|
286 | 282 | @@ -1,3 +1,4 @@ |
|
287 | 283 | y1 |
|
288 | 284 | y2 |
|
289 | 285 | y3 |
|
290 | 286 | +y4 |
|
291 | 287 | $ hg commit -m 3-4-2 |
|
292 | 288 | committing subrepository foo |
|
293 | 289 | $ hg outgoing -S |
|
294 | 290 | comparing with */repo (glob) |
|
295 | 291 | searching for changes |
|
296 | 292 | changeset: 3:2655b8ecc4ee |
|
297 | 293 | tag: tip |
|
298 | 294 | user: test |
|
299 | 295 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
300 | 296 | summary: 3-4-2 |
|
301 | 297 | |
|
302 | 298 | comparing with */repo/foo (glob) |
|
303 | 299 | searching for changes |
|
304 | 300 | changeset: 4:e96193d6cb36 |
|
305 | 301 | tag: tip |
|
306 | 302 | user: test |
|
307 | 303 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
308 | 304 | summary: 3-4-2 |
|
309 | 305 | |
|
310 | 306 | comparing with */repo/foo/bar (glob) |
|
311 | 307 | searching for changes |
|
312 | 308 | no changes found |
|
313 | 309 | |
|
314 | 310 | |
|
315 | 311 | Switch to original repo and setup default path: |
|
316 | 312 | |
|
317 | 313 | $ cd ../repo |
|
318 | 314 | $ echo '[paths]' >> .hg/hgrc |
|
319 | 315 | $ echo 'default = ../repo2' >> .hg/hgrc |
|
320 | 316 | |
|
321 | 317 | Test incoming: |
|
322 | 318 | |
|
323 | 319 | $ hg incoming -S |
|
324 | 320 | comparing with */repo2 (glob) |
|
325 | 321 | searching for changes |
|
326 | 322 | changeset: 3:2655b8ecc4ee |
|
327 | 323 | tag: tip |
|
328 | 324 | user: test |
|
329 | 325 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
330 | 326 | summary: 3-4-2 |
|
331 | 327 | |
|
332 | 328 | comparing with */repo2/foo (glob) |
|
333 | 329 | searching for changes |
|
334 | 330 | changeset: 4:e96193d6cb36 |
|
335 | 331 | tag: tip |
|
336 | 332 | user: test |
|
337 | 333 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
338 | 334 | summary: 3-4-2 |
|
339 | 335 | |
|
340 | 336 | comparing with */repo2/foo/bar (glob) |
|
341 | 337 | searching for changes |
|
342 | 338 | no changes found |
|
343 | 339 | |
|
344 | 340 | $ hg incoming -S --bundle incoming.hg |
|
345 | 341 | abort: cannot combine --bundle and --subrepos |
|
346 | 342 | [255] |
|
347 | 343 | |
|
348 | 344 | Test missing subrepo: |
|
349 | 345 | |
|
350 | 346 | $ rm -r foo |
|
351 | 347 | $ hg status -S |
|
352 | 348 | warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" |
General Comments 0
You need to be logged in to leave comments.
Login now