[darcs-users] retrieving old versions

David Roundy droundy at abridgegame.org
Sun Sep 12 10:44:43 UTC 2004


On Sat, Sep 11, 2004 at 10:25:27PM -0500, Taral wrote:
> On Sat, Sep 11, 2004 at 08:00:31AM -0400, David Roundy wrote:
> > The problem comes about from the algorithm rollback uses to see if a patch
> > can be rolled back.  It tries to commute that patch to the "front" of the
> > list of patches, and fails because it can't commute it by the patch which
> > you rolled back.  Basically this is because while a patch followed by its
> > inverse is like the identity patch, it doesn't commute like the identity
> > patch.
> 
> Why not? Isn't patch concatenation associative?

Yes, patch concatenation is associative, and in this scenario a rollback is
"possible", but the code doesn't see that the rollback is possible, since
the way rollback works is (if the most recent patch is on the left) is it
commutes the patch to be rolled back to the left until it reaches the end,
then it applies the inverse of that patch.  So if originally I have

BA (which don't commute, because they're dependent on each other)

Then when I rollback B, I have

B^-1BA

Then when I try to rollback A, we all know the "correct" answer is

A^-1B^-1BA

but the code doesn't know this, it tries to commute to the form

AB-1B

first, but this isn't possible, since B can't by applied unless A has first
been applied.  So the code falls down.

I think the solution to this problem would be to first "annihilate" all the
rolled-back patches, and then do the commutation.  But that'll be some
work.
-- 
David Roundy
http://www.abridgegame.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20040912/8aea6d7c/attachment.pgp 


More information about the darcs-users mailing list