[darcs-devel] [issue2432] pull --reorder does not commute reordered patches

Ganesh Sittampalam bugs at darcs.net
Thu Feb 26 08:49:21 UTC 2015


Ganesh Sittampalam <ganesh at earth.li> added the comment:

I think I know roughly what's going on here, and it's a good example of how we don't really track witnesses properly in 
repositories (Ben: another example of where we can't trust them!)

The problem is the tentativelyReplacePatches call made in tentativelyMergePatches_ (in Darcs.Repository.Merge). The 
precondition for the replace is that the patches passed in are already commuted to the end of the repo, so they can be 
used as the properly commuted ones to re-add to the end of the repo after removing the current versions from wherever  
they were before - the type is roughly Repository wR wU wT -> Patch wX wT -> IO ().

The problem in tentativelyMergePatches_ is that while 'r' and 'usi' have the right types at the start of the function, by 
the time we get to the replace call, we've written the recently pulled patches to the repository, but the witnesses 
haven't changed.

Will have to think about how best to fix this...

----------
nosy: +ganesh
status: unknown -> needs-diagnosis/design

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


More information about the darcs-devel mailing list