D6881: histedit: demonstrate breakage when `update` to a revision breaks

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Sep 25 13:54:32 EDT 2019


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I'm honestly impressed that nobody has hit this in the over a decade
  that histedit has existed, but here we are.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6881

AFFECTED FILES
  tests/test-histedit-non-commute-abort.t

CHANGE DETAILS

diff --git a/tests/test-histedit-non-commute-abort.t b/tests/test-histedit-non-commute-abort.t
--- a/tests/test-histedit-non-commute-abort.t
+++ b/tests/test-histedit-non-commute-abort.t
@@ -162,4 +162,55 @@
      summary:     a
   
 
+Early tree conflict doesn't leave histedit in a wedged state.
+  $ hg rm c
+  $ hg ci -m 'remove c'
+  $ echo collision > c
+
+  $ hg histedit e860deea161a --commands - 2>&1 <<EOF
+  > edit e860deea161a
+  > pick 652413bf663e
+  > pick bfa474341cc9
+  > pick 1b0954ff00fc
+  > EOF
+  c: untracked file differs
+  abort: untracked files in working directory differ from files in requested revision
+  [255]
+
+BUG: we didn't actually change p1 of the working copy, but we're in a
+histedit state. This confuses the process very badly and leads to
+histedit stripping things it shouldn't (in obsmarker mode it inserts
+bogus prune markers in this case.)
+
+  $ hg log -r 'p1()' -T'{node}\n'
+  1b0954ff00fccb15a37b679e4a35e9b01dfe685e
+  $ hg status --config ui.tweakdefaults=yes
+  ? c
+  ? e.orig
+  # The repository is in an unfinished *histedit* state.
+  
+  # To continue:    hg histedit --continue
+  # To abort:       hg histedit --abort
+  
+  $ hg histedit --continue
+  652413bf663e: skipping changeset (no changes)
+  bfa474341cc9: skipping changeset (no changes)
+  1b0954ff00fc: skipping changeset (no changes)
+  saved backup bundle to $TESTTMP/r/.hg/strip-backup/e860deea161a-a0738322-histedit.hg
+
+  $ hg log -GTcompact
+  warning: ignoring unknown working parent 1b0954ff00fc!
+  o  3[tip]   055a42cdd887   1970-01-01 00:00 +0000   test
+  |    d
+  |
+  o  2   177f92b77385   1970-01-01 00:00 +0000   test
+  |    c
+  |
+  o  1   d2ae7f538514   1970-01-01 00:00 +0000   test
+  |    b
+  |
+  o  0   cb9a9f314b8b   1970-01-01 00:00 +0000   test
+       a
+  
+
   $ cd ..



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list