[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Fixing "checkout -N"? (possible contracting gig)

From: Steve Johnson <steve_at_Equilibrium.com>
Date: 2005-11-14 17:08:35 CET

Greetings,

I've been exploring what can be done with the existing implementation. I
have become convinced that, in and of itself, a fix to "checkout -N" won't
actually be all that valuable.

I've written a python script that implements a working "checkout -N". It
first does a regular "checkout -N". Then, for each directory at the next
level, it does an "empty directory" checkout to that directory. Finally, it
adds each directory to the parent directory's "entries" file. This gives
you the equivalent to the fix of stubbing out unwanted directories by
"switching" to empty directories, without having to first check everything
out of the tree.

The problem with this is that it's REALLY SLOW when done over WAN
connections. The individual "checkout -N" operations take much longer than
they should. This, along with doing a "list" on each directory, eats up
much of the savings over checking out the whole tree to begin with. My
worry is that even if "checkout -N" worked correctly, this same speed issue
would make it almost worthless.

My motivation for getting "checkout -N" fixed is to take it one step
further. What I want is not "checkout -N", but rather:

   checkout -select product=DeBabelizer -select platform=Macintosh <URL>

What this would do is traverse the <URL> tree, checking out only those
directories that were applicable for the Debabelizer Macintosh product. It
would do this by looking for properties named "product" and "platform" on
each directory in the tree. If it found such a property, it would exclude
that directory if the value of the property did not "match" the value
indicated in the checkout command. This way, you would get a trimmed tree
with only one checkout command. You'd get all the benefits of using
"checkout -N" to prune the tree yourself (through your own script), without
the speed degredation.

I was persuing this option with the svn community a few months back. I
generated significant interest, but it was decided that until "checkout -N"
is fixed, there's no use in talking about an auto-pruning operation. Such
an op would have to be built on the basic ability to prune parts of the tree
manually.

What I've decided to do is use the "pre-created skeleton working dirs" hack.
This was discussed in the group a week or so ago, and it turns out that
others do this too. For each configuration you want to support, you build
an empty skeleton of directories for that purpose. Engineers can then start
with that skeleton, and do a "svn up" at the top of it to check out a work
tree. They will get a pruned tree, and everything in svn will work just
fine.

Here's what you do to build such a skeleton:

a) Check out a complete tree
b) Throw away all the files (except in .svn dirs, of course)
c) Prune out those directories you don't want using the "switch to an empty
directory" hack.

I've written a python script that merges this idea with my idea for pruning
a tree via properties. I now have a command that builds these skeletons
that is called like this:

   makeSkeleton -s product=Debabelizer -s platform=Macintosh <URL> <Dir>

I get the trimmed trees I want by simply setting product/platform properties
on key directories in my source tree. This seems like it will work really
well (just rolling it out now).

Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 14 17:14:05 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.