remote-hg: add tests for special filenames

So that we check that UTF-8 and spaces work fine. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Dec 7, 2013 at 07:09 UTC 8d784daebf6cf6e0f0d6125e53190d2501484482
1 file changed +68
contrib/remote-helpers/test-hg.sh
+68
@@ -444,6 +444,74 @@ test_expect_success 'remote new bookmark multiple branch head' '
444 # cleanup previous stuff
445 rm -rf hgrepo
446
447 +test_expect_success 'fetch special filenames' '
448 + test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
449 +
450 + LC_ALL=en_US.UTF-8
451 + export LC_ALL
452 +
453 + (
454 + hg init hgrepo &&
455 + cd hgrepo &&
456 +
457 + echo test >> "æ rø" &&
458 + hg add "æ rø" &&
459 + echo test >> "ø~?" &&
460 + hg add "ø~?" &&
461 + hg commit -m add-utf-8 &&
462 + echo test >> "æ rø" &&
463 + hg commit -m test-utf-8 &&
464 + hg rm "ø~?" &&
465 + hg mv "æ rø" "ø~?" &&
466 + hg commit -m hg-mv-utf-8
467 + ) &&
468 +
469 + (
470 + git clone "hg::hgrepo" gitrepo &&
471 + cd gitrepo &&
472 + git -c core.quotepath=false ls-files > ../actual
473 + ) &&
474 + echo "ø~?" > expected &&
475 + test_cmp expected actual
476 +'
477 +
478 +test_expect_success 'push special filenames' '
479 + test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
480 +
481 + mkdir -p tmp && cd tmp &&
482 +
483 + LC_ALL=en_US.UTF-8
484 + export LC_ALL
485 +
486 + (
487 + hg init hgrepo &&
488 + cd hgrepo &&
489 +
490 + echo one >> content &&
491 + hg add content &&
492 + hg commit -m one
493 + ) &&
494 +
495 + (
496 + git clone "hg::hgrepo" gitrepo &&
497 + cd gitrepo &&
498 +
499 + echo test >> "æ rø" &&
500 + git add "æ rø" &&
501 + git commit -m utf-8 &&
502 +
503 + git push
504 + ) &&
505 +
506 + (cd hgrepo &&
507 + hg update &&
508 + hg manifest > ../actual
509 + ) &&
510 +
511 + printf "content\næ rø\n" > expected &&
512 + test_cmp expected actual
513 +'
514 +
515 setup_big_push () {
516 (
517 hg init hgrepo &&