tests/test-subrepo-deep-nested-change.t
changeset 11913 628cdd158ec0
parent 11110 22f5ad0b5857
child 12107 497c78760b37
equal deleted inserted replaced
11912:69678985bdba 11913:628cdd158ec0
       
     1 Preparing the subrepository 'sub2'
       
     2 
       
     3   $ hg init sub2
       
     4   $ echo sub2 > sub2/sub2
       
     5   $ hg add -R sub2
       
     6   adding sub2/sub2
       
     7   $ hg commit -R sub2 -m "sub2 import"
       
     8 
       
     9 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
       
    10 
       
    11   $ hg init sub1
       
    12   $ echo sub1 > sub1/sub1
       
    13   $ echo "sub2 = ../sub2" > sub1/.hgsub
       
    14   $ hg clone sub2 sub1/sub2 | sed 's/ .*sub/ ...sub/g'
       
    15   updating to branch default
       
    16   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    17   $ hg add -R sub1
       
    18   adding sub1/.hgsub
       
    19   adding sub1/sub1
       
    20   $ hg commit -R sub1 -m "sub1 import"
       
    21   committing subrepository sub2
       
    22 
       
    23 Preparing the 'main' repo which depends on the subrepo 'sub1'
       
    24 
       
    25   $ hg init main
       
    26   $ echo main > main/main
       
    27   $ echo "sub1 = ../sub1" > main/.hgsub
       
    28   $ hg clone sub1 main/sub1  | sed 's/ .*sub/ ...sub/g'
       
    29   updating to branch default
       
    30   pulling ...sub2
       
    31   requesting all changes
       
    32   adding changesets
       
    33   adding manifests
       
    34   adding file changes
       
    35   added 1 changesets with 1 changes to 1 files
       
    36   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    37   $ hg add -R main
       
    38   adding main/.hgsub
       
    39   adding main/main
       
    40   $ hg commit -R main -m "main import"
       
    41   committing subrepository sub1
       
    42 
       
    43 Cleaning both repositories, just as a clone -U
       
    44 
       
    45   $ hg up -C -R sub2 null
       
    46   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    47   $ hg up -C -R sub1 null
       
    48   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
    49   $ hg up -C -R main null
       
    50   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
    51   $ rm -rf main/sub1
       
    52   $ rm -rf sub1/sub2
       
    53 
       
    54 Clone main
       
    55 
       
    56   $ hg clone main cloned | sed 's/ .*sub/ ...sub/g' 
       
    57   updating to branch default
       
    58   pulling ...sub1
       
    59   requesting all changes
       
    60   adding changesets
       
    61   adding manifests
       
    62   adding file changes
       
    63   added 1 changesets with 3 changes to 3 files
       
    64   pulling ...sub2
       
    65   requesting all changes
       
    66   adding changesets
       
    67   adding manifests
       
    68   adding file changes
       
    69   added 1 changesets with 1 changes to 1 files
       
    70   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    71 
       
    72 Checking cloned repo ids
       
    73 
       
    74   $ printf "cloned " ; hg id -R cloned
       
    75   cloned 7f491f53a367 tip
       
    76   $ printf "cloned/sub1 " ; hg id -R cloned/sub1
       
    77   cloned/sub1 fc3b4ce2696f tip
       
    78   $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
       
    79   cloned/sub1/sub2 c57a0840e3ba tip
       
    80 
       
    81 debugsub output for main and sub1
       
    82 
       
    83   $ hg debugsub -R cloned
       
    84   path sub1
       
    85    source   ../sub1
       
    86    revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
       
    87   $ hg debugsub -R cloned/sub1
       
    88   path sub2
       
    89    source   ../sub2
       
    90    revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
       
    91 
       
    92 Modifying deeply nested 'sub2'
       
    93 
       
    94   $ echo modified > cloned/sub1/sub2/sub2
       
    95   $ hg commit -m "deep nested modif should trigger a commit" -R cloned
       
    96   committing subrepository sub1
       
    97   committing subrepository sub1/sub2
       
    98 
       
    99 Checking modified node ids
       
   100 
       
   101   $ printf "cloned " ; hg id -R cloned
       
   102   cloned ffe6649062fe tip
       
   103   $ printf "cloned/sub1 " ; hg id -R cloned/sub1
       
   104   cloned/sub1 2ecb03bf44a9 tip
       
   105   $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
       
   106   cloned/sub1/sub2 53dd3430bcaf tip
       
   107 
       
   108 debugsub output for main and sub1
       
   109 
       
   110   $ hg debugsub -R cloned
       
   111   path sub1
       
   112    source   ../sub1
       
   113    revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
       
   114   $ hg debugsub -R cloned/sub1
       
   115   path sub2
       
   116    source   ../sub2
       
   117    revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
       
   118 
       
   119   $ exit 0