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

Re: singl file checkout

From: David L <idht4n_at_gmail.com>
Date: Thu, 30 Oct 2008 13:06:48 -0700

On Thu, Oct 30, 2008 at 7:36 AM, Mark Eichin <eichin_at_gmail.com> wrote:
> The faq is still true, as worded - you can't check out a file in
> isolation, without any supporting directory structure at all. For
> your example, though, with 1.5, you can do
>
> svn co --depth=empty REPOURL/foo
> svn update --depth=empty foo/bar
> svn update --depth=empty foo/bar/src foo/bar/include
> svn update foo/bar/src/a.c foo/bar/include/a.h
> svn update --depth=empty foo/blah
> svn update --depth=empty foo/blah/include
> svn update foo/blah/include/blah.h
>
That works, thanks!

Now another related question. The two reasons I like to check out
only the files I need for a project are checkout times and diskspace.
I was surprised to find that checking out the 162 directories I need
for the ~1000 files in one of my projects took 120 seconds (not even
including checking out the files). I verified that this was partly because
I'm using svn+ssh to access the repository. I'm guessing it must
be using ssh 162 times to create the 162 directories.? Is there a
way to make this process more efficient?

Thanks,

                  David

PS -
I wrote a simple little script that, given a file containing a list of
files, will create a list of all of the directories that need to be
updated before updating that list of files to check them out.
It's not too efficient, but I think it works:

#!/bin/bash
for i in `cat $1`; do
    dn1=`dirname $i`
    dn="$dn $dn1"
done
dn2=`echo $dn | tr ' ' '\n' | sort -u`
for i in $dn2; do
    dn1=`dirname $i`
    dn2="$dn2 $dn1"
    dn1=`dirname $dn1`
    while [ "$dn1" != "." ]; do
        dn2="$dn2 $dn1"
        dn1=`dirname $dn1`
    done
done
dn3=`echo $dn2 | tr ' ' '\n' | sort -u`
echo $dn3

This functionality really should be built into svn IMHO.

> and then svn update foo, svn commit foo, svn status foo should all do
> what you expect...
>
> On Wed, Oct 29, 2008 at 12:32 PM, David L <idht4n_at_gmail.com> wrote:
>> I know that more recent versions of svn have support for checking
>> out a single file. http://subversion.tigris.org/issues/show_bug.cgi?id=823
>> is theoretically fixed. But the documentation in the faq still says you
>> can't do it:
>>
>> http://subversion.tigris.org/faq.html#single-file-checkout
>>
>> "Subversion does not support checkout of a single file,
>> it only supports checkout of directory structures.
>> However, you can use 'svn export' to export a single file.
>> This will retrieve the file's contents, it just won't create a
>> versioned working copy."
>>
>>
>> I'm still looking for a way to checkout only the files I need for a project.
>> To pull a use-case example from bug 823, if I have a directory tree like this:
>>
>> foo/
>> bar/ blah/ reallybig/
>> src/ include/ src/ inlude/
>> a.c b.c a.h b.h blah.c blah.h
>>
>> If I do:
>>
>> cvs co foo/bar/src/a.c foo/bar/include/a.h foo/blah/include/blah.h
>>
>> then if I do:
>> "cvs update foo", I'll only get the changes that were made to a.c, a.h, and
>> blah.h. It will not bring in b.c, b.h, blah.c and reallybig. If I pass the -d
>> flag to cvs update then it will bring in the other stuff.
>>
>> How do I use the new depth features of svn to do the equivalent
>> of the single cvs checkout line above? Note that I want to replicate
>> the directory structure above each of the files I check out and I want
>> each of those directories to be versioned checkouts. For example,
>> If I cd to foo, and do "svn status", I don't want it to say:
>> ? bar
>> ? blah
>> I want it to tell me the status of the files below.
>>
>> Thanks,
>>
>> David
>>
>> PS - not subscribed, please CC responses to me.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
>> For additional commands, e-mail: users-help_at_subversion.tigris.org
>>
>>
>
>
>
> --
> _Mark_ <eichin_at_thok.org> <eichin_at_gmail.com>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-31 23:22:12 CET

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

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