[darcs-users] Request: porting patches advice (can I get rid of/ignore dependencies?)

David Roundy droundy at abridgegame.org
Sat May 8 10:38:33 UTC 2004


On Fri, May 07, 2004 at 08:30:25AM -0700, Kevin Smith wrote:
> David Roundy wrote:
> >On Fri, May 07, 2004 at 02:08:53PM +1200, Jonathan Wright wrote:
> >>Is there a way to extract a bunch of patches from a repository and apply
> >>them on an unrelated repository ignoring dependencies?
> >
> >You can't do this (as described) without some common history.  If you could
> >create a common history (in your conversion from the old VSS), this might
> >be possible.
> 
> I haven't thought this through all the way, but I'm having trouble 
> understanding why a full common history is required. It seems that the 
> "context" of a patch is literally a collection of specific patches, 
> whereas I would have expected the "context" of a patch to be the 
> _result_ of a set of patches.
>
> That is, if I have patches A, B, and C which result in a repo with 
> current contents of X; and I have patches D and E that result in a repo 
> with current contents of Y; and X == Y (as measured by a recursive 
> diff); then why can't I apply patch F to both repos?

Because darcs has no way of knowing that X == Y.

Also, a recursive diff is insufficient for proving (from darcs'
perspective) that the two repositories really are identical, since there
could be identical files whose names have been switched... so this really
is a case of "inexact patching", which is not what darcs does.
Fortunately, it *is* what patch does, so you can use patch for this kind of
application.

It is because darcs keeps track of the history (i.e. context is a
collection of patches) that darcs doesn't need to attach a unique file id
to each file.  If the context of a patch were the "result" of a set of
patches, that "result" would have to have an ID associated with each file.
And if it had an ID associated with each file, then unless there was a
common history, we wouldn't be able to apply a darcs patch...
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list