[darcs-users] rolling back/unpulling a patch with dependencies

Ganesh Sittampalam ganesh at earth.li
Sun Apr 18 12:51:36 UTC 2004


On Sun, 18 Apr 2004, David Roundy wrote:

> > However, I can't just push patch B, and none of the tools
> > (unpull/rollback) lets me undo patch A in any way [in a staging
> > repository]. Am I missing something obvious? Can I remove the dependency
> > somehow?
>
> Alas, there isn't any way to get around this.  :( Other than simply
> unrecording and then re-recording the patch.

You mean patch B? That didn't actually occur to me, but since there are
actually several patch Bs that'd be impractical.

> Basically, the idea is to make all patches commute, with the proviso that
> some commutations produce conflicts.  This moves the complexity of the
> current merge process into the commute function.  One advantage this has is
> that the commute function is much simpler in terms of the constraints
> placed upon it--for example the result of two commutes must always give you
> the same pair of patches back again.  There are other more subtle issues
> that this approach could also fix.  But of course, this new idea (which I'm
> increasingly favoring) will need a lot of work to make sure that it
> actually works.

I've been trying to get my head round precisely what merging is lately,
and still haven't quite managed it, which is perhaps an indication that
it's the wrong primitive [or of course that my brain doesn't work like
yours, or indeed at all!] For me, I think universal commutation is easier
to comprehend.

> Interestingly, I hadn't considered its application to the problem you're
> describing until just now.  As a caveat, when I've worked out how the
> commutation needs to behave (when commuting can produce a conflict), it may
> be that I'll find that this method will produce undesirable side-effects.
> For example, it's hard to see how to deal with the conflict produced when
> commuting a file modification with the creation of that file.

My initial thought would be to treat that as a conflict for the directory
the file was in, and just dump a file with some special name and those
contents into the directory. Then the user can put the contents into
whatever file they want to resolve the contents.

Cheers,

Ganesh





More information about the darcs-users mailing list