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

Re: Is it possbile to check out a single folder?

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-05-19 12:54:37 CEST

caoqiuliang@crisen.com wrote:
>>Please include your exact commands so that we can recreate your actions.

Please keep this on the list.

> Suppose we have the following folder structure in a repository named db.
> db
> Help (folder)
> file1 (file)
> file2 (file)
> ch (folder)
> file3 (file)
> file4 (file)
> After executing the command line:
> svn co -N file:///h:/db/Help h:/myClient/Help
> The content of "Help" appeared in the local working folder.
> But when I tried to do the same operation to the folder ch by:
> svn co -N file:///h:/db/Help/ch h:/myClient/Help/ch
> The following error occurred:
> Working copy "myClient/Help/ch" not locked.
> What I want to do is: checking out the folder when necessary instead of
> checking out the whole repository at start. But it seems that it is
> impossible to check out a folder and then its subdirectory.

What version of Subversion are you running; I have no problem whatsoever with
doing exactly that sequence (not on Win32). I get a disconnected WC inside my
first WC (exactly like my example #2 below).

There are several other possibilities to try:

1) Don't check out the second folder inside the working copy of the first folder

I don't know what your actual use-case is, since you don't describe why you want
to cherrypick from your repository (other than size). If these two directories
are related in the repository, but are logically independent otherwise (i.e. you
don't need ../Help/ch in order to maintain ../Help), you can check out the inner
folder anywhere you want:

        svn co -N file:///h:/db/Help/ch h:/myClient/Help-ch

2) Try to check it out from within the existing WC (using an implied destination):

If you cd into the directory, you can perform the checkout locally (without
affecting the contents of the current WC)

        cd h:/myClient/Help
        svn co -N file:///h:/db/Help/ch

NOTE: that this will not affect the WC, and so the following may be somewhat

        svn st
        ? ch

i.e. the current WC (that is the Help directory) will have no notion that the
./ch directory is in any way related. It'll look like an unversioned directory,
yet if you cd into it, it will be a fully functional WC.

Hence, if you do any Subversion command (e.g. 'svn up') from within the Help
directory, it will not automatically update the ./ch directory. This is
somewhat like the case with svn:externals, except that you can delete the ./ch
directory at any time and the next 'svn up' won't try to recreate it.



John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed May 19 12:55:16 2004

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.