Show More
@@ -1,670 +1,664 b'' | |||
|
1 | 1 | $ "$TESTDIR/hghave" git || exit 80 |
|
2 | 2 | |
|
3 | 3 | make git commits repeatable |
|
4 | 4 | |
|
5 | 5 | $ echo "[core]" >> $HOME/.gitconfig |
|
6 | 6 | $ echo "autocrlf = false" >> $HOME/.gitconfig |
|
7 | 7 | $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
|
8 | 8 | $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
|
9 | 9 | $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE |
|
10 | 10 | $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
|
11 | 11 | $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
|
12 | 12 | $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
|
13 | 13 | |
|
14 | 14 | root hg repo |
|
15 | 15 | |
|
16 | 16 | $ hg init t |
|
17 | 17 | $ cd t |
|
18 | 18 | $ echo a > a |
|
19 | 19 | $ hg add a |
|
20 | 20 | $ hg commit -m a |
|
21 | 21 | $ cd .. |
|
22 | 22 | |
|
23 | 23 | new external git repo |
|
24 | 24 | |
|
25 | 25 | $ mkdir gitroot |
|
26 | 26 | $ cd gitroot |
|
27 | 27 | $ git init -q |
|
28 | 28 | $ echo g > g |
|
29 | 29 | $ git add g |
|
30 | 30 | $ git commit -q -m g |
|
31 | 31 | |
|
32 | 32 | add subrepo clone |
|
33 | 33 | |
|
34 | 34 | $ cd ../t |
|
35 | 35 | $ echo 's = [git]../gitroot' > .hgsub |
|
36 | 36 | $ git clone -q ../gitroot s |
|
37 | 37 | $ hg add .hgsub |
|
38 | 38 | $ hg commit -m 'new git subrepo' |
|
39 | 39 | $ hg debugsub |
|
40 | 40 | path s |
|
41 | 41 | source ../gitroot |
|
42 | 42 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
43 | 43 | |
|
44 | 44 | record a new commit from upstream from a different branch |
|
45 | 45 | |
|
46 | 46 | $ cd ../gitroot |
|
47 | 47 | $ git checkout -q -b testing |
|
48 | 48 | $ echo gg >> g |
|
49 | 49 | $ git commit -q -a -m gg |
|
50 | 50 | |
|
51 | 51 | $ cd ../t/s |
|
52 | 52 | $ git pull -q >/dev/null 2>/dev/null |
|
53 | 53 | $ git checkout -q -b testing origin/testing >/dev/null |
|
54 | 54 | |
|
55 | 55 | $ cd .. |
|
56 | 56 | $ hg status --subrepos |
|
57 | 57 | M s/g |
|
58 | 58 | $ hg commit -m 'update git subrepo' |
|
59 | 59 | $ hg debugsub |
|
60 | 60 | path s |
|
61 | 61 | source ../gitroot |
|
62 | 62 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
|
63 | 63 | |
|
64 | 64 | make $GITROOT pushable, by replacing it with a clone with nothing checked out |
|
65 | 65 | |
|
66 | 66 | $ cd .. |
|
67 | 67 | $ git clone gitroot gitrootbare --bare -q |
|
68 | 68 | $ rm -rf gitroot |
|
69 | 69 | $ mv gitrootbare gitroot |
|
70 | 70 | |
|
71 | 71 | clone root |
|
72 | 72 | |
|
73 | 73 | $ cd t |
|
74 | 74 | $ hg clone . ../tc 2> /dev/null |
|
75 | 75 | updating to branch default |
|
76 | 76 | cloning subrepo s from $TESTTMP/gitroot |
|
77 | 77 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 78 | $ cd ../tc |
|
79 | 79 | $ hg debugsub |
|
80 | 80 | path s |
|
81 | 81 | source ../gitroot |
|
82 | 82 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
|
83 | 83 | |
|
84 | 84 | update to previous substate |
|
85 | 85 | |
|
86 | 86 | $ hg update 1 -q |
|
87 | 87 | $ cat s/g |
|
88 | 88 | g |
|
89 | 89 | $ hg debugsub |
|
90 | 90 | path s |
|
91 | 91 | source ../gitroot |
|
92 | 92 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
93 | 93 | |
|
94 | 94 | clone root, make local change |
|
95 | 95 | |
|
96 | 96 | $ cd ../t |
|
97 | 97 | $ hg clone . ../ta 2> /dev/null |
|
98 | 98 | updating to branch default |
|
99 | 99 | cloning subrepo s from $TESTTMP/gitroot |
|
100 | 100 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
101 | 101 | |
|
102 | 102 | $ cd ../ta |
|
103 | 103 | $ echo ggg >> s/g |
|
104 | 104 | $ hg status --subrepos |
|
105 | 105 | M s/g |
|
106 | 106 | $ hg commit --subrepos -m ggg |
|
107 | 107 | committing subrepository s |
|
108 | 108 | $ hg debugsub |
|
109 | 109 | path s |
|
110 | 110 | source ../gitroot |
|
111 | 111 | revision 79695940086840c99328513acbe35f90fcd55e57 |
|
112 | 112 | |
|
113 | 113 | clone root separately, make different local change |
|
114 | 114 | |
|
115 | 115 | $ cd ../t |
|
116 | 116 | $ hg clone . ../tb 2> /dev/null |
|
117 | 117 | updating to branch default |
|
118 | 118 | cloning subrepo s from $TESTTMP/gitroot |
|
119 | 119 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
120 | 120 | |
|
121 | 121 | $ cd ../tb/s |
|
122 | 122 | $ echo f > f |
|
123 | 123 | $ git add f |
|
124 | 124 | $ cd .. |
|
125 | 125 | |
|
126 | 126 | $ hg status --subrepos |
|
127 | 127 | A s/f |
|
128 | 128 | $ hg commit --subrepos -m f |
|
129 | 129 | committing subrepository s |
|
130 | 130 | $ hg debugsub |
|
131 | 131 | path s |
|
132 | 132 | source ../gitroot |
|
133 | 133 | revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
134 | 134 | |
|
135 | 135 | user b push changes |
|
136 | 136 | |
|
137 | 137 | $ hg push 2>/dev/null |
|
138 | 138 | pushing to $TESTTMP/t (glob) |
|
139 | 139 | pushing branch testing of subrepo s |
|
140 | 140 | searching for changes |
|
141 | 141 | adding changesets |
|
142 | 142 | adding manifests |
|
143 | 143 | adding file changes |
|
144 | 144 | added 1 changesets with 1 changes to 1 files |
|
145 | 145 | |
|
146 | 146 | user a pulls, merges, commits |
|
147 | 147 | |
|
148 | 148 | $ cd ../ta |
|
149 | 149 | $ hg pull |
|
150 | 150 | pulling from $TESTTMP/t (glob) |
|
151 | 151 | searching for changes |
|
152 | 152 | adding changesets |
|
153 | 153 | adding manifests |
|
154 | 154 | adding file changes |
|
155 | 155 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
156 | 156 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
157 | 157 | $ hg merge 2>/dev/null |
|
158 | 158 | subrepository s diverged (local revision: 796959400868, remote revision: aa84837ccfbd) |
|
159 | 159 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
160 | 160 | pulling subrepo s from $TESTTMP/gitroot |
|
161 | 161 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
162 | 162 | (branch merge, don't forget to commit) |
|
163 | 163 | $ cat s/f |
|
164 | 164 | f |
|
165 | 165 | $ cat s/g |
|
166 | 166 | g |
|
167 | 167 | gg |
|
168 | 168 | ggg |
|
169 | 169 | $ hg commit --subrepos -m 'merge' |
|
170 | 170 | committing subrepository s |
|
171 | 171 | $ hg status --subrepos --rev 1:5 |
|
172 | 172 | M .hgsubstate |
|
173 | 173 | M s/g |
|
174 | 174 | A s/f |
|
175 | 175 | $ hg debugsub |
|
176 | 176 | path s |
|
177 | 177 | source ../gitroot |
|
178 | 178 | revision f47b465e1bce645dbf37232a00574aa1546ca8d3 |
|
179 | 179 | $ hg push 2>/dev/null |
|
180 | 180 | pushing to $TESTTMP/t (glob) |
|
181 | 181 | pushing branch testing of subrepo s |
|
182 | 182 | searching for changes |
|
183 | 183 | adding changesets |
|
184 | 184 | adding manifests |
|
185 | 185 | adding file changes |
|
186 | 186 | added 2 changesets with 2 changes to 1 files |
|
187 | 187 | |
|
188 | 188 | make upstream git changes |
|
189 | 189 | |
|
190 | 190 | $ cd .. |
|
191 | 191 | $ git clone -q gitroot gitclone |
|
192 | 192 | $ cd gitclone |
|
193 | 193 | $ echo ff >> f |
|
194 | 194 | $ git commit -q -a -m ff |
|
195 | 195 | $ echo fff >> f |
|
196 | 196 | $ git commit -q -a -m fff |
|
197 | 197 | $ git push origin testing 2>/dev/null |
|
198 | 198 | |
|
199 | 199 | make and push changes to hg without updating the subrepo |
|
200 | 200 | |
|
201 | 201 | $ cd ../t |
|
202 | 202 | $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.' |
|
203 | 203 | updating to branch default |
|
204 | 204 | cloning subrepo s from $TESTTMP/gitroot |
|
205 | 205 | checking out detached HEAD in subrepo s |
|
206 | 206 | check out a git branch if you intend to make changes |
|
207 | 207 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
208 | 208 | $ cd ../td |
|
209 | 209 | $ echo aa >> a |
|
210 | 210 | $ hg commit -m aa |
|
211 | 211 | $ hg push |
|
212 | 212 | pushing to $TESTTMP/t (glob) |
|
213 | 213 | searching for changes |
|
214 | 214 | adding changesets |
|
215 | 215 | adding manifests |
|
216 | 216 | adding file changes |
|
217 | 217 | added 1 changesets with 1 changes to 1 files |
|
218 | 218 | |
|
219 | 219 | sync to upstream git, distribute changes |
|
220 | 220 | |
|
221 | 221 | $ cd ../ta |
|
222 | 222 | $ hg pull -u -q |
|
223 | 223 | $ cd s |
|
224 | 224 | $ git pull -q >/dev/null 2>/dev/null |
|
225 | 225 | $ cd .. |
|
226 | 226 | $ hg commit -m 'git upstream sync' |
|
227 | 227 | $ hg debugsub |
|
228 | 228 | path s |
|
229 | 229 | source ../gitroot |
|
230 | 230 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
231 | 231 | $ hg push -q |
|
232 | 232 | |
|
233 | 233 | $ cd ../tb |
|
234 | 234 | $ hg pull -q |
|
235 | 235 | $ hg update 2>/dev/null |
|
236 | 236 | pulling subrepo s from $TESTTMP/gitroot |
|
237 | 237 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
238 | 238 | $ hg debugsub |
|
239 | 239 | path s |
|
240 | 240 | source ../gitroot |
|
241 | 241 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
242 | 242 | |
|
243 | 243 | create a new git branch |
|
244 | 244 | |
|
245 | 245 | $ cd s |
|
246 | 246 | $ git checkout -b b2 |
|
247 | 247 | Switched to a new branch 'b2' |
|
248 | 248 | $ echo a>a |
|
249 | 249 | $ git add a |
|
250 | 250 | $ git commit -qm 'add a' |
|
251 | 251 | $ cd .. |
|
252 | 252 | $ hg commit -m 'add branch in s' |
|
253 | 253 | |
|
254 | 254 | pulling new git branch should not create tracking branch named 'origin/b2' |
|
255 | 255 | (issue3870) |
|
256 | 256 | $ cd ../td/s |
|
257 | 257 | $ git remote set-url origin $TESTTMP/tb/s |
|
258 | 258 | $ git branch --no-track oldtesting |
|
259 | 259 | $ cd .. |
|
260 | 260 | $ hg pull -q ../tb |
|
261 | 261 | $ hg up |
|
262 | 262 | From $TESTTMP/tb/s |
|
263 | 263 | * [new branch] b2 -> origin/b2 |
|
264 | 264 | Previous HEAD position was f47b465... merge |
|
265 | 265 | Switched to a new branch 'b2' |
|
266 | 266 | pulling subrepo s from $TESTTMP/tb/s |
|
267 | 267 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
268 | 268 | |
|
269 | 269 | update to a revision without the subrepo, keeping the local git repository |
|
270 | 270 | |
|
271 | 271 | $ cd ../t |
|
272 | 272 | $ hg up 0 |
|
273 | 273 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
274 | 274 | $ ls -a s |
|
275 | 275 | . |
|
276 | 276 | .. |
|
277 | 277 | .git |
|
278 | 278 | |
|
279 | 279 | $ hg up 2 |
|
280 | 280 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
281 | 281 | $ ls -a s |
|
282 | 282 | . |
|
283 | 283 | .. |
|
284 | 284 | .git |
|
285 | 285 | g |
|
286 | 286 | |
|
287 | 287 | archive subrepos |
|
288 | 288 | |
|
289 | 289 | $ cd ../tc |
|
290 | 290 | $ hg pull -q |
|
291 | 291 | $ hg archive --subrepos -r 5 ../archive 2>/dev/null |
|
292 | 292 | pulling subrepo s from $TESTTMP/gitroot |
|
293 | 293 | $ cd ../archive |
|
294 | 294 | $ cat s/f |
|
295 | 295 | f |
|
296 | 296 | $ cat s/g |
|
297 | 297 | g |
|
298 | 298 | gg |
|
299 | 299 | ggg |
|
300 | 300 | |
|
301 | 301 | $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null |
|
302 | 302 | $ find ../archive_x | sort | grep -v pax_global_header |
|
303 | 303 | ../archive_x |
|
304 | 304 | ../archive_x/.hg_archival.txt |
|
305 | 305 | ../archive_x/.hgsub |
|
306 | 306 | ../archive_x/.hgsubstate |
|
307 | 307 | ../archive_x/a |
|
308 | 308 | ../archive_x/s |
|
309 | 309 | ../archive_x/s/g |
|
310 | 310 | |
|
311 | 311 | create nested repo |
|
312 | 312 | |
|
313 | 313 | $ cd .. |
|
314 | 314 | $ hg init outer |
|
315 | 315 | $ cd outer |
|
316 | 316 | $ echo b>b |
|
317 | 317 | $ hg add b |
|
318 | 318 | $ hg commit -m b |
|
319 | 319 | |
|
320 | 320 | $ hg clone ../t inner 2> /dev/null |
|
321 | 321 | updating to branch default |
|
322 | 322 | cloning subrepo s from $TESTTMP/gitroot |
|
323 | 323 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
324 | 324 | $ echo inner = inner > .hgsub |
|
325 | 325 | $ hg add .hgsub |
|
326 | 326 | $ hg commit -m 'nested sub' |
|
327 | 327 | |
|
328 | 328 | nested commit |
|
329 | 329 | |
|
330 | 330 | $ echo ffff >> inner/s/f |
|
331 | 331 | $ hg status --subrepos |
|
332 | 332 | M inner/s/f |
|
333 | 333 | $ hg commit --subrepos -m nested |
|
334 | 334 | committing subrepository inner |
|
335 | 335 | committing subrepository inner/s (glob) |
|
336 | 336 | |
|
337 | 337 | nested archive |
|
338 | 338 | |
|
339 | 339 | $ hg archive --subrepos ../narchive |
|
340 | 340 | $ ls ../narchive/inner/s | grep -v pax_global_header |
|
341 | 341 | f |
|
342 | 342 | g |
|
343 | 343 | |
|
344 | 344 | relative source expansion |
|
345 | 345 | |
|
346 | 346 | $ cd .. |
|
347 | 347 | $ mkdir d |
|
348 | 348 | $ hg clone t d/t 2> /dev/null |
|
349 | 349 | updating to branch default |
|
350 | 350 | cloning subrepo s from $TESTTMP/gitroot |
|
351 | 351 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
352 | 352 | |
|
353 | 353 | Don't crash if the subrepo is missing |
|
354 | 354 | |
|
355 | 355 | $ hg clone t missing -q |
|
356 | 356 | $ cd missing |
|
357 | 357 | $ rm -rf s |
|
358 | 358 | $ hg status -S |
|
359 | 359 | $ hg sum | grep commit |
|
360 | 360 | commit: 1 subrepos |
|
361 | 361 | $ hg push -q |
|
362 | 362 | abort: subrepo s is missing (in subrepo s) |
|
363 | 363 | [255] |
|
364 | 364 | $ hg commit --subrepos -qm missing |
|
365 | 365 | abort: subrepo s is missing (in subrepo s) |
|
366 | 366 | [255] |
|
367 | 367 | $ hg update -C 2> /dev/null |
|
368 | 368 | cloning subrepo s from $TESTTMP/gitroot |
|
369 | 369 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
370 | 370 | $ hg sum | grep commit |
|
371 | 371 | commit: (clean) |
|
372 | 372 | |
|
373 | 373 | Don't crash if the .hgsubstate entry is missing |
|
374 | 374 | |
|
375 | 375 | $ hg update 1 -q |
|
376 | 376 | $ hg rm .hgsubstate |
|
377 | 377 | $ hg commit .hgsubstate -m 'no substate' |
|
378 | 378 | nothing changed |
|
379 | 379 | [1] |
|
380 | 380 | $ hg tag -l nosubstate |
|
381 | 381 | $ hg manifest |
|
382 | 382 | .hgsub |
|
383 | 383 | .hgsubstate |
|
384 | 384 | a |
|
385 | 385 | |
|
386 | 386 | $ hg status -S |
|
387 | 387 | R .hgsubstate |
|
388 | 388 | $ hg sum | grep commit |
|
389 | 389 | commit: 1 removed, 1 subrepos (new branch head) |
|
390 | 390 | |
|
391 | 391 | $ hg commit -m 'restore substate' |
|
392 | 392 | nothing changed |
|
393 | 393 | [1] |
|
394 | 394 | $ hg manifest |
|
395 | 395 | .hgsub |
|
396 | 396 | .hgsubstate |
|
397 | 397 | a |
|
398 | 398 | $ hg sum | grep commit |
|
399 | 399 | commit: 1 removed, 1 subrepos (new branch head) |
|
400 | 400 | |
|
401 | 401 | $ hg update -qC nosubstate |
|
402 | 402 | $ ls s |
|
403 | 403 | g |
|
404 | 404 | |
|
405 | 405 | issue3109: false positives in git diff-index |
|
406 | 406 | |
|
407 | 407 | $ hg update -q |
|
408 | 408 | $ touch -t 200001010000 s/g |
|
409 | 409 | $ hg status --subrepos |
|
410 | 410 | $ touch -t 200001010000 s/g |
|
411 | 411 | $ hg sum | grep commit |
|
412 | 412 | commit: (clean) |
|
413 | 413 | |
|
414 | 414 | Check hg update --clean |
|
415 | 415 | $ cd $TESTTMP/ta |
|
416 | 416 | $ echo > s/g |
|
417 | 417 | $ cd s |
|
418 | 418 | $ echo c1 > f1 |
|
419 | 419 | $ echo c1 > f2 |
|
420 | 420 | $ git add f1 |
|
421 | 421 | $ cd .. |
|
422 | 422 | $ hg status -S |
|
423 | 423 | M s/g |
|
424 | 424 | A s/f1 |
|
425 | 425 | $ ls s |
|
426 | 426 | f |
|
427 | 427 | f1 |
|
428 | 428 | f2 |
|
429 | 429 | g |
|
430 | 430 | $ hg update --clean |
|
431 | 431 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
432 | 432 | $ hg status -S |
|
433 | 433 | $ ls s |
|
434 | 434 | f |
|
435 | 435 | f1 |
|
436 | 436 | f2 |
|
437 | 437 | g |
|
438 | 438 | |
|
439 | 439 | Sticky subrepositories, no changes |
|
440 | 440 | $ cd $TESTTMP/ta |
|
441 | 441 | $ hg id -n |
|
442 | 442 | 7 |
|
443 | 443 | $ cd s |
|
444 | 444 | $ git rev-parse HEAD |
|
445 | 445 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
446 | 446 | $ cd .. |
|
447 | 447 | $ hg update 1 > /dev/null 2>&1 |
|
448 | 448 | $ hg id -n |
|
449 | 449 | 1 |
|
450 | 450 | $ cd s |
|
451 | 451 | $ git rev-parse HEAD |
|
452 | 452 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
453 | 453 | $ cd .. |
|
454 | 454 | |
|
455 | 455 | Sticky subrepositories, file changes |
|
456 | 456 | $ touch s/f1 |
|
457 | 457 | $ cd s |
|
458 | 458 | $ git add f1 |
|
459 | 459 | $ cd .. |
|
460 | 460 | $ hg id -n |
|
461 | 461 | 1+ |
|
462 | 462 | $ cd s |
|
463 | 463 | $ git rev-parse HEAD |
|
464 | 464 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
465 | 465 | $ cd .. |
|
466 | 466 | $ hg update 4 |
|
467 | 467 | subrepository s diverged (local revision: da5f5b1d8ffc, remote revision: aa84837ccfbd) |
|
468 | 468 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
469 | 469 | subrepository sources for s differ |
|
470 | 470 | use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? |
|
471 | 471 | l |
|
472 | 472 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
473 | 473 | $ hg id -n |
|
474 | 474 | 4+ |
|
475 | 475 | $ cd s |
|
476 | 476 | $ git rev-parse HEAD |
|
477 | 477 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
478 | 478 | $ cd .. |
|
479 | 479 | $ hg update --clean tip > /dev/null 2>&1 |
|
480 | 480 | |
|
481 | 481 | Sticky subrepository, revision updates |
|
482 | 482 | $ hg id -n |
|
483 | 483 | 7 |
|
484 | 484 | $ cd s |
|
485 | 485 | $ git rev-parse HEAD |
|
486 | 486 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
487 | 487 | $ cd .. |
|
488 | 488 | $ cd s |
|
489 | 489 | $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
490 | 490 | Previous HEAD position was 32a3438... fff |
|
491 | 491 | HEAD is now at aa84837... f |
|
492 | 492 | $ cd .. |
|
493 | 493 | $ hg update 1 |
|
494 | 494 | subrepository s diverged (local revision: 32a343883b74, remote revision: da5f5b1d8ffc) |
|
495 | 495 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
496 | 496 | subrepository sources for s differ (in checked out version) |
|
497 | 497 | use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? |
|
498 | 498 | l |
|
499 | 499 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
500 | 500 | $ hg id -n |
|
501 | 501 | 1+ |
|
502 | 502 | $ cd s |
|
503 | 503 | $ git rev-parse HEAD |
|
504 | 504 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
505 | 505 | $ cd .. |
|
506 | 506 | |
|
507 | 507 | Sticky subrepository, file changes and revision updates |
|
508 | 508 | $ touch s/f1 |
|
509 | 509 | $ cd s |
|
510 | 510 | $ git add f1 |
|
511 | 511 | $ git rev-parse HEAD |
|
512 | 512 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
513 | 513 | $ cd .. |
|
514 | 514 | $ hg id -n |
|
515 | 515 | 1+ |
|
516 | 516 | $ hg update 7 |
|
517 | 517 | subrepository s diverged (local revision: 32a343883b74, remote revision: 32a343883b74) |
|
518 | 518 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
519 | 519 | subrepository sources for s differ |
|
520 | 520 | use (l)ocal source (32a3438) or (r)emote source (32a3438)? |
|
521 | 521 | l |
|
522 | 522 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
523 | 523 | $ hg id -n |
|
524 | 524 | 7+ |
|
525 | 525 | $ cd s |
|
526 | 526 | $ git rev-parse HEAD |
|
527 | 527 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
528 | 528 | $ cd .. |
|
529 | 529 | |
|
530 | 530 | Sticky repository, update --clean |
|
531 | 531 | $ hg update --clean tip 2>/dev/null |
|
532 | 532 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
533 | 533 | $ hg id -n |
|
534 | 534 | 7 |
|
535 | 535 | $ cd s |
|
536 | 536 | $ git rev-parse HEAD |
|
537 | 537 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
538 | 538 | $ cd .. |
|
539 | 539 | |
|
540 | 540 | Test subrepo already at intended revision: |
|
541 | 541 | $ cd s |
|
542 | 542 | $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
543 | 543 | HEAD is now at 32a3438... fff |
|
544 | 544 | $ cd .. |
|
545 | 545 | $ hg update 1 |
|
546 | 546 | Previous HEAD position was 32a3438... fff |
|
547 | 547 | HEAD is now at da5f5b1... g |
|
548 | 548 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
549 | 549 | $ hg id -n |
|
550 | 550 | 1 |
|
551 | 551 | $ cd s |
|
552 | 552 | $ git rev-parse HEAD |
|
553 | 553 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
554 | 554 | $ cd .. |
|
555 | 555 | |
|
556 | 556 | Test forgetting files, not implemented in git subrepo, used to |
|
557 | 557 | traceback |
|
558 | 558 | #if no-windows |
|
559 | 559 | $ hg forget 'notafile*' |
|
560 | 560 | notafile*: No such file or directory |
|
561 | 561 | [1] |
|
562 | 562 | #else |
|
563 | 563 | $ hg forget 'notafile' |
|
564 | 564 | notafile: * (glob) |
|
565 | 565 | [1] |
|
566 | 566 | #endif |
|
567 | 567 | |
|
568 | 568 | $ cd .. |
|
569 | 569 | |
|
570 | 570 | Test sanitizing ".hg/hgrc" in subrepo |
|
571 | 571 | |
|
572 | 572 | $ cd t |
|
573 | 573 | $ hg tip -q |
|
574 | 574 | 7:af6d2edbb0d3 |
|
575 | 575 | $ hg update -q -C af6d2edbb0d3 |
|
576 | 576 | $ cd s |
|
577 | 577 | $ git checkout -q -b sanitize-test |
|
578 | 578 | $ mkdir .hg |
|
579 | 579 | $ echo '.hg/hgrc in git repo' > .hg/hgrc |
|
580 | 580 | $ mkdir -p sub/.hg |
|
581 | 581 | $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc |
|
582 | 582 | $ git add .hg sub |
|
583 | 583 | $ git commit -qm 'add .hg/hgrc to be sanitized at hg update' |
|
584 | 584 | $ git push -q origin sanitize-test |
|
585 | 585 | $ cd .. |
|
586 | 586 | $ grep ' s$' .hgsubstate |
|
587 | 587 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
|
588 | 588 | $ hg commit -qm 'commit with git revision including .hg/hgrc' |
|
589 | 589 | $ hg parents -q |
|
590 | 590 | 8:3473d20bddcf |
|
591 | 591 | $ grep ' s$' .hgsubstate |
|
592 | 592 | c4069473b459cf27fd4d7c2f50c4346b4e936599 s |
|
593 | 593 | $ cd .. |
|
594 | 594 | |
|
595 | 595 | $ hg -R tc pull -q |
|
596 | 596 | $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort |
|
597 | 597 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) |
|
598 | 598 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) |
|
599 | 599 | $ cd tc |
|
600 | 600 | $ hg parents -q |
|
601 | 601 | 8:3473d20bddcf |
|
602 | 602 | $ grep ' s$' .hgsubstate |
|
603 | 603 | c4069473b459cf27fd4d7c2f50c4346b4e936599 s |
|
604 |
$ |
|
|
605 | cat: s/.hg/hgrc: No such file or directory | |
|
604 | $ test -f s/.hg/hgrc | |
|
606 | 605 | [1] |
|
607 |
$ |
|
|
608 | cat: s/sub/.hg/hgrc: No such file or directory | |
|
606 | $ test -f s/sub/.hg/hgrc | |
|
609 | 607 | [1] |
|
610 | 608 | $ cd .. |
|
611 | 609 | |
|
612 | 610 | additional test for "git merge --ff" route: |
|
613 | 611 | |
|
614 | 612 | $ cd t |
|
615 | 613 | $ hg tip -q |
|
616 | 614 | 8:3473d20bddcf |
|
617 | 615 | $ hg update -q -C af6d2edbb0d3 |
|
618 | 616 | $ cd s |
|
619 | 617 | $ git checkout -q testing |
|
620 | 618 | $ mkdir .hg |
|
621 | 619 | $ echo '.hg/hgrc in git repo' > .hg/hgrc |
|
622 | 620 | $ mkdir -p sub/.hg |
|
623 | 621 | $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc |
|
624 | 622 | $ git add .hg sub |
|
625 | 623 | $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)' |
|
626 | 624 | $ git push -q origin testing |
|
627 | 625 | $ cd .. |
|
628 | 626 | $ grep ' s$' .hgsubstate |
|
629 | 627 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
|
630 | 628 | $ hg commit -qm 'commit with git revision including .hg/hgrc' |
|
631 | 629 | $ hg parents -q |
|
632 | 630 | 9:ed23f7fe024e |
|
633 | 631 | $ grep ' s$' .hgsubstate |
|
634 | 632 | f262643c1077219fbd3858d54e78ef050ef84fbf s |
|
635 | 633 | $ cd .. |
|
636 | 634 | |
|
637 | 635 | $ cd tc |
|
638 | 636 | $ hg update -q -C af6d2edbb0d3 |
|
639 |
$ |
|
|
640 | cat: s/.hg/hgrc: No such file or directory | |
|
637 | $ test -f s/.hg/hgrc | |
|
641 | 638 | [1] |
|
642 |
$ |
|
|
643 | cat: s/sub/.hg/hgrc: No such file or directory | |
|
639 | $ test -f s/sub/.hg/hgrc | |
|
644 | 640 | [1] |
|
645 | 641 | $ cd .. |
|
646 | 642 | $ hg -R tc pull -q |
|
647 | 643 | $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort |
|
648 | 644 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) |
|
649 | 645 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) |
|
650 | 646 | $ cd tc |
|
651 | 647 | $ hg parents -q |
|
652 | 648 | 9:ed23f7fe024e |
|
653 | 649 | $ grep ' s$' .hgsubstate |
|
654 | 650 | f262643c1077219fbd3858d54e78ef050ef84fbf s |
|
655 |
$ |
|
|
656 | cat: s/.hg/hgrc: No such file or directory | |
|
651 | $ test -f s/.hg/hgrc | |
|
657 | 652 | [1] |
|
658 |
$ |
|
|
659 | cat: s/sub/.hg/hgrc: No such file or directory | |
|
653 | $ test -f s/sub/.hg/hgrc | |
|
660 | 654 | [1] |
|
661 | 655 | |
|
662 | 656 | Test that sanitizing is omitted in meta data area: |
|
663 | 657 | |
|
664 | 658 | $ mkdir s/.git/.hg |
|
665 | 659 | $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc |
|
666 | 660 | $ hg update -q -C af6d2edbb0d3 |
|
667 | 661 | checking out detached HEAD in subrepo s |
|
668 | 662 | check out a git branch if you intend to make changes |
|
669 | 663 | |
|
670 | 664 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now