[darcs-devel] darcs patch: test: Exibit a falling test about rollback.

David Roundy droundy at darcs.net
Fri Jan 11 17:10:35 UTC 2008


On Fri, Jan 11, 2008 at 04:30:15PM +0000, Simon Marlow wrote:
> David Roundy wrote:
> > Having just chatted on this subject with a friend who walked by my office,
> > I think what I'll do is implement a modified rollback that will allow you
> > to undo more than one named patch at a time, and will make those changes in
> > the working directory as well as recording them, and will allow you to
> > provide a description of why you're rolling the change back... and will
> > also (maybe not in the first draft) allow you to roll back just a subset of
> > the primitive changes in those patches.  I think this'll be more useful and
> > also easier to implement.
> 
> How about just applying the inverse of the patch (suitably commuted) to the 
> working copy, leaving the user to record it, or record only parts of it, or 
> whatever.  That seems like the most flexible solution.

For quite a while, I thought that would be best, and was thinking it'd be
easiest.  But in fact it's less flexible, and I think less often what is
desired.  You could reproduce this behavior by running

darcs rollback && darcs unrecord -a --last 1

so that the net effect would be to only modify the working directory.
Also, if you've got unrecorded changes, it might be hard to record a patch
describing only the rollback changes.

Moreover, if we record the rollback changes as a patch, then rollback is
reversible by obliterating the rollback, except in the situation where the
rollback conflicts with unrecorded local changes.  This could be very
useful, if you aren't sure that you want to rollback a patch (e.g. you
think it triggered a bug, but won't know until you've rolled it back and
tested it).

Another advantage of creating the patch directly is that it can include the
exact inverse of the primitive patches that are being rolled back.  This
means that with darcs-2 patch semantics, two rollback patches that roll
back the same patches will never conflict.

On the balance, it seems clear to me what we ought to make rollback do.  On
the other hand, if it's not clear to *you*, then please keep the discussion
going!
-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-devel mailing list