[darcs-users] Different approach for "incoherent" patches

Anthony Towns aj at azure.humbug.org.au
Mon Nov 22 05:14:12 UTC 2004

Hey all,

I had a different idea for for dealing with the "incoherent" patches 
problem. The usage scenario seems to be:

   A: darcs record -m 'patch A5'
   B: darcs pull
   A: #hackhack
   A: darcs rerecord -m 'patch A5.1'
   B: darcs pull

and B gets both patch A5 and A5.1, with duplicated changes. Or something 
similar in the unrecord case.

Rather than trying to make patch A5.1 "supersede" patch A5, a different 
approach might be to make A's and B's repositories "sync". So that if 
B's repository has patches:

  A1, A2, A3, A4, B1, A5, B2, B3

and A's repository has patches

  A1, A2, A3, A4, A5.1

then we say "B1, B2, and B3" aren't from repo "A", so leave them. That 
leaves "A1, A2, A3, A4, and A5", but "A1-4" are still in A's repository, 
so leave them too. That just leaves A5, which needs to be removed, and 
A5.1 which needs to be added, giving us:

  A1, A2, A3, A4, B1, B2', B3', (A5, A5^-1), A5.1

That'd imply keeping track of which patches were pulled from which 
repositories, which seems more straightforward than working out which 
patches *have been pulled* from a given repository. If you're doing an 
n-way merge -- ie, pulling patches from repo A and B to repo C, and a 
patch in both A and B is rerecorded in A, but still present in B, you've 
got a problem, but well, you've got a problem then anyway. Another 
tricky situation might be what should happen if "B1" gets included in 
A's repository, and later gets re/unrecorded.

I think this could be implemented by just having a "darcs pull --sync" 
flag, that marks patches that're in common with the remote repo, and 
deletes patches that were marked as being in common, but aren't anymore 
(and pulls patches too, of course).

Anyway, just a thought. Hope it's useful.

-------------- 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/20041122/6e63cfba/attachment.pgp 

More information about the darcs-users mailing list