[darcs-users] cheap in-repo local branches (just needs implementation)

Grant Husbands darcsusers at grant.x43.net
Wed Jul 22 21:28:31 UTC 2009


(resending)

Max Battcher <me at worldmaker.net> wrote:
> Darcs happily works with a superposition of patches in
> _darcs/patches.

Agreed.

> You seem to me to be under some sort of misapprehension about the way darcs
> patches/inventory/contexts work.

Ditto.

> Darcs will still have access to:
> 1) All patches across all branches (that are stored and/or cached locally)

Only superficially correct, as far as I can see. Darcs has access to
the files, yes. What it doesn't have is an accessible record of which
file corresponds to which patch+context. (Even if it reads every
single one, it needs the corresponding inventories to know context for
each.)

Essentially, all the patch/inventory files that Darcs can reach, as
far as I know, are:
1. The active inventory
2. Anything referenced by an inventory it has reached, which includes:
2a. Parent inventories
2b. Patches/Tags
(pristine files omitted for clarity)

They are the only significant places that actually give the filenames
necessary to find a patch or inventory. Without the filename, you
don't have the patch; the patch name is not sufficient. A context does
not contain the filenames, so a context is not sufficient unless it's
a subset/parent of the current inventory. Darcs must use the active
inventory to find the filenames for the patches of interest. So, if
the context mentions patches/tags that are not in the current
inventory chain, it cannot be understood.

> (darcs push and darcs send really are equal citizens in darcs.)

Yes, and they both require a sufficient inventory for both ends, for
which a context file may be insufficient.

(If this discussion continues, do you agree that it should be possible
to demonstrate either for or against what you're talking about with
the current beta darcs and some file copying? My testcase would be
that branchB contains a couple more tags than the other branch, in the
original proposal, such that the context generated by 'darcs changes
--context' in branchB mentions things not in the other branch.)

G.


More information about the darcs-users mailing list