[darcs-users] Colin Walters blogs on Arch changesets vs Darcs

Karel Gardas kgardas at objectsecurity.com
Tue Nov 23 23:43:20 UTC 2004


On Tue, 23 Nov 2004, Colin Walters wrote:

> On Mon, 2004-11-22 at 03:48 -0500, Andrew Pimlott wrote:
>
> > I think another poster answered this, but let me stress:  A darcs patch
> > cannot fail to apply (assuming its context is in the target repository)!
>
> Suppose that you have a setup like this.
>
> project/
>   Makefile.common
>   Makefile
>   foo.c
>   foo.h
>
> The contents of Makefile are solely:
> include $(top_srcdir)/Makefile.common
>
> Then later, you want to stick this all in a subdir:
>
> project/
>   Makefile.common
>   Makefile
>   foo/
>     Makefile
>     foo.c
>     bar.c
>
> And you create a new file, project/Makefile, the contents of which are
> still just:
> include $(top_srcdir)/Makefile.common
>
> However, suppose that in between these two trees, someone notices that
> the project/Makefile in the first tree requires a line:
>
> HEADERS = foo.h
>
> They create a darcs tree, and create a patch.  Meanwhile, upstream has
> moved onto the second tree.  When they receive the patch, it will apply
> exactly to project/Makefile, because they have the same content.  But it
> will be the *wrong* Makefile!  I don't see how you can solve this
> without a notion of explicit logical file identity.

I think that you are not right here, since IMHO while applying patch from
the outside (this which adds `HEADERS = foo.h'), darcs will try to find
its context and it will find original project/Makefile, but since there
are other patches applied to the tree including one which moved
project/Makefile to project/foo/Makefile, darcs will (should) try to
recompute received patch to the new context, i.e. using patch commutation.

That's just as I understand theory of patches after first quick read, so
please correct me if I'm wrong.

Thanks,
Karel
--
Karel Gardas                  kgardas at objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com






More information about the darcs-users mailing list