You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by ca...@crisen.com on 2004/05/19 08:48:02 UTC

Is it possbile to check out a single folder?

Hi,

On the client side, is it possbile to check out a single folder?
I tried through the "-N" flag and it seems to have succeeded. But problem
occurs when I try to check out a subdirectory of this folder. The content of
the error message is "Working copy *** not locked."

It seems to me that, single folder operation is possible. But one has to
check out the entire repository the first time when he/she uses the
repository, so as to put the local files under version control. The problem
for me is that, my repository is very large, it seems to be foolish to fetch
the entire repository for accessing only one folder.

What seems to be the reason?

Thanks in advance.

Qiuliang


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by John Peacock <jp...@rowman.com>.
Ben Collins-Sussman wrote:
> caoqiuliang@crisen.com wrote:
> 
> 
>> (2) Is setting the Apache the only way to implement the security model? 
> 
> 
> Yes, apache and mod_authz_svn is currently the only way to have 
> per-directory permissions.  Chapter 6 explains mod_authz_svn.
> 

If I can expand a little on what Ben said, the important word in that sentence 
is "currently" for your purposes.  There is active work being done on a 
repository ACL model which may be part of 1.1 (or at least 1.x, i.e. not 2.0). 
There are a couple of more important features (locking/reserved checkout for 
one), but I know that the ACL feature is up there in the priorities.

So, if you can use Apache and mod_authz_svn for now, you might be able to move 
to a more flexible model as soon as possibly 1.1, when it comes out (which is 
not scheduled AFAIK).

HTH

John

-- 
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

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

Posted by Ben Collins-Sussman <su...@collab.net>.
caoqiuliang@crisen.com wrote:

> (1) Is it possible to use Subversion in a way that I don't need to check out
> the entire repository at the first time? 

Sure.  Just checkout subdirectories as you need them, as individual, 
non-nested working copies.


> (2) Is setting the Apache the only way to implement the security model? 

Yes, apache and mod_authz_svn is currently the only way to have 
per-directory permissions.  Chapter 6 explains mod_authz_svn.

> If so, it there any possible problem if I set the permission level to each
> folder (there may be too many folders in the repository) separately for each
> user and in the meanwhile, the permission-level setting need to be changed
> frequently?

No, that is not a problem.  HTTP is a stateless protocol.  Every time 
the client makes a request, the authorization file is parsed.  So you 
can change the permissions over and over without having to restart apache.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by ca...@crisen.com.
> As others have already pointed out, the -N flag doesn't work like that (at
least
> not consistently).  You should also not rely on the -N to be part of your
> security model.  Subversion is not Source[un]Safe; you need to examine
what you
> really need, rather than trying to recreate your existing SS model exactly
in SVN.

Thank you for your suggestion.
Now I have two questions that I am very eager to know the answer. If the
answer is NO, then I'll give up.
(1) Is it possible to use Subversion in a way that I don't need to check out
the entire repository at the first time? (In my case, I need to keep the
local folder structure the same as that on the server side.)
(2) Is setting the Apache the only way to implement the security model? If
so, it there any possible problem if I set the permission level to each
folder (there may be too many folders in the repository) separately for each
user and in the meanwhile, the permission-level setting need to be changed
frequently?

Thank you very much.

Qiuliang


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by John Peacock <jp...@rowman.com>.
caoqiuliang@crisen.com wrote:

Don't respond directly to me; keep this on the list so that others can gain from 
your question

> 
> I am using 1.0.2 r9423 on Windows.

Upgrade to 1.0.3 ASAP - the Windows binaries were just released.  There is a 
serious security fix in 1.0.3 that requires an immediate upgrade (especially if 
you have a publically accessible repository).

> In a word, what I want my version control system to be is: check out a
> folder when necessary and only when necessary due to the fact that the
> repository may be very large. In the meanwhile keep the local folder
> structure exactly the same as on the server side. Checking out the entire
> repository across InterNet is time consuming. That is the fact that makes me
> think of the use of '-N' flag.

As others have already pointed out, the -N flag doesn't work like that (at least 
not consistently).  You should also not rely on the -N to be part of your 
security model.  Subversion is not Source[un]Safe; you need to examine what you 
really need, rather than trying to recreate your existing SS model exactly in SVN.

>>2) Try to check it out from within the existing WC (using an implied
> destination):
> 
> I tried but the thing doesn't change.
> 

I'll try and check this out if I can; this may be a bug in the Win32 client, 
since there is no problem doing this with the Unix client.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by John Peacock <jp...@rowman.com>.
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 
suprising:

	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.

HTH

John

-- 
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

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

Posted by John Peacock <jp...@rowman.com>.
caoqiuliang@crisen.com wrote:
> On the client side, is it possbile to check out a single folder?
> I tried through the "-N" flag and it seems to have succeeded. 

Of course it is possible.

$ svn co -N http://svn.collab.net/repos/svn/trunk/doc svn-docs
A  svn-docs/doxygen.conf
A  svn-docs/svn-doc.el
A  svn-docs/README
  U svn-docs
Checked out revision 9778.

$ cd svn-docs

$ ls
doxygen.conf  README  svn-doc.el

$ svn info
Path: .
URL: http://svn.collab.net/repos/svn/trunk/doc
Repository UUID: 65390229-12b7-0310-b90b-f21a5aa7ec8e
Revision: 9778
Node Kind: directory
Schedule: normal
Last Changed Author: sussman
Last Changed Rev: 9768
Last Changed Date: 2004-05-18 17:37:46 -0400 (Tue, 18 May 2004)
Properties Last Updated: 2004-05-19 05:33:12 -0400 (Wed, 19 May 2004)


However, you cannot "check out" a directory into an existing working copy (WC), 
which seemed to be what your previous message was suggesting.

 > But problem
 > occurs when I try to check out a subdirectory of this folder. The content of
 > the error message is "Working copy *** not locked."

Please include your exact commands so that we can recreate your actions.

John

-- 
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