[darcs-users] On merging

Anthony Towns aj at azure.humbug.org.au
Thu Nov 25 21:57:38 UTC 2004


Anthony Towns wrote:
> I'm trying to rewrite the patch theory in a way that I understand; and 
> I'm stuck on the merge part again. :-/

Aha! How about this:

To me, it seems obvious that a "patch" is the difference between two 
repositories. That is, there's a unique patch P, changes repository R 
into R' for any repositories R and R'. (Now, you have to count the 
"changelog" as part of the repository, but that seems fair enough)

But where this doesn't work is for merger patches: if you've got X,Y 
which are conflict addfile patches, and M is the merger of X and Y, then
	R+X+M = R
	      = R+X+I(X)
but
	R+X+M+I(X)' = R+Y
while
		R+X+I(X)+I(X)'
seems highly unlikely to be R+Y, no?

That feels like a design bug to me.

Hrm, except that's not how it works. You can't seem to actually apply 
the inverse of X after you've applied the merger. Or it just doesn't do 
anything or something. But that surely can't work right either... Aha! 
There we go!

../x and ../y both have a single patch that addfile's ./foo.

$ rm -rf *
$ darcs init
$ darcs pull -a ../y
] Finished pulling.
$ ls ./foo
] ./foo

$ rm -rf *; darcs init

$ darcs pull -a ../x
] Finished pulling.
$ darcs rollback
]
] Fri Nov 26 07:41:31 EST 2004  aj at azure.humbug.org.au
]   * add foo x
] Shall I rollback this patch? [yNvq?] y
] Finished rolling back.
$ darcs revert
] addfile ./foo
] Shall I revert this patch? (1/1) [ynWsfqadjk?] y
] Do you really want to do this? y
] Finished reverting.

$ darcs pull -a ../y
] Finished pulling.

$ ls ./foo
] ls: ./foo: No such file or directory
$ darcs what
] No changes!
$ darcs changes
] Fri Nov 26 07:41:41 EST 2004  aj at azure.humbug.org.au
]   * add foo y
]
] Fri Nov 26 07:41:31 EST 2004  aj at azure.humbug.org.au
]   UNDO: add foo x
]
] Fri Nov 26 07:41:31 EST 2004  aj at azure.humbug.org.au
]   * add foo x

So applying X, inv(X), then Y isn't the same as just applying Y if X and 
Y conflict. Surely /that/ has to be a bug? Please? :)

Cheers,
aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 155 bytes
Desc: OpenPGP digital signature
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20041126/65c8866c/attachment.pgp 


More information about the darcs-users mailing list