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.
|