lock free dirstate - prototype
Matthew D. Fuller
fullermd at over-yonder.net
Wed Sep 30 06:19:30 BST 2009
On Wed, Sep 30, 2009 at 02:13:36PM +1000 I heard the voice of
Andrew Cowie, and lo! it spake thus:
>
> Format:
> control: Meta directory format 1
> working tree: Working tree format 6
> branch: Branch format 7
> repository: Repository format 2a - rich roots, group compression and chk inventories
>
> [...]
>
> So I imagine I don't know is what a Branch format is, or what a Working
> Tree format is [and Control is entirely new on me. Apparently I don't
> use `bzr info -v` very often].
Control is the format of .bzr/, which is the same for everything more
recent than the all-in-one 'weave' format. And for that and earlier
formats, it's the ONLY format, since there wasn't the split among them
back then.
With the Meta1 Control format, there are 3 potential subsidiary
formats. Working Tree is the format of .bzr/checkout/, Branch of
.bzr/branch/, and Repository of .bzr/repository/.
> Ah. You said "tree format". That means Working Tree format, I
> assume? And that's "local" [only]?
Correct. The only time (theoretically at least) the WT format matters
at all is when you're running bzr locally against it. Across any
remote protocol it wouldn't be involved at all, so it wouldn't matter
if the remote bzr had ever heard of it.
> Hm. Apparently there are 4 parameters to the format(x, y, z, a)
> function.
>
> Well. I think I already knew that "2a" is a Repository format.
Alternately, there are 4 formats potentially involved in any bzrdir.
But the UI almost always deals with synthetic 'rollup' names, which
are aliases for a given 4-ple (except for 'weave' and earlier, which
are aliases for a 1-ple). And when your bzrdir has one of the number
of 4-ples that don't have given names, you get the 'unknown' output.
Of course, as alluded to above, the Control really determines what
happens underneath. A future Control format may have 4 formats
under it, so rollups with it would be 5-ples. The pre-Meta1
Control formats didn't have any additional formats under them, so
the rollup is a 1-ple.
"2a" can be fuzzy at that level of resolution. It's a name for the
repository format:
> repository: Repository format 2a - rich roots, group compression and chk inventories
but it's also the 'rollup' name for the 4-ple (Meta1, Repository2a,
WorkingTree6, Branch7). Similarly 'dirstate' is the name of a [class
of] working tree formats, but also was the name of a given rollup
(Meta1, Knit1, WorkingTree4, Branch5). Sometimes discussions need to
disambiguate :|
---------------------------------
The following is purely my own opinion, and shouldn't be taken as an
attack against people holding contrary ones:
I have to wonder if the rollup names don't cause more problems than
they solve. As with any abstraction, the goal is to conceal
unnecessary detail. But, I'm not sure it's really unnecessary. And
the downside is that when something happens that breaks that
abstraction (like ending up with 'unknown' rollups), users have to
know something about what's under it anyway to figure out what's going
on. And IMO it's friendlier to say "this is how it works" right off,
rather than "this is how it works, oops, sorry, now you have to know
how it REALLY works". Consider having a pack-0.92 branch in a repo:
Repository tree (format: pack-0.92)
Format:
control: Meta directory format 1
working tree: Working tree format 4
branch: Branch format 6
repository: Packs containing knits without subtree support
Then you upgrade --2a the branch (not the repo). Now suddenly we're
unknown!
Repository tree (format: unnamed)
Format:
control: Meta directory format 1
working tree: Working tree format 6
branch: Branch format 7
repository: Packs containing knits without subtree support
Knowing how things /work/, the situation is pretty easy to work out.
And it's a _perfectly valid_ state of affairs! It may well not be
what a user intended, but (Meta1, KnitPack1, WT6, Branch7) is a 4-ple
you can work with all day and not have any troubles with. It's just
never had a rollup name put onto it. But with the shallower view you
have if you stop at the rollup level, you don't have anywhere to stand
and understand what's going on.
Certainly some of those leaks are implementation bugs, and should and
potential can be fixed. I'm not sure I believe all are, though; the
ability to separately deal with WT's, Branches, and Repos is something
basic that makes bzr bzr, rather than a variant of some other VCS.
--
Matthew Fuller (MF4839) | fullermd at over-yonder.net
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
On the Internet, nobody can hear you scream.
More information about the bazaar
mailing list