##// END OF EJS Templates
merge with stable
Martin von Zweigbergk -
r41891:3d5a73c8 merge default
parent child Browse files
Show More
@@ -1,662 +1,703 b''
1 1 Test illegal name
2 2 -----------------
3 3
4 4 on commit:
5 5
6 6 $ hg init hgname
7 7 $ cd hgname
8 8 $ mkdir sub
9 9 $ hg init sub/.hg
10 10 $ echo 'sub/.hg = sub/.hg' >> .hgsub
11 11 $ hg ci -qAm 'add subrepo "sub/.hg"'
12 12 abort: path 'sub/.hg' is inside nested repo 'sub'
13 13 [255]
14 14
15 15 prepare tampered repo (including the commit above):
16 16
17 17 $ hg import --bypass -qm 'add subrepo "sub/.hg"' - <<'EOF'
18 18 > diff --git a/.hgsub b/.hgsub
19 19 > new file mode 100644
20 20 > --- /dev/null
21 21 > +++ b/.hgsub
22 22 > @@ -0,0 +1,1 @@
23 23 > +sub/.hg = sub/.hg
24 24 > diff --git a/.hgsubstate b/.hgsubstate
25 25 > new file mode 100644
26 26 > --- /dev/null
27 27 > +++ b/.hgsubstate
28 28 > @@ -0,0 +1,1 @@
29 29 > +0000000000000000000000000000000000000000 sub/.hg
30 30 > EOF
31 31 $ cd ..
32 32
33 33 on clone (and update):
34 34
35 35 $ hg clone -q hgname hgname2
36 36 abort: path 'sub/.hg' is inside nested repo 'sub'
37 37 [255]
38 38
39 39 Test absolute path
40 40 ------------------
41 41
42 42 on commit:
43 43
44 44 $ hg init absolutepath
45 45 $ cd absolutepath
46 46 $ hg init sub
47 47 $ echo '/sub = sub' >> .hgsub
48 48 $ hg ci -qAm 'add subrepo "/sub"'
49 49 abort: path contains illegal component: /sub
50 50 [255]
51 51
52 52 prepare tampered repo (including the commit above):
53 53
54 54 $ hg import --bypass -qm 'add subrepo "/sub"' - <<'EOF'
55 55 > diff --git a/.hgsub b/.hgsub
56 56 > new file mode 100644
57 57 > --- /dev/null
58 58 > +++ b/.hgsub
59 59 > @@ -0,0 +1,1 @@
60 60 > +/sub = sub
61 61 > diff --git a/.hgsubstate b/.hgsubstate
62 62 > new file mode 100644
63 63 > --- /dev/null
64 64 > +++ b/.hgsubstate
65 65 > @@ -0,0 +1,1 @@
66 66 > +0000000000000000000000000000000000000000 /sub
67 67 > EOF
68 68 $ cd ..
69 69
70 70 on clone (and update):
71 71
72 72 $ hg clone -q absolutepath absolutepath2
73 73 abort: path contains illegal component: /sub
74 74 [255]
75 75
76 76 Test root path
77 77 --------------
78 78
79 79 on commit:
80 80
81 81 $ hg init rootpath
82 82 $ cd rootpath
83 83 $ hg init sub
84 84 $ echo '/ = sub' >> .hgsub
85 85 $ hg ci -qAm 'add subrepo "/"'
86 86 abort: path ends in directory separator: /
87 87 [255]
88 88
89 89 prepare tampered repo (including the commit above):
90 90
91 91 $ hg import --bypass -qm 'add subrepo "/"' - <<'EOF'
92 92 > diff --git a/.hgsub b/.hgsub
93 93 > new file mode 100644
94 94 > --- /dev/null
95 95 > +++ b/.hgsub
96 96 > @@ -0,0 +1,1 @@
97 97 > +/ = sub
98 98 > diff --git a/.hgsubstate b/.hgsubstate
99 99 > new file mode 100644
100 100 > --- /dev/null
101 101 > +++ b/.hgsubstate
102 102 > @@ -0,0 +1,1 @@
103 103 > +0000000000000000000000000000000000000000 /
104 104 > EOF
105 105 $ cd ..
106 106
107 107 on clone (and update):
108 108
109 109 $ hg clone -q rootpath rootpath2
110 110 abort: path ends in directory separator: /
111 111 [255]
112 112
113 113 Test empty path
114 114 ---------------
115 115
116 116 on commit:
117 117
118 118 $ hg init emptypath
119 119 $ cd emptypath
120 120 $ hg init sub
121 121 $ echo '= sub' >> .hgsub
122 122 $ hg ci -qAm 'add subrepo ""'
123 123 hg: parse error at .hgsub:1: = sub
124 124 [255]
125 125
126 126 prepare tampered repo (including the commit above):
127 127
128 128 $ hg import --bypass -qm 'add subrepo ""' - <<'EOF'
129 129 > diff --git a/.hgsub b/.hgsub
130 130 > new file mode 100644
131 131 > --- /dev/null
132 132 > +++ b/.hgsub
133 133 > @@ -0,0 +1,1 @@
134 134 > += sub
135 135 > diff --git a/.hgsubstate b/.hgsubstate
136 136 > new file mode 100644
137 137 > --- /dev/null
138 138 > +++ b/.hgsubstate
139 139 > @@ -0,0 +1,1 @@
140 140 > +0000000000000000000000000000000000000000
141 141 > EOF
142 142 $ cd ..
143 143
144 144 on clone (and update):
145 145
146 146 $ hg clone -q emptypath emptypath2
147 147 hg: parse error at .hgsub:1: = sub
148 148 [255]
149 149
150 150 Test current path
151 151 -----------------
152 152
153 153 on commit:
154 154
155 155 $ hg init currentpath
156 156 $ cd currentpath
157 157 $ hg init sub
158 158 $ echo '. = sub' >> .hgsub
159 159 $ hg ci -qAm 'add subrepo "."'
160 160 abort: subrepo path contains illegal component: .
161 161 [255]
162 162
163 163 prepare tampered repo (including the commit above):
164 164
165 165 $ hg import --bypass -qm 'add subrepo "."' - <<'EOF'
166 166 > diff --git a/.hgsub b/.hgsub
167 167 > new file mode 100644
168 168 > --- /dev/null
169 169 > +++ b/.hgsub
170 170 > @@ -0,0 +1,1 @@
171 171 > +.= sub
172 172 > diff --git a/.hgsubstate b/.hgsubstate
173 173 > new file mode 100644
174 174 > --- /dev/null
175 175 > +++ b/.hgsubstate
176 176 > @@ -0,0 +1,1 @@
177 177 > +0000000000000000000000000000000000000000 .
178 178 > EOF
179 179 $ cd ..
180 180
181 181 on clone (and update):
182 182
183 183 $ hg clone -q currentpath currentpath2
184 184 abort: subrepo path contains illegal component: .
185 185 [255]
186 186
187 187 Test outer path
188 188 ---------------
189 189
190 190 on commit:
191 191
192 192 $ mkdir outerpath
193 193 $ cd outerpath
194 194 $ hg init main
195 195 $ cd main
196 196 $ hg init ../sub
197 197 $ echo '../sub = ../sub' >> .hgsub
198 198 $ hg ci -qAm 'add subrepo "../sub"'
199 199 abort: path contains illegal component: ../sub
200 200 [255]
201 201
202 202 prepare tampered repo (including the commit above):
203 203
204 204 $ hg import --bypass -qm 'add subrepo "../sub"' - <<'EOF'
205 205 > diff --git a/.hgsub b/.hgsub
206 206 > new file mode 100644
207 207 > --- /dev/null
208 208 > +++ b/.hgsub
209 209 > @@ -0,0 +1,1 @@
210 210 > +../sub = ../sub
211 211 > diff --git a/.hgsubstate b/.hgsubstate
212 212 > new file mode 100644
213 213 > --- /dev/null
214 214 > +++ b/.hgsubstate
215 215 > @@ -0,0 +1,1 @@
216 216 > +0000000000000000000000000000000000000000 ../sub
217 217 > EOF
218 218 $ cd ..
219 219
220 220 on clone (and update):
221 221
222 222 $ hg clone -q main main2
223 223 abort: path contains illegal component: ../sub
224 224 [255]
225 225 $ cd ..
226 226
227 227 Test variable expansion
228 228 -----------------------
229 229
230 230 Subrepository paths shouldn't be expanded, but we fail to handle them
231 231 properly. Any local repository paths are expanded.
232 232
233 233 on commit:
234 234
235 235 $ mkdir envvar
236 236 $ cd envvar
237 237 $ hg init main
238 238 $ cd main
239 239 $ hg init sub1
240 240 $ cat <<'EOF' > sub1/hgrc
241 241 > [hooks]
242 242 > log = echo pwned
243 243 > EOF
244 244 $ hg -R sub1 ci -qAm 'add sub1 files'
245 245 $ hg -R sub1 log -r. -T '{node}\n'
246 246 39eb4b4d3e096527668784893a9280578a8f38b8
247 247 $ echo '$SUB = sub1' >> .hgsub
248 248 $ SUB=sub1 hg ci -qAm 'add subrepo "$SUB"'
249 249 abort: subrepo path contains illegal component: $SUB
250 250 [255]
251 251
252 252 prepare tampered repo (including the changes above as two commits):
253 253
254 254 $ hg import --bypass -qm 'add subrepo "$SUB"' - <<'EOF'
255 255 > diff --git a/.hgsub b/.hgsub
256 256 > new file mode 100644
257 257 > --- /dev/null
258 258 > +++ b/.hgsub
259 259 > @@ -0,0 +1,1 @@
260 260 > +$SUB = sub1
261 261 > diff --git a/.hgsubstate b/.hgsubstate
262 262 > new file mode 100644
263 263 > --- /dev/null
264 264 > +++ b/.hgsubstate
265 265 > @@ -0,0 +1,1 @@
266 266 > +0000000000000000000000000000000000000000 $SUB
267 267 > EOF
268 268 $ hg debugsetparents 0
269 269 $ hg import --bypass -qm 'update subrepo "$SUB"' - <<'EOF'
270 270 > diff --git a/.hgsubstate b/.hgsubstate
271 271 > --- a/.hgsubstate
272 272 > +++ b/.hgsubstate
273 273 > @@ -1,1 +1,1 @@
274 274 > -0000000000000000000000000000000000000000 $SUB
275 275 > +39eb4b4d3e096527668784893a9280578a8f38b8 $SUB
276 276 > EOF
277 277 $ cd ..
278 278
279 279 on clone (and update) with various substitutions:
280 280
281 281 $ hg clone -q main main2
282 282 abort: subrepo path contains illegal component: $SUB
283 283 [255]
284 284 $ ls main2
285 285
286 286 $ SUB=sub1 hg clone -q main main3
287 287 abort: subrepo path contains illegal component: $SUB
288 288 [255]
289 289 $ ls main3
290 290
291 291 $ SUB=sub2 hg clone -q main main4
292 292 abort: subrepo path contains illegal component: $SUB
293 293 [255]
294 294 $ ls main4
295 295
296 296 on clone empty subrepo into .hg, then pull (and update), which at least fails:
297 297
298 298 $ SUB=.hg hg clone -qr0 main main5
299 299 abort: subrepo path contains illegal component: $SUB
300 300 [255]
301 301 $ ls main5
302 302 $ test -d main5/.hg/.hg
303 303 [1]
304 304 $ SUB=.hg hg -R main5 pull -u
305 305 pulling from $TESTTMP/envvar/main
306 306 searching for changes
307 307 adding changesets
308 308 adding manifests
309 309 adding file changes
310 310 added 1 changesets with 1 changes to 1 files
311 311 new changesets 7a2f0e59146f
312 312 .hgsubstate: untracked file differs
313 313 abort: untracked files in working directory differ from files in requested revision
314 314 [255]
315 315 $ cat main5/.hg/hgrc | grep pwned
316 316 [1]
317 317
318 318 on clone (and update) into .hg, which at least fails:
319 319
320 320 $ SUB=.hg hg clone -q main main6
321 321 abort: subrepo path contains illegal component: $SUB
322 322 [255]
323 323 $ ls main6
324 324 $ cat main6/.hg/hgrc | grep pwned
325 325 [1]
326 326
327 327 on clone (and update) into .hg/* subdir:
328 328
329 329 $ SUB=.hg/foo hg clone -q main main7
330 330 abort: subrepo path contains illegal component: $SUB
331 331 [255]
332 332 $ ls main7
333 333 $ test -d main7/.hg/.hg
334 334 [1]
335 335
336 336 on clone (and update) into outer tree:
337 337
338 338 $ SUB=../out-of-tree-write hg clone -q main main8
339 339 abort: subrepo path contains illegal component: $SUB
340 340 [255]
341 341 $ ls main8
342 342
343 343 on clone (and update) into e.g. $HOME, which doesn't work since subrepo paths
344 344 are concatenated prior to variable expansion:
345 345
346 346 $ SUB="$TESTTMP/envvar/fakehome" hg clone -q main main9
347 347 abort: subrepo path contains illegal component: $SUB
348 348 [255]
349 349 $ ls main9 | wc -l
350 350 \s*0 (re)
351 351
352 352 $ ls
353 353 main
354 354 main2
355 355 main3
356 356 main4
357 357 main5
358 358 main6
359 359 main7
360 360 main8
361 361 main9
362 362 $ cd ..
363 363
364 364 Test tilde
365 365 ----------
366 366
367 367 The leading tilde may be expanded to $HOME, but it can be a valid subrepo
368 368 path in theory. However, we want to prohibit it as there might be unsafe
369 369 handling of such paths.
370 370
371 371 on commit:
372 372
373 373 $ hg init tilde
374 374 $ cd tilde
375 375 $ hg init './~'
376 376 $ echo '~ = ~' >> .hgsub
377 377 $ hg ci -qAm 'add subrepo "~"'
378 378 abort: subrepo path contains illegal component: ~
379 379 [255]
380 380
381 381 prepare tampered repo (including the commit above):
382 382
383 383 $ hg import --bypass -qm 'add subrepo "~"' - <<'EOF'
384 384 > diff --git a/.hgsub b/.hgsub
385 385 > new file mode 100644
386 386 > --- /dev/null
387 387 > +++ b/.hgsub
388 388 > @@ -0,0 +1,1 @@
389 389 > +~ = ~
390 390 > diff --git a/.hgsubstate b/.hgsubstate
391 391 > new file mode 100644
392 392 > --- /dev/null
393 393 > +++ b/.hgsubstate
394 394 > @@ -0,0 +1,1 @@
395 395 > +0000000000000000000000000000000000000000 ~
396 396 > EOF
397 397 $ cd ..
398 398
399 399 on clone (and update):
400 400
401 401 $ hg clone -q tilde tilde2
402 402 abort: subrepo path contains illegal component: ~
403 403 [255]
404 404
405 405 Test direct symlink traversal
406 406 -----------------------------
407 407
408 408 #if symlink
409 409
410 410 on commit:
411 411
412 412 $ mkdir hgsymdir
413 413 $ hg init hgsymdir/root
414 414 $ cd hgsymdir/root
415 415 $ ln -s ../out
416 416 $ hg ci -qAm 'add symlink "out"'
417 417 $ hg init ../out
418 418 $ echo 'out = out' >> .hgsub
419 419 $ hg ci -qAm 'add subrepo "out"'
420 420 abort: subrepo 'out' traverses symbolic link
421 421 [255]
422 422
423 423 prepare tampered repo (including the commit above):
424 424
425 425 $ hg import --bypass -qm 'add subrepo "out"' - <<'EOF'
426 426 > diff --git a/.hgsub b/.hgsub
427 427 > new file mode 100644
428 428 > --- /dev/null
429 429 > +++ b/.hgsub
430 430 > @@ -0,0 +1,1 @@
431 431 > +out = out
432 432 > diff --git a/.hgsubstate b/.hgsubstate
433 433 > new file mode 100644
434 434 > --- /dev/null
435 435 > +++ b/.hgsubstate
436 436 > @@ -0,0 +1,1 @@
437 437 > +0000000000000000000000000000000000000000 out
438 438 > EOF
439 439 $ cd ../..
440 440
441 441 on clone (and update):
442 442
443 443 $ mkdir hgsymdir2
444 444 $ hg clone -q hgsymdir/root hgsymdir2/root
445 445 abort: subrepo 'out' traverses symbolic link
446 446 [255]
447 447 $ ls hgsymdir2
448 448 root
449 449
450 450 #endif
451 451
452 452 Test indirect symlink traversal
453 453 -------------------------------
454 454
455 455 #if symlink
456 456
457 457 on commit:
458 458
459 459 $ mkdir hgsymin
460 460 $ hg init hgsymin/root
461 461 $ cd hgsymin/root
462 462 $ ln -s ../out
463 463 $ hg ci -qAm 'add symlink "out"'
464 464 $ mkdir ../out
465 465 $ hg init ../out/sub
466 466 $ echo 'out/sub = out/sub' >> .hgsub
467 467 $ hg ci -qAm 'add subrepo "out/sub"'
468 468 abort: path 'out/sub' traverses symbolic link 'out'
469 469 [255]
470 470
471 471 prepare tampered repo (including the commit above):
472 472
473 473 $ hg import --bypass -qm 'add subrepo "out/sub"' - <<'EOF'
474 474 > diff --git a/.hgsub b/.hgsub
475 475 > new file mode 100644
476 476 > --- /dev/null
477 477 > +++ b/.hgsub
478 478 > @@ -0,0 +1,1 @@
479 479 > +out/sub = out/sub
480 480 > diff --git a/.hgsubstate b/.hgsubstate
481 481 > new file mode 100644
482 482 > --- /dev/null
483 483 > +++ b/.hgsubstate
484 484 > @@ -0,0 +1,1 @@
485 485 > +0000000000000000000000000000000000000000 out/sub
486 486 > EOF
487 487 $ cd ../..
488 488
489 489 on clone (and update):
490 490
491 491 $ mkdir hgsymin2
492 492 $ hg clone -q hgsymin/root hgsymin2/root
493 493 abort: path 'out/sub' traverses symbolic link 'out'
494 494 [255]
495 495 $ ls hgsymin2
496 496 root
497 497
498 498 #endif
499 499
500 500 Test symlink traversal by variable expansion
501 501 --------------------------------------------
502 502
503 503 #if symlink
504 504
505 505 $ FAKEHOME="$TESTTMP/envvarsym/fakehome"
506 506
507 507 on commit:
508 508
509 509 $ mkdir envvarsym
510 510 $ cd envvarsym
511 511 $ hg init main
512 512 $ cd main
513 513 $ ln -s "`echo "$FAKEHOME" | sed 's|\(.\)/.*|\1|'`"
514 514 $ hg ci -qAm 'add symlink to top-level system directory'
515 515
516 516 $ hg init sub1
517 517 $ echo pwned > sub1/pwned
518 518 $ hg -R sub1 ci -qAm 'add sub1 files'
519 519 $ hg -R sub1 log -r. -T '{node}\n'
520 520 f40c9134ba1b6961e12f250868823f0092fb68a8
521 521 $ echo '$SUB = sub1' >> .hgsub
522 522 $ SUB="$FAKEHOME" hg ci -qAm 'add subrepo "$SUB"'
523 523 abort: subrepo path contains illegal component: $SUB
524 524 [255]
525 525
526 526 prepare tampered repo (including the changes above as two commits):
527 527
528 528 $ hg import --bypass -qm 'add subrepo "$SUB"' - <<'EOF'
529 529 > diff --git a/.hgsub b/.hgsub
530 530 > new file mode 100644
531 531 > --- /dev/null
532 532 > +++ b/.hgsub
533 533 > @@ -0,0 +1,1 @@
534 534 > +$SUB = sub1
535 535 > diff --git a/.hgsubstate b/.hgsubstate
536 536 > new file mode 100644
537 537 > --- /dev/null
538 538 > +++ b/.hgsubstate
539 539 > @@ -0,0 +1,1 @@
540 540 > +0000000000000000000000000000000000000000 $SUB
541 541 > EOF
542 542 $ hg debugsetparents 1
543 543 $ hg import --bypass -qm 'update subrepo "$SUB"' - <<'EOF'
544 544 > diff --git a/.hgsubstate b/.hgsubstate
545 545 > --- a/.hgsubstate
546 546 > +++ b/.hgsubstate
547 547 > @@ -1,1 +1,1 @@
548 548 > -0000000000000000000000000000000000000000 $SUB
549 549 > +f40c9134ba1b6961e12f250868823f0092fb68a8 $SUB
550 550 > EOF
551 551 $ cd ..
552 552
553 553 on clone (and update) without fakehome directory:
554 554
555 555 $ rm -fR "$FAKEHOME"
556 556 $ SUB="$FAKEHOME" hg clone -q main main2
557 557 abort: subrepo path contains illegal component: $SUB
558 558 [255]
559 559 $ test -d "$FAKEHOME"
560 560 [1]
561 561
562 562 on clone (and update) with empty fakehome directory:
563 563
564 564 $ rm -fR "$FAKEHOME"
565 565 $ mkdir "$FAKEHOME"
566 566 $ SUB="$FAKEHOME" hg clone -q main main3
567 567 abort: subrepo path contains illegal component: $SUB
568 568 [255]
569 569 $ ls "$FAKEHOME"
570 570
571 571 on clone (and update) with non-empty fakehome directory:
572 572
573 573 $ rm -fR "$FAKEHOME"
574 574 $ mkdir "$FAKEHOME"
575 575 $ touch "$FAKEHOME/a"
576 576 $ SUB="$FAKEHOME" hg clone -q main main4
577 577 abort: subrepo path contains illegal component: $SUB
578 578 [255]
579 579 $ ls "$FAKEHOME"
580 580 a
581 581
582 582 on clone empty subrepo with non-empty fakehome directory,
583 583 then pull (and update):
584 584
585 585 $ rm -fR "$FAKEHOME"
586 586 $ mkdir "$FAKEHOME"
587 587 $ touch "$FAKEHOME/a"
588 588 $ SUB="$FAKEHOME" hg clone -qr1 main main5
589 589 abort: subrepo path contains illegal component: $SUB
590 590 [255]
591 591 $ ls "$FAKEHOME"
592 592 a
593 593 $ test -d "$FAKEHOME/.hg"
594 594 [1]
595 595 $ SUB="$FAKEHOME" hg -R main5 pull -u
596 596 pulling from $TESTTMP/envvarsym/main
597 597 searching for changes
598 598 adding changesets
599 599 adding manifests
600 600 adding file changes
601 601 added 1 changesets with 1 changes to 1 files
602 602 new changesets * (glob)
603 603 .hgsubstate: untracked file differs
604 604 abort: untracked files in working directory differ from files in requested revision
605 605 [255]
606 606 $ ls "$FAKEHOME"
607 607 a
608 608 $ test -d "$FAKEHOME/.hg"
609 609 [1]
610 610
611 611 on clone empty subrepo with hg-managed fakehome directory,
612 612 then pull (and update):
613 613
614 614 $ rm -fR "$FAKEHOME"
615 615 $ hg init "$FAKEHOME"
616 616 $ touch "$FAKEHOME/a"
617 617 $ hg -R "$FAKEHOME" ci -qAm 'add fakehome file'
618 618 $ SUB="$FAKEHOME" hg clone -qr1 main main6
619 619 abort: subrepo path contains illegal component: $SUB
620 620 [255]
621 621 $ ls "$FAKEHOME"
622 622 a
623 623 $ SUB="$FAKEHOME" hg -R main6 pull -u
624 624 pulling from $TESTTMP/envvarsym/main
625 625 searching for changes
626 626 adding changesets
627 627 adding manifests
628 628 adding file changes
629 629 added 1 changesets with 1 changes to 1 files
630 630 new changesets * (glob)
631 631 .hgsubstate: untracked file differs
632 632 abort: untracked files in working directory differ from files in requested revision
633 633 [255]
634 634 $ ls "$FAKEHOME"
635 635 a
636 636
637 637 on clone only symlink with hg-managed fakehome directory,
638 638 then pull (and update):
639 639
640 640 $ rm -fR "$FAKEHOME"
641 641 $ hg init "$FAKEHOME"
642 642 $ touch "$FAKEHOME/a"
643 643 $ hg -R "$FAKEHOME" ci -qAm 'add fakehome file'
644 644 $ SUB="$FAKEHOME" hg clone -qr0 main main7
645 645 $ ls "$FAKEHOME"
646 646 a
647 647 $ SUB="$FAKEHOME" hg -R main7 pull -uf
648 648 pulling from $TESTTMP/envvarsym/main
649 649 searching for changes
650 650 adding changesets
651 651 adding manifests
652 652 adding file changes
653 653 added 2 changesets with 3 changes to 2 files
654 654 new changesets * (glob)
655 655 abort: subrepo path contains illegal component: $SUB
656 656 [255]
657 657 $ ls "$FAKEHOME"
658 658 a
659 659
660 660 $ cd ..
661 661
662 662 #endif
663
664 Test drive letter
665 -----------------
666
667 Windows has a weird relative path that can change the drive letter, which
668 should also be prohibited on Windows.
669
670 prepare tampered repo:
671
672 $ hg init driveletter
673 $ cd driveletter
674 $ hg import --bypass -qm 'add subrepo "X:"' - <<'EOF'
675 > diff --git a/.hgsub b/.hgsub
676 > new file mode 100644
677 > --- /dev/null
678 > +++ b/.hgsub
679 > @@ -0,0 +1,1 @@
680 > +X: = foo
681 > diff --git a/.hgsubstate b/.hgsubstate
682 > new file mode 100644
683 > --- /dev/null
684 > +++ b/.hgsubstate
685 > @@ -0,0 +1,1 @@
686 > +0000000000000000000000000000000000000000 X:
687 > EOF
688 $ cd ..
689
690 on clone (and update):
691
692 #if windows
693
694 $ hg clone -q driveletter driveletter2
695 abort: path contains illegal component: X:
696
697 #else
698
699 $ hg clone -q driveletter driveletter2
700 $ ls driveletter2
701 X:
702
703 #endif
General Comments 0
You need to be logged in to leave comments. Login now