[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Re: Subdirectory support
From: |
graydon hoare |
Subject: |
[Monotone-devel] Re: Subdirectory support |
Date: |
Tue, 25 May 2004 15:16:40 -0400 |
User-agent: |
Mozilla Thunderbird 0.5 (X11/20040208) |
Adam Logghe wrote:
I think the answer changes depending on how much you are editing
upstream and importing upstream changes. Trying to track lots of changes
in your dependencies is going to hurt no matter the tool.
there are a few things you might mean by "subdirectory support":
1: running monotone in a subdirectory and having it jump up a few dirs
to find the MT/ dir above it
1.1: having this cause the command to *act* only on the files in the
invoked subdirectory, such as diffing a subdir.
1.2: making it possible to check out, edit, and commit a subset of
a complete tree, never actually seeing the whole tree due to
some sort of sticky, persistent "mask".
1.3: coming up with some sensible form of merging partial trees,
say by committing your partial merge to each side of a fork
2: storing some kind of "link to another project marker" such that
checking out a "super-tree" checks out a bunch of "sub-trees" from
different histories / branches / organizations automatically.
now, I think we've already decided on #1 as being desirable, achievable,
necessary. no problem there aside from finding time to implement it.
I think I know a pretty simple way to do #2 using "today's technology"
though: make a persistent file attribute in .mt-attrs called, say, "module":
path/to/subproject module 607a036b350db1d65291d2520ec0a0d22630eb5c
other/project module 435e816c30263c9184f94e7c4d5aec78ea7c028a
then add the following to the std_hooks.lua file:
attr_functions["module"] =
function(dir, hash)
if (os.execute("test -d " .. dir) ~= 0) then
io.write("checking out module in " .. dir)
os.execute("monotone co " .. dir .. " " .. hash))
end
end
this is essentially a rip-off of arch's "configs", except it works "out
of the box" and would be relatively painless to switch a directory from
being a normal directory to being a module (independently versionned):
just make a new manifest for the subtree, drop the subtree from the
parent, and add a module link. you could even make an integrated command
to do this, and to re-attach a module to the parent, if you change your
mind. I've been considering making some utility commands for managign
the .mt-attrs file anyways.
the only difficulty I can see with this is informing, say, netsync that
you need to pull the subtree along for the ride (else you won't *have*
the subtree on hand to checkout). easiest approach there would be to
name the subtree branches with a common prefix, and serve the prefix as
a collection. this is not too hard, since branches can overlap; you can
for example pick up a 3rd party library (also using monotone) and give
it a branch name in "your" namespace.
-graydon