tests/test-rebase-collapse
changeset 7278 45495d784ad6
parent 6910 93609576244e
child 8168 8766fee6f225
equal deleted inserted replaced
7277:3e000e2bf5f6 7278:45495d784ad6
    39     addcommit "H" 7
    39     addcommit "H" 7
    40 }
    40 }
    41 
    41 
    42 createrepo > /dev/null 2>&1
    42 createrepo > /dev/null 2>&1
    43 hg glog  --template '{rev}: {desc}\n'
    43 hg glog  --template '{rev}: {desc}\n'
    44 echo '% Rebasing'
    44 echo '% Rebasing B onto H'
    45 hg up -C 3
    45 hg up -C 3
    46 hg rebase --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
    46 hg rebase --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
    47 hg glog  --template '{rev}: {desc}\n'
    47 hg glog  --template '{rev}: {desc}\n'
       
    48 echo "Expected A, B, C, D, F, H"
       
    49 hg manifest
    48 
    50 
    49 createrepo > /dev/null 2>&1
    51 createrepo > /dev/null 2>&1
    50 echo '% Rebasing'
    52 echo
       
    53 echo '% Rebasing G onto H'
    51 hg rebase --base 6 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
    54 hg rebase --base 6 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
    52 hg glog  --template '{rev}: {desc}\n'
    55 hg glog  --template '{rev}: {desc}\n'
       
    56 echo "Expected A, E, F, H"
       
    57 hg manifest
    53 
    58 
    54 createrepocomplex () {
    59 createrepocomplex () {
    55     cd $BASE
    60     cd $BASE
    56     rm -rf a
    61     rm -rf a
    57     hg init a
    62     hg init a
    74 
    79 
    75     hg up 0
    80     hg up 0
    76     addcommit "H" 7
    81     addcommit "H" 7
    77 }
    82 }
    78 
    83 
       
    84 echo
    79 createrepocomplex > /dev/null 2>&1
    85 createrepocomplex > /dev/null 2>&1
    80 hg glog  --template '{rev}: {desc}\n'
    86 hg glog  --template '{rev}: {desc}\n'
    81 
    87 
    82 echo
    88 echo
    83 echo '% Rebase and collapse - more than one external (fail)'
    89 echo '% Rebase and collapse - more than one external (fail)'
    84 hg rebase -s 2 --collapse
    90 hg rebase -s 2 --collapse
    85 
    91 
    86 echo
    92 echo
    87 echo '% Rebase and collapse'
    93 echo '% Rebase and collapse - E onto H'
    88 hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
    94 hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
    89 hg glog  --template '{rev}: {desc}\n'
    95 hg glog  --template '{rev}: {desc}\n'
       
    96 echo "Expected A, B, C, E, F, H"
       
    97 hg manifest
    90 
    98 
       
    99 createrepocomplex () {
       
   100     cd $BASE
       
   101     rm -rf a
       
   102     hg init a
       
   103     cd a
       
   104     addcommit "A" 0
       
   105     addcommit "B" 1
       
   106 
       
   107     hg up 0
       
   108     addcommit "C" 2
       
   109     hg merge
       
   110     commit "D" 3
       
   111 
       
   112     hg up 1
       
   113     addcommit "E" 4
       
   114     
       
   115     echo "F" > E
       
   116     commit "F" 5
       
   117 
       
   118     addcommit "G" 6
       
   119 
       
   120     hg merge
       
   121     commit "H" 7
       
   122 
       
   123     hg up 0
       
   124     addcommit "I" 8
       
   125 }
       
   126 
       
   127 echo
       
   128 createrepocomplex > /dev/null 2>&1
       
   129 hg glog  --template '{rev}: {desc}\n'
       
   130 
       
   131 echo
       
   132 echo '% Rebase and collapse - E onto I'
       
   133 hg rebase -s 4 --collapse 
       
   134 
       
   135 echo '% Fix conflict and continue'
       
   136 echo 'Resolved merge' > E
       
   137 hg resolve -m E
       
   138 hg rebase -c 2>&1 | sed 's/\(saving bundle to \).*/\1/'
       
   139 
       
   140 hg glog  --template '{rev}: {desc}\n'
       
   141 
       
   142 echo "Expected A, B, C, E, G, I"
       
   143 hg manifest
       
   144 
       
   145 echo 'Cat E:'
       
   146 cat E
       
   147 
       
   148 createrepocomplex () {
       
   149     cd $BASE
       
   150     rm -rf a
       
   151     hg init a
       
   152     cd a
       
   153     addcommit "A" 0
       
   154     addcommit "B" 1
       
   155 
       
   156     addcommit "C" 2
       
   157     hg up 1
       
   158 
       
   159     addcommit "D" 3
       
   160     
       
   161     hg merge
       
   162     commit "E" 4
       
   163 
       
   164     hg up 0
       
   165     addcommit "F" 5
       
   166 }
       
   167 
       
   168 echo
       
   169 createrepocomplex > /dev/null 2>&1
       
   170 hg glog  --template '{rev}: {desc}\n'
       
   171 
       
   172 echo
       
   173 echo '% Rebase and collapse - B onto F'
       
   174 hg rebase -s 1 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
       
   175 
       
   176 hg glog  --template '{rev}: {desc}\n'
       
   177 
       
   178 echo "Expected A, B, C, D, F"
       
   179 hg manifest
    91 exit 0
   180 exit 0