tests/test-rebase-scenario-global.t
changeset 14119 624e5ce615ec
parent 14118 7fd8e597f99c
child 15132 81f76098211e
equal deleted inserted replaced
14118:7fd8e597f99c 14119:624e5ce615ec
    12   $ cd a
    12   $ cd a
    13   $ hg unbundle $TESTDIR/bundles/rebase.hg
    13   $ hg unbundle $TESTDIR/bundles/rebase.hg
    14   adding changesets
    14   adding changesets
    15   adding manifests
    15   adding manifests
    16   adding file changes
    16   adding file changes
    17   added 6 changesets with 5 changes to 5 files (+2 heads)
    17   added 8 changesets with 7 changes to 7 files (+2 heads)
    18   (run 'hg heads' to see heads, 'hg merge' to merge)
    18   (run 'hg heads' to see heads, 'hg merge' to merge)
    19   $ hg up tip
    19   $ hg up tip
    20   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
    20   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
    21   $ cd ..
    21   $ cd ..
    22 
    22 
    23 
    23 
    24 Rebasing
    24 Rebasing
    25 B onto F - simple rebase:
    25 D onto H - simple rebase:
    26 
    26 
    27   $ hg clone -q -u . a a1
    27   $ hg clone -q -u . a a1
    28   $ cd a1
    28   $ cd a1
    29 
    29 
    30   $ hg tglog
    30   $ hg tglog
    31   @  5: 'F'
    31   @  7: 'H'
    32   |
    32   |
       
    33   | o  6: 'G'
       
    34   |/|
       
    35   o |  5: 'F'
       
    36   | |
    33   | o  4: 'E'
    37   | o  4: 'E'
    34   |/|
    38   |/
    35   o |  3: 'D'
    39   | o  3: 'D'
    36   | |
    40   | |
    37   | o  2: 'C'
    41   | o  2: 'C'
    38   |/
    42   | |
    39   | o  1: 'B'
    43   | o  1: 'B'
    40   |/
    44   |/
    41   o  0: 'A'
    45   o  0: 'A'
    42   
    46   
    43   $ hg rebase -s 1 -d 5
    47 
       
    48   $ hg rebase -s 3 -d 7
    44   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
    49   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
    45 
    50 
    46   $ hg tglog
    51   $ hg tglog
    47   @  5: 'B'
    52   @    7: 'D'
    48   |
    53   |\
    49   o  4: 'F'
    54   | o  6: 'H'
    50   |
    55   | |
    51   | o  3: 'E'
    56   | | o  5: 'G'
    52   |/|
    57   | |/|
    53   o |  2: 'D'
    58   | o |  4: 'F'
    54   | |
    59   | | |
    55   | o  1: 'C'
    60   | | o  3: 'E'
    56   |/
    61   | |/
    57   o  0: 'A'
    62   o |  2: 'C'
    58   
    63   | |
    59   $ cd ..
    64   o |  1: 'B'
    60 
    65   |/
    61 
    66   o  0: 'A'
    62 B onto D - intermediate point:
    67   
       
    68   $ cd ..
       
    69 
       
    70 
       
    71 D onto F - intermediate point:
    63 
    72 
    64   $ hg clone -q -u . a a2
    73   $ hg clone -q -u . a a2
    65   $ cd a2
    74   $ cd a2
    66 
    75 
    67   $ hg rebase -s 1 -d 3
    76   $ hg rebase -s 3 -d 5
    68   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
    77   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
    69 
    78 
    70   $ hg tglog
    79   $ hg tglog
    71   @  5: 'B'
    80   @    7: 'D'
    72   |
    81   |\
    73   | o  4: 'F'
    82   | | o  6: 'H'
    74   |/
    83   | |/
    75   | o  3: 'E'
    84   | | o  5: 'G'
    76   |/|
    85   | |/|
    77   o |  2: 'D'
    86   | o |  4: 'F'
    78   | |
    87   | | |
    79   | o  1: 'C'
    88   | | o  3: 'E'
    80   |/
    89   | |/
    81   o  0: 'A'
    90   o |  2: 'C'
    82   
    91   | |
    83   $ cd ..
    92   o |  1: 'B'
    84 
    93   |/
    85 
    94   o  0: 'A'
    86 C onto F - skip of E:
    95   
       
    96   $ cd ..
       
    97 
       
    98 
       
    99 E onto H - skip of G:
    87 
   100 
    88   $ hg clone -q -u . a a3
   101   $ hg clone -q -u . a a3
    89   $ cd a3
   102   $ cd a3
    90 
   103 
    91   $ hg rebase -s 2 -d 5
   104   $ hg rebase -s 4 -d 7
    92   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
   105   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
    93 
   106 
    94   $ hg tglog
   107   $ hg tglog
    95   @  4: 'C'
   108   @  6: 'E'
    96   |
   109   |
    97   o  3: 'F'
   110   o  5: 'H'
    98   |
   111   |
    99   o  2: 'D'
   112   o  4: 'F'
   100   |
   113   |
   101   | o  1: 'B'
   114   | o  3: 'D'
   102   |/
   115   | |
   103   o  0: 'A'
   116   | o  2: 'C'
   104   
   117   | |
   105   $ cd ..
   118   | o  1: 'B'
   106 
   119   |/
   107 
   120   o  0: 'A'
   108 D onto C - rebase of a branching point (skip E):
   121   
       
   122   $ cd ..
       
   123 
       
   124 
       
   125 F onto E - rebase of a branching point (skip G):
   109 
   126 
   110   $ hg clone -q -u . a a4
   127   $ hg clone -q -u . a a4
   111   $ cd a4
   128   $ cd a4
   112 
   129 
   113   $ hg rebase -s 3 -d 2
   130   $ hg rebase -s 5 -d 4
   114   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
   131   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
   115 
   132 
   116   $ hg tglog
   133   $ hg tglog
   117   @  4: 'F'
   134   @  6: 'H'
   118   |
   135   |
   119   o  3: 'D'
   136   o  5: 'F'
   120   |
   137   |
   121   o  2: 'C'
   138   o  4: 'E'
   122   |
   139   |
   123   | o  1: 'B'
   140   | o  3: 'D'
   124   |/
   141   | |
   125   o  0: 'A'
   142   | o  2: 'C'
   126   
   143   | |
   127   $ cd ..
   144   | o  1: 'B'
   128 
   145   |/
   129 
   146   o  0: 'A'
   130 E onto F - merged revision having a parent in ancestors of target:
   147   
       
   148   $ cd ..
       
   149 
       
   150 
       
   151 G onto H - merged revision having a parent in ancestors of target:
   131 
   152 
   132   $ hg clone -q -u . a a5
   153   $ hg clone -q -u . a a5
   133   $ cd a5
   154   $ cd a5
   134 
   155 
   135   $ hg rebase -s 4 -d 5
   156   $ hg rebase -s 6 -d 7
   136   saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
   157   saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
   137 
   158 
   138   $ hg tglog
   159   $ hg tglog
   139   @    5: 'E'
   160   @    7: 'G'
   140   |\
   161   |\
   141   | o  4: 'F'
   162   | o  6: 'H'
   142   | |
   163   | |
   143   | o  3: 'D'
   164   | o  5: 'F'
   144   | |
   165   | |
   145   o |  2: 'C'
   166   o |  4: 'E'
   146   |/
   167   |/
   147   | o  1: 'B'
   168   | o  3: 'D'
   148   |/
   169   | |
   149   o  0: 'A'
   170   | o  2: 'C'
   150   
   171   | |
   151   $ cd ..
   172   | o  1: 'B'
   152 
   173   |/
   153 
   174   o  0: 'A'
   154 D onto B - E maintains C as parent:
   175   
       
   176   $ cd ..
       
   177 
       
   178 
       
   179 F onto B - G maintains E as parent:
   155 
   180 
   156   $ hg clone -q -u . a a6
   181   $ hg clone -q -u . a a6
   157   $ cd a6
   182   $ cd a6
   158 
   183 
   159   $ hg rebase -s 3 -d 1
   184   $ hg rebase -s 5 -d 1
   160   saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
   185   saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
   161 
   186 
   162   $ hg tglog
   187   $ hg tglog
   163   @  5: 'F'
   188   @  7: 'H'
   164   |
   189   |
       
   190   | o  6: 'G'
       
   191   |/|
       
   192   o |  5: 'F'
       
   193   | |
   165   | o  4: 'E'
   194   | o  4: 'E'
   166   |/|
   195   | |
   167   o |  3: 'D'
   196   | | o  3: 'D'
   168   | |
   197   | | |
   169   | o  2: 'C'
   198   +---o  2: 'C'
   170   | |
   199   | |
   171   o |  1: 'B'
   200   o |  1: 'B'
   172   |/
   201   |/
   173   o  0: 'A'
   202   o  0: 'A'
   174   
   203   
   175   $ cd ..
   204   $ cd ..
   176 
   205 
   177 
   206 
   178 These will fail (using --source):
   207 These will fail (using --source):
   179 
   208 
   180 E onto D - rebase onto an ancestor:
   209 G onto F - rebase onto an ancestor:
   181 
   210 
   182   $ hg clone -q -u . a a7
   211   $ hg clone -q -u . a a7
   183   $ cd a7
   212   $ cd a7
   184 
   213 
   185   $ hg rebase -s 4 -d 3
   214   $ hg rebase -s 6 -d 5
   186   abort: source is descendant of destination
   215   abort: source is descendant of destination
   187   [255]
   216   [255]
   188 
   217 
   189 D onto E - rebase onto a descendant:
   218 F onto G - rebase onto a descendant:
   190 
   219 
   191   $ hg rebase -s 3 -d 4
   220   $ hg rebase -s 5 -d 6
   192   abort: source is ancestor of destination
   221   abort: source is ancestor of destination
   193   [255]
   222   [255]
   194 
   223 
   195 E onto B - merge revision with both parents not in ancestors of target:
   224 G onto B - merge revision with both parents not in ancestors of target:
   196 
   225 
   197   $ hg rebase -s 4 -d 1
   226   $ hg rebase -s 6 -d 1
   198   abort: cannot use revision 4 as base, result would have 3 parents
   227   abort: cannot use revision 6 as base, result would have 3 parents
   199   [255]
   228   [255]
   200 
   229 
   201 
   230 
   202 These will abort gracefully (using --base):
   231 These will abort gracefully (using --base):
   203 
   232 
   204 E onto E - rebase onto same changeset:
   233 G onto G - rebase onto same changeset:
   205 
   234 
   206   $ hg rebase -b 4 -d 4
   235   $ hg rebase -b 6 -d 6
   207   nothing to rebase
   236   nothing to rebase
   208   [1]
   237   [1]
   209 
   238 
   210 E onto D - rebase onto an ancestor:
   239 G onto F - rebase onto an ancestor:
   211 
   240 
   212   $ hg rebase -b 4 -d 3
   241   $ hg rebase -b 6 -d 5
   213   nothing to rebase
   242   nothing to rebase
   214   [1]
   243   [1]
   215 
   244 
   216 D onto E - rebase onto a descendant:
   245 F onto G - rebase onto a descendant:
   217 
   246 
   218   $ hg rebase -b 3 -d 4
   247   $ hg rebase -b 5 -d 6
   219   nothing to rebase
   248   nothing to rebase
   220   [1]
   249   [1]
   221 
   250