tests/test-rebase-transaction.t
changeset 36816 9ab7eba99fe5
parent 36815 f4e9e89330d4
child 36927 17a744c5e270
equal deleted inserted replaced
36815:f4e9e89330d4 36816:9ab7eba99fe5
    46   o  1: Y
    46   o  1: Y
    47   |
    47   |
    48   o  0: A
    48   o  0: A
    49   
    49   
    50   $ cd ..
    50   $ cd ..
       
    51 
       
    52 Check that --collapse works
       
    53 
       
    54   $ hg init collapse && cd collapse
       
    55   $ hg debugdrawdag <<'EOF'
       
    56   >   Z
       
    57   >   |
       
    58   >   | D
       
    59   >   | |
       
    60   >   | C
       
    61   >   | |
       
    62   >   Y B
       
    63   >   |/
       
    64   >   A
       
    65   > EOF
       
    66 - We should only see two status stored messages. One from the start, one from
       
    67 - the end.
       
    68   $ hg rebase --collapse --debug -b D -d Z | grep 'status stored'
       
    69   rebase status stored
       
    70   rebase status stored
       
    71   $ hg tglog
       
    72   o  3: Collapsed revision
       
    73   |  * B
       
    74   |  * C
       
    75   |  * D
       
    76   o  2: Z
       
    77   |
       
    78   o  1: Y
       
    79   |
       
    80   o  0: A
       
    81   
       
    82   $ cd ..
       
    83 
       
    84 With --collapse, check that conflicts can be resolved and rebase can then be
       
    85 continued
       
    86 
       
    87   $ hg init collapse-conflict && cd collapse-conflict
       
    88   $ hg debugdrawdag <<'EOF'
       
    89   >   Z   # Z/conflict=Z
       
    90   >   |
       
    91   >   | D
       
    92   >   | |
       
    93   >   | C # C/conflict=C
       
    94   >   | |
       
    95   >   Y B
       
    96   >   |/
       
    97   >   A
       
    98   > EOF
       
    99   $ hg rebase --collapse -b D -d Z
       
   100   rebasing 1:112478962961 "B" (B)
       
   101   rebasing 3:c26739dbe603 "C" (C)
       
   102   merging conflict
       
   103   warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark')
       
   104   unresolved conflicts (see hg resolve, then hg rebase --continue)
       
   105   [1]
       
   106   $ hg tglog
       
   107   o  5: D
       
   108   |
       
   109   | @  4: Z
       
   110   | |
       
   111   @ |  3: C
       
   112   | |
       
   113   | o  2: Y
       
   114   | |
       
   115   o |  1: B
       
   116   |/
       
   117   o  0: A
       
   118   
       
   119   $ hg st
       
   120   M C
       
   121   M conflict
       
   122   A B
       
   123   ? conflict.orig
       
   124   $ echo resolved > conflict
       
   125   $ hg resolve -m
       
   126   (no more unresolved files)
       
   127   continue: hg rebase --continue
       
   128   $ hg rebase --continue
       
   129   already rebased 1:112478962961 "B" (B) as 79bc8f4973ce
       
   130   rebasing 3:c26739dbe603 "C" (C)
       
   131   rebasing 5:d24bb333861c "D" (D tip)
       
   132   saved backup bundle to $TESTTMP/collapse-conflict/.hg/strip-backup/112478962961-b5b34645-rebase.hg
       
   133   $ hg tglog
       
   134   o  3: Collapsed revision
       
   135   |  * B
       
   136   |  * C
       
   137   |  * D
       
   138   o  2: Z
       
   139   |
       
   140   o  1: Y
       
   141   |
       
   142   o  0: A
       
   143   
       
   144   $ cd ..
       
   145 
       
   146 With --collapse, check that the commit message editing can be canceled and
       
   147 rebase can then be continued
       
   148 
       
   149   $ hg init collapse-cancel-editor && cd collapse-cancel-editor
       
   150   $ hg debugdrawdag <<'EOF'
       
   151   >   Z
       
   152   >   |
       
   153   >   | D
       
   154   >   | |
       
   155   >   | C
       
   156   >   | |
       
   157   >   Y B
       
   158   >   |/
       
   159   >   A
       
   160   > EOF
       
   161   $ HGEDITOR=false hg --config ui.interactive=1 rebase --collapse -b D -d Z
       
   162   rebasing 1:112478962961 "B" (B)
       
   163   rebasing 3:26805aba1e60 "C" (C)
       
   164   rebasing 5:f585351a92f8 "D" (D tip)
       
   165   abort: edit failed: false exited with status 1
       
   166   [255]
       
   167   $ hg tglog
       
   168   o  5: D
       
   169   |
       
   170   | @  4: Z
       
   171   | |
       
   172   o |  3: C
       
   173   | |
       
   174   | o  2: Y
       
   175   | |
       
   176   o |  1: B
       
   177   |/
       
   178   o  0: A
       
   179   
       
   180   $ hg rebase --continue
       
   181   already rebased 1:112478962961 "B" (B) as e9b22a392ce0
       
   182   already rebased 3:26805aba1e60 "C" (C) as e9b22a392ce0
       
   183   already rebased 5:f585351a92f8 "D" (D tip) as e9b22a392ce0
       
   184   saved backup bundle to $TESTTMP/collapse-cancel-editor/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg
       
   185   $ hg tglog
       
   186   o  3: Collapsed revision
       
   187   |  * B
       
   188   |  * C
       
   189   |  * D
       
   190   o  2: Z
       
   191   |
       
   192   o  1: Y
       
   193   |
       
   194   o  0: A
       
   195   
       
   196   $ cd ..