> Fri Jan 26 15:37:52 CET 2007 Benedikt Schmidt
> * make write_repo_format agree with read_repo_format (use | for
Going in. Thanks for fixing this too (and David for the quick review).
For the curious, the RepoFormat mechanism is how we assure compatibility
across different versions of darcs we introduce features that affect it.
There may be mistakes in the following tale of repo formats, so caveat
Each darcs repository has a little file _darcs/format that has a list of
lines that look like this, modulo indentation for readibility:
Each line contains some property that darcs must know about. If you
read a repository, you must know about ONE property from every line.
So say I create a repository with darcs unstable circa 2007, using the
hashed inventory feature. My _darcs/format will contain this line:
Can I read the repository with an older version of darcs, say 1.0.8?
Well, 1.0.8 doesn't know anything about hashed-inventories, but it
does know about darcs-1.0 (inventories), so yes that's ok! We've
created a repository such it will be read by anything that supports
one of darcs-1.0 or hashed-inventory.
So much for reading. Now what would happen if we tried to write to the
repository with an older darcs? Writing repositories is a much more
demanding affair in that we must not only know about one property from
every line, we must now know about *every* property from every line. In
our example, darcs-1.0.8 doesn't know anything about hashed-inventory,
and if it tried to write to this repository it might mess up all the
lovely hashy stuff. Luckily it stops itself from trying to write to it
because it notices that the repository contains a property it does not
Now let's try this with a more elaborate example. Darcs development has
been going swimmingly, it's 2010, world domination, lots of new patch
types, everything works brilliantly. I create a repository with a new
I dig my old darcs unstable ca 2007-01 out, try to do a darcs get and...
Can't understand repository format: darcs-2.0-conflict-resolution
Can't understand repository format: fancy-new-feature even-better-one
And I'm happy! Because my old darcs didn't lie to me about what it
doesn't know how to do; it just told me up front that it is no match for
darcs-2010. And that's ok because at least it's being honest about it.
Likewise, it would also refuse to write to this fancy new repo on
similar grounds. And now if I dig out a darcs-2009 which supports every
new feature except for even-better-one, what would happen is... left as
exercise to the reader.
And that concludes my very longwinded version of the repo format story,
which Benedikt just fixed because we would have accidentally said
missing the pipe and confusing darcs-1.0.8 into thinking it can't read
from this repo because it doesn't know about 'darcs-1.0
Eric Kow http://www.loria.fr/~kow
PGP Key ID: 08AC04F9 Merci de corriger mon français.