tests/test-rebase-partial.t
changeset 32272 78496ac30025
child 33773 6c1a9fd8361b
equal deleted inserted replaced
32271:6096d27dc119 32272:78496ac30025
       
     1 Tests rebasing with part of the rebase set already in the
       
     2 destination (issue5422)
       
     3 
       
     4   $ cat >> $HGRCPATH <<EOF
       
     5   > [extensions]
       
     6   > rebase=
       
     7   > drawdag=$TESTDIR/drawdag.py
       
     8   > 
       
     9   > [experimental]
       
    10   > evolution=createmarkers,allowunstable
       
    11   > 
       
    12   > [alias]
       
    13   > tglog = log -G --template "{rev}: {desc}"
       
    14   > EOF
       
    15 
       
    16   $ rebasewithdag() {
       
    17   >   N=`$PYTHON -c "print($N+1)"`
       
    18   >   hg init repo$N && cd repo$N
       
    19   >   hg debugdrawdag
       
    20   >   hg rebase "$@" > _rebasetmp
       
    21   >   r=$?
       
    22   >   grep -v 'saved backup bundle' _rebasetmp
       
    23   >   [ $r -eq 0 ] && hg tglog
       
    24   >   cd ..
       
    25   >   return $r
       
    26   > }
       
    27 
       
    28 Rebase two commits, of which one is already in the right place
       
    29 
       
    30   $ rebasewithdag -r C+D -d B <<EOF
       
    31   > C
       
    32   > |
       
    33   > B D
       
    34   > |/
       
    35   > A
       
    36   > EOF
       
    37   rebasing 2:b18e25de2cf5 "D" (D)
       
    38   already rebased 3:26805aba1e60 "C" (C tip)
       
    39   o  4: D
       
    40   |
       
    41   | o  3: C
       
    42   |/
       
    43   | x  2: D
       
    44   | |
       
    45   o |  1: B
       
    46   |/
       
    47   o  0: A
       
    48   
       
    49 Can collapse commits even if one is already in the right place
       
    50 
       
    51   $ rebasewithdag --collapse -r C+D -d B <<EOF
       
    52   > C
       
    53   > |
       
    54   > B D
       
    55   > |/
       
    56   > A
       
    57   > EOF
       
    58   rebasing 2:b18e25de2cf5 "D" (D)
       
    59   rebasing 3:26805aba1e60 "C" (C tip)
       
    60   o  4: Collapsed revision
       
    61   |  * D
       
    62   |  * C
       
    63   | x  3: C
       
    64   |/
       
    65   | x  2: D
       
    66   | |
       
    67   o |  1: B
       
    68   |/
       
    69   o  0: A
       
    70   
       
    71 Rebase with "holes". The commits after the hole should end up on the parent of
       
    72 the hole (B below), not on top of the destination (A).
       
    73 
       
    74   $ rebasewithdag -r B+D -d A <<EOF
       
    75   > D
       
    76   > |
       
    77   > C
       
    78   > |
       
    79   > B
       
    80   > |
       
    81   > A
       
    82   > EOF
       
    83   already rebased 1:112478962961 "B" (B)
       
    84   not rebasing ignored 2:26805aba1e60 "C" (C)
       
    85   rebasing 3:f585351a92f8 "D" (D tip)
       
    86   o  4: D
       
    87   |
       
    88   | x  3: D
       
    89   | |
       
    90   | o  2: C
       
    91   |/
       
    92   o  1: B
       
    93   |
       
    94   o  0: A
       
    95