[darcs-devel] [patch1954] resolve issue2639: darcs diff crashes with --last=1 an...

Ben Franksen bugs at darcs.net
Sat Jan 25 17:38:01 UTC 2020


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

No, the problem is not 'base', but the files inside 'pdirpath'.

pdirpath is used in the first call to hashedTreeIO when we create
oldtree. It is the result of copying our (hashed) pristine tree (the 4
lines after the comment

  -- make a temporary copy of pristineDirPath where we have write access

). But if we have no secondMatch this is wrong: pdirpath should be (a
hashed version of) the working tree, not the pristine tree.

My fix returns the same value for base as before (i.e. as
unrecordedChanges does), but /as a side effect/ the unrecorded' changes
are applied to the pristine tree on disk inside pdirpath; which is then
in the correct state, i.e. we can now unapply 'todiff+>+tounapply'
without crashing.

In principle this bug has nothing to do with path filtering. I must
admit that I am not 100% sure why we need path filtering to actually get
the crash. It may have to do with the fact that the directory on disk is
used only as 'backup storage' for the Tree, i.e. we consult it only if
we hit an unrealized Blob inside the Tree (assuming it is already
expanded, but i think it is). This may mask the bug in many common
cases. I know this is not really a satisfying explanation...

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1954>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 4211 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20200125/b79542e7/attachment.key>


More information about the darcs-devel mailing list