tests/test-histedit-non-commute-abort.t
changeset 42977 699102b10530
parent 42976 f200bea8470b
child 44396 acbfa31cfaf2
equal deleted inserted replaced
42976:f200bea8470b 42977:699102b10530
   160      user:        test
   160      user:        test
   161      date:        Thu Jan 01 00:00:00 1970 +0000
   161      date:        Thu Jan 01 00:00:00 1970 +0000
   162      summary:     a
   162      summary:     a
   163   
   163   
   164 
   164 
   165 Early tree conflict doesn't leave histedit in a wedged state.
   165 Early tree conflict doesn't leave histedit in a wedged state. Note
       
   166 that we don't specify --commands here: we catch the problem before we
       
   167 even prompt the user for rules, sidestepping any dataloss issues.
       
   168 
   166   $ hg rm c
   169   $ hg rm c
   167   $ hg ci -m 'remove c'
   170   $ hg ci -m 'remove c'
   168   $ echo collision > c
   171   $ echo collision > c
   169 
   172 
   170   $ hg histedit e860deea161a --commands - 2>&1 <<EOF
   173   $ hg histedit e860deea161a
   171   > edit e860deea161a
       
   172   > pick 652413bf663e
       
   173   > pick bfa474341cc9
       
   174   > pick 1b0954ff00fc
       
   175   > EOF
       
   176   c: untracked file differs
   174   c: untracked file differs
   177   abort: untracked files in working directory differ from files in requested revision
   175   abort: untracked files in working directory conflict with files in 055a42cdd887
   178   [255]
   176   [255]
   179 
   177 
   180 BUG: we didn't actually change p1 of the working copy, but we're in a
   178 We should have detected the collision early enough we're not in a
   181 histedit state. This confuses the process very badly and leads to
   179 histedit state, and p1 is unchanged.
   182 histedit stripping things it shouldn't (in obsmarker mode it inserts
       
   183 bogus prune markers in this case.)
       
   184 
   180 
   185   $ hg log -r 'p1()' -T'{node}\n'
   181   $ hg log -r 'p1()' -T'{node}\n'
   186   1b0954ff00fccb15a37b679e4a35e9b01dfe685e
   182   1b0954ff00fccb15a37b679e4a35e9b01dfe685e
   187   $ hg status --config ui.tweakdefaults=yes
   183   $ hg status --config ui.tweakdefaults=yes
   188   ? c
   184   ? c
   189   ? e.orig
   185   ? e.orig
   190   # The repository is in an unfinished *histedit* state.
       
   191   
       
   192   # To continue:    hg histedit --continue
       
   193   # To abort:       hg histedit --abort
       
   194   
       
   195   $ hg histedit --continue
       
   196   652413bf663e: skipping changeset (no changes)
       
   197   bfa474341cc9: skipping changeset (no changes)
       
   198   1b0954ff00fc: skipping changeset (no changes)
       
   199   saved backup bundle to $TESTTMP/r/.hg/strip-backup/e860deea161a-a0738322-histedit.hg
       
   200 
       
   201   $ hg log -GTcompact
       
   202   warning: ignoring unknown working parent 1b0954ff00fc!
       
   203   o  3[tip]   055a42cdd887   1970-01-01 00:00 +0000   test
       
   204   |    d
       
   205   |
       
   206   o  2   177f92b77385   1970-01-01 00:00 +0000   test
       
   207   |    c
       
   208   |
       
   209   o  1   d2ae7f538514   1970-01-01 00:00 +0000   test
       
   210   |    b
       
   211   |
       
   212   o  0   cb9a9f314b8b   1970-01-01 00:00 +0000   test
       
   213        a
       
   214   
       
   215 
   186 
   216   $ cd ..
   187   $ cd ..