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

Re: Copy directory non-recursively

From: Matthew Hannigan <mlh_at_zip.com.au>
Date: 2007-07-13 03:50:11 CEST

On Thu, Jul 12, 2007 at 05:07:07PM -0700, Matt Madrid wrote:
> Is there any way to copy a directory.. but not it's contents .. from
> one place to another.
>
> Take this structure:
>
> trunk/
> stuff/
> file1
> file2
> file3
>
> The following command...
>
> svn cp trunk/stuff branches/branch1/
>
> ...will of course result in the stuff directory and all of it's
> contents to be copied recursively. But what if I want only certain
> files in stuff to be copied, so that I end up with a branch like this:
>
> branches/
> branch1/
> stuff/
> file1
>
> How do I do that? I've tried this:
>
> svn cp trunk/stuff/file1 branches/branch1/
>
> But that only copies the file to the top level of the branch, with no
> directory creation.
>
> Or this:
>
> svn cp trunk/stuff/file1 branches/branch1/stuff/
>
> Which creates a file called stuff in the branch that is a copy of file1.
>
> I suppose I could create the directory stuff manually with "svn
> mkdir", but then I wouldn't have any history information kept. Also,
> if the directories happened to be nested a few levels deep, I would
> need to create each level manually(mkdir -p would be nice), again
> losing all history information.
>
> Any ideas? Am I missing something. Thanks..
>

Copy it all and then delete what you don't want.
The space required will hardly be different due to SVN's COW behaviour.

Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jul 13 03:48:58 2007

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.