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

RE: Re: Copy directory non-recursively

From: Srilakshmanan, Lakshman <lakshman.srilakshmanan_at_police.vic.gov.au>
Date: 2007-07-13 05:46:23 CEST

Hi Matt,

I don't quite understand why you would want to copy part of a
trunk/stuff. I would copy all trunk/stuff and modify only the files I
need.

Be aware that if you copy and delete as described by Matthew Hannigan,
and then try to merge your branch back to trunk, you may have
undesirable results.

Thanks
Lakshman

-----Original Message-----
From: Matthew Hannigan [mailto:mlh@zip.com.au]
Sent: Friday, 13 July 2007 11:50 AM
To: Matt Madrid
Cc: users@subversion.tigris.org
Subject: Re: Copy directory non-recursively

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

=======================================================
The information contained in this email and any files attached may
be confidential information to the intended recipient and may be
the subject of legal professional privilege or public interest immunity.

If you are not the intended recipient, any use, disclosure or copying is
unauthorised.

If you have received this document in error please telephone 1300 307 082

*******************************************************************
This footnote also confirms that this email message has been swept
for the presence of computer viruses.
*******************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jul 13 05:48:13 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.