Show More
@@ -1392,6 +1392,7 b' class gitsubrepo(abstractsubrepo):' | |||||
1392 | if tracking[remote] != self._gitcurrentbranch(): |
|
1392 | if tracking[remote] != self._gitcurrentbranch(): | |
1393 | checkout([tracking[remote]]) |
|
1393 | checkout([tracking[remote]]) | |
1394 | self._gitcommand(['merge', '--ff', remote]) |
|
1394 | self._gitcommand(['merge', '--ff', remote]) | |
|
1395 | _sanitize(self._ui, self._path) | |||
1395 | else: |
|
1396 | else: | |
1396 | # a real merge would be required, just checkout the revision |
|
1397 | # a real merge would be required, just checkout the revision | |
1397 | rawcheckout() |
|
1398 | rawcheckout() |
@@ -608,3 +608,52 b' Test sanitizing ".hg/hgrc" in subrepo' | |||||
608 | cat: s/sub/.hg/hgrc: No such file or directory |
|
608 | cat: s/sub/.hg/hgrc: No such file or directory | |
609 | [1] |
|
609 | [1] | |
610 | $ cd .. |
|
610 | $ cd .. | |
|
611 | ||||
|
612 | additional test for "git merge --ff" route: | |||
|
613 | ||||
|
614 | $ cd t | |||
|
615 | $ hg tip -q | |||
|
616 | 8:3473d20bddcf | |||
|
617 | $ hg update -q -C af6d2edbb0d3 | |||
|
618 | $ cd s | |||
|
619 | $ git checkout -q testing | |||
|
620 | $ mkdir .hg | |||
|
621 | $ echo '.hg/hgrc in git repo' > .hg/hgrc | |||
|
622 | $ mkdir -p sub/.hg | |||
|
623 | $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc | |||
|
624 | $ git add .hg sub | |||
|
625 | $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)' | |||
|
626 | $ git push -q origin testing | |||
|
627 | $ cd .. | |||
|
628 | $ grep ' s$' .hgsubstate | |||
|
629 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc s | |||
|
630 | $ hg commit -qm 'commit with git revision including .hg/hgrc' | |||
|
631 | $ hg parents -q | |||
|
632 | 9:ed23f7fe024e | |||
|
633 | $ grep ' s$' .hgsubstate | |||
|
634 | f262643c1077219fbd3858d54e78ef050ef84fbf s | |||
|
635 | $ cd .. | |||
|
636 | ||||
|
637 | $ cd tc | |||
|
638 | $ hg update -q -C af6d2edbb0d3 | |||
|
639 | $ cat s/.hg/hgrc | |||
|
640 | cat: s/.hg/hgrc: No such file or directory | |||
|
641 | [1] | |||
|
642 | $ cat s/sub/.hg/hgrc | |||
|
643 | cat: s/sub/.hg/hgrc: No such file or directory | |||
|
644 | [1] | |||
|
645 | $ hg pull -q | |||
|
646 | $ hg update -q -C ed23f7fe024e 2>&1 | sort | |||
|
647 | warning: removing potentially hostile 'hgrc' in 's/.hg' (glob) | |||
|
648 | warning: removing potentially hostile 'hgrc' in 's/sub/.hg' (glob) | |||
|
649 | $ hg parents -q | |||
|
650 | 9:ed23f7fe024e | |||
|
651 | $ grep ' s$' .hgsubstate | |||
|
652 | f262643c1077219fbd3858d54e78ef050ef84fbf s | |||
|
653 | $ cat s/.hg/hgrc | |||
|
654 | cat: s/.hg/hgrc: No such file or directory | |||
|
655 | [1] | |||
|
656 | $ cat s/sub/.hg/hgrc | |||
|
657 | cat: s/sub/.hg/hgrc: No such file or directory | |||
|
658 | [1] | |||
|
659 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now