Here is perhaps a situation where we might want darcs to be able to
do a wrong thing.  I was thinking specifically of the conflict I just
had with David's --lazy repo patches.

1) David submitted a patch with a small conflict (that was my fault; I
   had forgotten to push in the offending patch) and so I tacked on a
   small conflict resolution to it.  Let's call these David1 and Eric1

2) David submits an amended version of David1 that fixes the conflict
   and so subsumes David1 and Eric1.  Let's call this David2

3) In his newest bundle, David includes some new stuff which depends
   on David2, but could just as easily depend on (David1 Eric1).
   Let's call this NewStuff.

What I would like to do is to coerce the application of NewStuff onto
the context David1 Eric1

To sum up, we have
  ... David1 Eric1
  ... David2       NewStuff

And I want
  ... David1 Eric1 NewStuff

As far as I can tell, there isn't a proper way to do this in darcs.
You could generate unix diffs and apply them via patch, but then
you either lose the individual darcs patches, or would have to do
things by hand.

Just throwing out sort of a nebulous idea, here: what about an apply
--amend-depends or an amend apply (thus making amend a supercommand à
la query), or even an external darcs-firstaid tool based on a
hypothetical libdarcs?

The basic idea is to apply some patches whilst swapping out some of its
dependencies below:

 * Darcs would ensure that everything is consistent, for example,
   refusing to amend apply if the patches cannot cleanly apply to
   the repository

 * Darcs would modify the NewStuff (so it'll be a little bit like
   amend-recording NewStuff)

 * The patch selection user interface would let you ignore dependencies
 
 * We would warn rather vigourously that this should be used probably
   even more sparingly than amend-record.  The intention is for this to
   be a one-off event, not something which generates a stream of apply
   --amends down the line.  Best practice as a repository maintainer
   might probably be not to do the amend apply yourself, but ask the
   patch submitter to do so and resubmit, so as to avoid confusion for
   all around.

Would this kind of thing be useful for other people, or is it so limited
that we're better off without the clutter?  What should the user
interface for this look like?  Would it be very difficult in theory?  If
it is difficult in theory, are there restrictions we could apply (e.g.
the user would have to be explicit about what patches to swap out, what
patches to swap in) so that we're not trying to solve an overly general
problem?

I suspect this is the kind of thing our diff/patch based competition
handle very easily.

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.

Attachment: pgptJj8STmydE.pgp
Description: PGP signature

_______________________________________________
darcs-devel mailing list
[EMAIL PROTECTED]
http://lists.osuosl.org/mailman/listinfo/darcs-devel

Reply via email to