tests/test-subrepo-deep-nested-change
changeset 11913 628cdd158ec0
parent 11912 69678985bdba
child 11914 e31e5eb8736c
equal deleted inserted replaced
11912:69678985bdba 11913:628cdd158ec0
     1 #!/bin/sh
       
     2 
       
     3 echo % Preparing the subrepository 'sub2'
       
     4 hg init sub2
       
     5 echo sub2 > sub2/sub2
       
     6 hg add -R sub2
       
     7 hg commit -R sub2 -m "sub2 import"
       
     8 
       
     9 echo % Preparing the 'sub1' repo which depends on the subrepo 'sub2'
       
    10 hg init sub1
       
    11 echo sub1 > sub1/sub1
       
    12 echo "sub2 = ../sub2" > sub1/.hgsub
       
    13 hg clone sub2 sub1/sub2 | sed 's/ .*sub/ ...sub/g'
       
    14 hg add -R sub1
       
    15 hg commit -R sub1 -m "sub1 import"
       
    16 
       
    17 echo % Preparing the 'main' repo which depends on the subrepo 'sub1'
       
    18 hg init main
       
    19 echo main > main/main
       
    20 echo "sub1 = ../sub1" > main/.hgsub
       
    21 hg clone sub1 main/sub1  | sed 's/ .*sub/ ...sub/g'
       
    22 hg add -R main
       
    23 hg commit -R main -m "main import"
       
    24 
       
    25 echo % Cleaning both repositories, just as a clone -U
       
    26 hg up -C -R sub2 null
       
    27 hg up -C -R sub1 null
       
    28 hg up -C -R main null
       
    29 rm -rf main/sub1
       
    30 rm -rf sub1/sub2
       
    31 
       
    32 echo % Clone main
       
    33 hg clone main cloned | sed 's/ .*sub/ ...sub/g' 
       
    34 
       
    35 echo % Checking cloned repo ids
       
    36 printf "cloned " ; hg id -R cloned
       
    37 printf "cloned/sub1 " ; hg id -R cloned/sub1
       
    38 printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
       
    39 
       
    40 echo % debugsub output for main and sub1
       
    41 hg debugsub -R cloned
       
    42 hg debugsub -R cloned/sub1
       
    43 
       
    44 echo % Modifying deeply nested 'sub2'
       
    45 echo modified > cloned/sub1/sub2/sub2
       
    46 hg commit -m "deep nested modif should trigger a commit" -R cloned
       
    47 
       
    48 echo % Checking modified node ids
       
    49 printf "cloned " ; hg id -R cloned
       
    50 printf "cloned/sub1 " ; hg id -R cloned/sub1
       
    51 printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
       
    52 
       
    53 echo % debugsub output for main and sub1
       
    54 hg debugsub -R cloned
       
    55 hg debugsub -R cloned/sub1
       
    56 
       
    57 exit 0