[darcs-devel] [issue2639] darcs diff crashes with --last=1 and file name

Ben Franksen bugs at darcs.net
Fri Jan 24 15:54:12 UTC 2020


Ben Franksen <ben.franksen at online.de> added the comment:

Here is what goes wrong:

Whether the diff command takes unrecorded changes into consideration or
not depends on whether the options indicate a secondMatch or not. If we
have a secondMatch then unrecorded changes are ignored, otherwise they
are put into an anonymous named patch that we append to the initial
patchset (consisting of the recorded patches).

If we have a firstMatch but no secondMatch (as is the case with
--last=N), then (in the local rundiff procedure) tounapply contains the
unrecorded changes as its last patch. We then unapply this from a copy
of our current pristine tree (in hashed format) which obviously cannot
succeed.

A possible way to fix this is to check if we have no secondMatch and in
that case first apply the unrecorded changes to our copy of the pristine
tree, so it corresponds to the state of our working tree, not the
pristine tree.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2639>
__________________________________


More information about the darcs-devel mailing list