tests/test-rebase-detach.t
changeset 14121 012c719103ab
parent 13021 6c800e7ef2f6
child 15132 81f76098211e
equal deleted inserted replaced
14120:d7f80dbbaf49 14121:012c719103ab
     8   > EOF
     8   > EOF
     9 
     9 
    10 
    10 
    11   $ hg init a
    11   $ hg init a
    12   $ cd a
    12   $ cd a
    13 
    13   $ hg unbundle $TESTDIR/bundles/rebase.hg
    14   $ echo A > A
    14   adding changesets
    15   $ hg ci -Am A
    15   adding manifests
    16   adding A
    16   adding file changes
    17 
    17   added 8 changesets with 7 changes to 7 files (+2 heads)
    18   $ echo B > B
    18   (run 'hg heads' to see heads, 'hg merge' to merge)
    19   $ hg ci -Am B
    19   $ hg up tip
    20   adding B
    20   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
    21 
    21 
    22   $ echo C > C
    22   $ cd ..
    23   $ hg ci -Am C
    23 
    24   adding C
    24 
    25 
    25 Rebasing D onto H detaching from C:
    26   $ echo D > D
       
    27   $ hg ci -Am D
       
    28   adding D
       
    29 
       
    30   $ hg up -q -C 0
       
    31 
       
    32   $ echo E > E
       
    33   $ hg ci -Am E
       
    34   adding E
       
    35   created new head
       
    36 
       
    37   $ cd ..
       
    38 
       
    39 
       
    40 Rebasing D onto E detaching from C:
       
    41 
    26 
    42   $ hg clone -q -u . a a1
    27   $ hg clone -q -u . a a1
    43   $ cd a1
    28   $ cd a1
    44 
    29 
    45   $ hg tglog
    30   $ hg tglog
    46   @  4: 'E'
    31   @  7: 'H'
    47   |
    32   |
    48   | o  3: 'D'
    33   | o  6: 'G'
    49   | |
    34   |/|
    50   | o  2: 'C'
    35   o |  5: 'F'
    51   | |
    36   | |
    52   | o  1: 'B'
    37   | o  4: 'E'
    53   |/
    38   |/
    54   o  0: 'A'
    39   | o  3: 'D'
    55   
    40   | |
    56   $ hg rebase --detach -s 3 -d 4
    41   | o  2: 'C'
       
    42   | |
       
    43   | o  1: 'B'
       
    44   |/
       
    45   o  0: 'A'
       
    46   
       
    47   $ hg rebase --detach -s 3 -d 7
    57   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
    48   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
    58 
    49 
    59   $ hg tglog
    50   $ hg tglog
    60   @  4: 'D'
    51   @  7: 'D'
    61   |
    52   |
    62   o  3: 'E'
    53   o  6: 'H'
    63   |
    54   |
    64   | o  2: 'C'
    55   | o  5: 'G'
    65   | |
    56   |/|
    66   | o  1: 'B'
    57   o |  4: 'F'
    67   |/
    58   | |
    68   o  0: 'A'
    59   | o  3: 'E'
    69   
    60   |/
    70   $ hg manifest
    61   | o  2: 'C'
    71   A
    62   | |
    72   D
    63   | o  1: 'B'
    73   E
    64   |/
    74 
    65   o  0: 'A'
    75   $ cd ..
    66   
    76 
    67   $ hg manifest
    77 
    68   A
    78 Rebasing C onto E detaching from B:
    69   D
       
    70   F
       
    71   H
       
    72 
       
    73   $ cd ..
       
    74 
       
    75 
       
    76 Rebasing C onto H detaching from B:
    79 
    77 
    80   $ hg clone -q -u . a a2
    78   $ hg clone -q -u . a a2
    81   $ cd a2
    79   $ cd a2
    82 
    80 
    83   $ hg tglog
    81   $ hg tglog
    84   @  4: 'E'
    82   @  7: 'H'
    85   |
    83   |
    86   | o  3: 'D'
    84   | o  6: 'G'
    87   | |
    85   |/|
    88   | o  2: 'C'
    86   o |  5: 'F'
    89   | |
    87   | |
    90   | o  1: 'B'
    88   | o  4: 'E'
    91   |/
    89   |/
    92   o  0: 'A'
    90   | o  3: 'D'
    93   
    91   | |
    94   $ hg rebase --detach -s 2 -d 4
    92   | o  2: 'C'
       
    93   | |
       
    94   | o  1: 'B'
       
    95   |/
       
    96   o  0: 'A'
       
    97   
       
    98   $ hg rebase --detach -s 2 -d 7
    95   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
    99   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
    96 
   100 
    97   $ hg tglog
   101   $ hg tglog
    98   @  4: 'D'
   102   @  7: 'D'
    99   |
   103   |
   100   o  3: 'C'
   104   o  6: 'C'
   101   |
   105   |
   102   o  2: 'E'
   106   o  5: 'H'
   103   |
   107   |
       
   108   | o  4: 'G'
       
   109   |/|
       
   110   o |  3: 'F'
       
   111   | |
       
   112   | o  2: 'E'
       
   113   |/
   104   | o  1: 'B'
   114   | o  1: 'B'
   105   |/
   115   |/
   106   o  0: 'A'
   116   o  0: 'A'
   107   
   117   
   108   $ hg manifest
   118   $ hg manifest
   109   A
   119   A
   110   C
   120   C
   111   D
   121   D
   112   E
   122   F
   113 
   123   H
   114   $ cd ..
   124 
   115 
   125   $ cd ..
   116 
   126 
   117 Rebasing B onto E using detach (same as not using it):
   127 
       
   128 Rebasing B onto H using detach (same as not using it):
   118 
   129 
   119   $ hg clone -q -u . a a3
   130   $ hg clone -q -u . a a3
   120   $ cd a3
   131   $ cd a3
   121 
   132 
   122   $ hg tglog
   133   $ hg tglog
   123   @  4: 'E'
   134   @  7: 'H'
   124   |
   135   |
   125   | o  3: 'D'
   136   | o  6: 'G'
   126   | |
   137   |/|
   127   | o  2: 'C'
   138   o |  5: 'F'
   128   | |
   139   | |
   129   | o  1: 'B'
   140   | o  4: 'E'
   130   |/
   141   |/
   131   o  0: 'A'
   142   | o  3: 'D'
   132   
   143   | |
   133   $ hg rebase --detach -s 1 -d 4
   144   | o  2: 'C'
       
   145   | |
       
   146   | o  1: 'B'
       
   147   |/
       
   148   o  0: 'A'
       
   149   
       
   150   $ hg rebase --detach -s 1 -d 7
   134   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
   151   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
   135 
   152 
   136   $ hg tglog
   153   $ hg tglog
   137   @  4: 'D'
   154   @  7: 'D'
   138   |
   155   |
   139   o  3: 'C'
   156   o  6: 'C'
   140   |
   157   |
   141   o  2: 'B'
   158   o  5: 'B'
   142   |
   159   |
   143   o  1: 'E'
   160   o  4: 'H'
   144   |
   161   |
       
   162   | o  3: 'G'
       
   163   |/|
       
   164   o |  2: 'F'
       
   165   | |
       
   166   | o  1: 'E'
       
   167   |/
   145   o  0: 'A'
   168   o  0: 'A'
   146   
   169   
   147   $ hg manifest
   170   $ hg manifest
   148   A
   171   A
   149   B
   172   B
   150   C
   173   C
   151   D
   174   D
   152   E
   175   F
   153 
   176   H
   154   $ cd ..
   177 
   155 
   178   $ cd ..
   156 
   179 
   157 Rebasing C onto E detaching from B and collapsing:
   180 
       
   181 Rebasing C onto H detaching from B and collapsing:
   158 
   182 
   159   $ hg clone -q -u . a a4
   183   $ hg clone -q -u . a a4
   160   $ cd a4
   184   $ cd a4
   161 
   185 
   162   $ hg tglog
   186   $ hg tglog
   163   @  4: 'E'
   187   @  7: 'H'
   164   |
   188   |
   165   | o  3: 'D'
   189   | o  6: 'G'
   166   | |
   190   |/|
   167   | o  2: 'C'
   191   o |  5: 'F'
   168   | |
   192   | |
   169   | o  1: 'B'
   193   | o  4: 'E'
   170   |/
   194   |/
   171   o  0: 'A'
   195   | o  3: 'D'
   172   
   196   | |
   173   $ hg rebase --detach --collapse -s 2 -d 4
   197   | o  2: 'C'
       
   198   | |
       
   199   | o  1: 'B'
       
   200   |/
       
   201   o  0: 'A'
       
   202   
       
   203   $ hg rebase --detach --collapse -s 2 -d 7
   174   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
   204   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
   175 
   205 
   176   $ hg tglog
   206   $ hg tglog
   177   @  3: 'Collapsed revision
   207   @  6: 'Collapsed revision
   178   |  * C
   208   |  * C
   179   |  * D'
   209   |  * D'
   180   o  2: 'E'
   210   o  5: 'H'
   181   |
   211   |
       
   212   | o  4: 'G'
       
   213   |/|
       
   214   o |  3: 'F'
       
   215   | |
       
   216   | o  2: 'E'
       
   217   |/
   182   | o  1: 'B'
   218   | o  1: 'B'
   183   |/
   219   |/
   184   o  0: 'A'
   220   o  0: 'A'
   185   
   221   
   186   $ hg manifest
   222   $ hg manifest
   187   A
   223   A
   188   C
   224   C
   189   D
   225   D
   190   E
   226   F
       
   227   H
   191 
   228 
   192   $ cd ..
   229   $ cd ..
   193 
   230 
   194 Rebasing across null as ancestor
   231 Rebasing across null as ancestor
   195   $ hg clone -q -U a a5
   232   $ hg clone -q -U a a5
   202 
   239 
   203   $ hg ci -m "extra branch"
   240   $ hg ci -m "extra branch"
   204   created new head
   241   created new head
   205 
   242 
   206   $ hg tglog
   243   $ hg tglog
   207   @  5: 'extra branch'
   244   @  8: 'extra branch'
   208   
   245   
   209   o  4: 'E'
   246   o  7: 'H'
   210   |
   247   |
       
   248   | o  6: 'G'
       
   249   |/|
       
   250   o |  5: 'F'
       
   251   | |
       
   252   | o  4: 'E'
       
   253   |/
   211   | o  3: 'D'
   254   | o  3: 'D'
   212   | |
   255   | |
   213   | o  2: 'C'
   256   | o  2: 'C'
   214   | |
   257   | |
   215   | o  1: 'B'
   258   | o  1: 'B'
   218   
   261   
   219   $ hg rebase --detach -s 1 -d tip
   262   $ hg rebase --detach -s 1 -d tip
   220   saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
   263   saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
   221 
   264 
   222   $ hg tglog
   265   $ hg tglog
   223   @  5: 'D'
   266   @  8: 'D'
   224   |
   267   |
   225   o  4: 'C'
   268   o  7: 'C'
   226   |
   269   |
   227   o  3: 'B'
   270   o  6: 'B'
   228   |
   271   |
   229   o  2: 'extra branch'
   272   o  5: 'extra branch'
   230   
   273   
   231   o  1: 'E'
   274   o  4: 'H'
   232   |
   275   |
   233   o  0: 'A'
   276   | o  3: 'G'
   234   
   277   |/|
       
   278   o |  2: 'F'
       
   279   | |
       
   280   | o  1: 'E'
       
   281   |/
       
   282   o  0: 'A'
       
   283