tests/test-subrepo-git.t
changeset 21585 652e07debf10
parent 21401 2c364f7801c8
parent 21567 5900bc09e684
child 21751 c5699c2d690b
equal deleted inserted replaced
21580:32601b0b74c0 21585:652e07debf10
   564   notafile: * (glob)
   564   notafile: * (glob)
   565   [1]
   565   [1]
   566 #endif
   566 #endif
   567 
   567 
   568   $ cd ..
   568   $ cd ..
       
   569 
       
   570 Test sanitizing ".hg/hgrc" in subrepo
       
   571 
       
   572   $ cd t
       
   573   $ hg tip -q
       
   574   7:af6d2edbb0d3
       
   575   $ hg update -q -C af6d2edbb0d3
       
   576   $ cd s
       
   577   $ git checkout -q -b sanitize-test
       
   578   $ mkdir .hg
       
   579   $ echo '.hg/hgrc in git repo' > .hg/hgrc
       
   580   $ mkdir -p sub/.hg
       
   581   $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
       
   582   $ git add .hg sub
       
   583   $ git commit -qm 'add .hg/hgrc to be sanitized at hg update'
       
   584   $ git push -q origin sanitize-test
       
   585   $ cd ..
       
   586   $ grep ' s$' .hgsubstate
       
   587   32a343883b74769118bb1d3b4b1fbf9156f4dddc s
       
   588   $ hg commit -qm 'commit with git revision including .hg/hgrc'
       
   589   $ hg parents -q
       
   590   8:3473d20bddcf
       
   591   $ grep ' s$' .hgsubstate
       
   592   c4069473b459cf27fd4d7c2f50c4346b4e936599 s
       
   593   $ cd ..
       
   594 
       
   595   $ hg -R tc pull -q
       
   596   $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort
       
   597   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
       
   598   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
       
   599   $ cd tc
       
   600   $ hg parents -q
       
   601   8:3473d20bddcf
       
   602   $ grep ' s$' .hgsubstate
       
   603   c4069473b459cf27fd4d7c2f50c4346b4e936599 s
       
   604   $ cat s/.hg/hgrc
       
   605   cat: s/.hg/hgrc: No such file or directory
       
   606   [1]
       
   607   $ cat s/sub/.hg/hgrc
       
   608   cat: s/sub/.hg/hgrc: No such file or directory
       
   609   [1]
       
   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   $ cd ..
       
   646   $ hg -R tc pull -q
       
   647   $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort
       
   648   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
       
   649   warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
       
   650   $ cd tc
       
   651   $ hg parents -q
       
   652   9:ed23f7fe024e
       
   653   $ grep ' s$' .hgsubstate
       
   654   f262643c1077219fbd3858d54e78ef050ef84fbf s
       
   655   $ cat s/.hg/hgrc
       
   656   cat: s/.hg/hgrc: No such file or directory
       
   657   [1]
       
   658   $ cat s/sub/.hg/hgrc
       
   659   cat: s/sub/.hg/hgrc: No such file or directory
       
   660   [1]
       
   661 
       
   662 Test that sanitizing is omitted in meta data area:
       
   663 
       
   664   $ mkdir s/.git/.hg
       
   665   $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc
       
   666   $ hg update -q -C af6d2edbb0d3
       
   667   checking out detached HEAD in subrepo s
       
   668   check out a git branch if you intend to make changes
       
   669 
       
   670   $ cd ..