Issue 2383 Using last regrets/hunk edit can lead to "Error applying" error

Title Using last regrets/hunk edit can lead to "Error applying" error
Priority Status unknown
Milestone Resolved in
Superseder Nosy List owst
Assigned To

Created on 2014-04-29.16:09:47 by owst, last changed 2014-04-29.16:25:28 by owst.

msg17409 (view) Author: owst Date: 2014-04-29.16:09:46
1. Summarise the issue (what were doing, what went wrong?)

I was recording some changes, before noticing at last regrets that I
don't want to include a particular sub-hunk that I've already said yes to.

I have already recorded a file containing:

    -- a comment

    data D = C Int
           deriving (Eq, Show)

which I then change in working to:

    -- another comment

    -- a comment

    data D = C !Int
           deriving (Eq)

Then, in record, I don't record the initial comment-addition, I do
record the final hunk.
I get to last regrets before realising I don't want to remove D's Show
so I put it back using the hunk editor. I accept the remaining changes,
but darcs fails:

    WARNING: Doing a one-time conversion of pristine format.
    This may take a while. The new format is backwards-compatible.
    Pristine conversion done...

    darcs failed:  ### Error applying:
    hunk ./file 5
    -data D = C Int
    -       deriving (Eq, Show)
    +data D = C !Int
    +       deriving (Eq)
    ### to file ./file:
    -- a comment

    data D = C Int
           deriving (Eq, Show)

darcs shouldn't fail, and should record a patch that simply adds a ! to
the Int parameter of C.
msg17410 (view) Author: owst Date: 2014-04-29.16:25:27
And the obvious thing to point out is that the pristine conversion
message is spurious, and any fix of this bug should look into why it's
Date User Action Args
2014-04-29 16:09:47owstcreate
2014-04-29 16:25:28owstsetmessages: + msg17410