[darcs-users] upgrade from darcs-1 to darcs-2

Ganesh Sittampalam ganesh at earth.li
Sun Mar 8 21:46:55 UTC 2015


Hi,

On 07/03/2015 18:56, Ben Franksen wrote:

> I can fully understand your reservations. The more so since darcs-2 patches 
> currently do not satisfy all the properties we'd like them to satisfy 
> (permutivity, or at least "consistency of failure", can be violated in some 
> corner cases).
> 
> I would support Michael's position *if* we could honestly claim that darcs-2 
> patch format is solving all the merge problems and has all the desired 
> properties, and if we had at least a decent story for conversion of multi-
> branched repos.

This is roughly my feeling too. darcs-2 isn't unambiguously better than
darcs-1 and there's a relatively high cost to migrating.

As Henning suggests, I think much of the code change/complexity for
supporting darcs-1 repos will also support a future move to darcs-3
format. The extra risk will be a slightly higher change of exponential
merges happening on the server, but I think this is quite unlikely as
most merges will happen on the client.

That said, I can understand it if Simon still feels he doesn't want to
support this - if so I'll look at running a separate darcsden instance
myself to provide a home for old darcs-1 repos.


> Regarding conversion: we can and must do better than offer just a one-time 
> conversion of a single branch. Here is a sketch of a solution I'd say would 
> be "good enough": When converting a repo for the first time (the first 
> branch), we create a "map file" (similar in spirit, but not quite the same 
> as a git marks file) that associates old patches with new patches (more 
> precisely: old with new patch hashes). When converting another branch, the 
> conversion can read an existing map file, pull already converted patches 
> from one or more converted repos, and only convert those patches that are 
> not yet in the map file, thereby extending it with additional old-hash-new-
> hash-pairs.

The main risk of infidelity in practice with repeated darcs-1 to darcs-2
conversions is from conflicts, and I'm not entirely sure if this would
address that cleanly - would have to think about it carefully.

I think the safest algorithm would be to convert patches in their
"minimal contexts" - i.e. commute them as far back in history as
possible, convert them, then commute back to the original location - but
this could be quite computationally expensive. Possibly just commuting
them far enough back that they were free of conflicts would be enough.
If I haven't missed anything then this would also work without needing
map files, i.e. two independently converted repos would be compatible.

> We could still add a feature like this for the darcs-1 to darcs-2 
> conversion. This would not be a wasted effort if we do it right: large parts 
> of the code could be re-used for a future upgrade to darcs-3 format. So 
> perhaps our precious developer time would be more valuably spent on fixing 
> the conversion (possibly along the lines indicated above), rather than 
> supporting darcs-1 format in hub.darcs.net?

Supporting darcs-1 format in darcsden isn't actually very hard from what
I can see so far and will pave the way for darcs-3 etc, so I'm planning
on finishing this whatever.

Cheers,

Ganesh



More information about the darcs-users mailing list