You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Campbell, Nina" <ni...@t-tales.com> on 2016/12/05 11:48:51 UTC

SVN copy multiple files

Is there a way to copy multiple files from WC to URL in one revision? In my current setup I am copying files from the working copy to a repository URL, so the copy is immediately committed. These files can be in multiple directories. However this means the target repository's revision number is incremented per file.

The only suggested solutions I've found seem to be:

1) Put all of the files on the command line together (e.g. "svn copy file1 file2 file3 destination_URL") however I need to provide support for a large number of files with long paths

2) Copy the files individually and then do one commit, however in my case I need to allow the user to copy files to a repository they don't have a working copy for

3) Create a temporary working copy directory, copy all of the files there, and then copy that directory to tag. I'd rather not clog up the working copy repository's log with committing and deleting temp files that are being copied to tag

For committing files in a single revision I use --targets but there doesn't seem to be a 'copy' equivalent of this command. Am I missing something obvious?

Thanks in advance.

RE: SVN copy multiple files

Posted by "Campbell, Nina" <ni...@t-tales.com>.
From: Pavel Lyalyakin [mailto:pavel.lyalyakin@visualsvn.com]
> Have you tried `svnmucc` Subversion Multiple URL Command Client?

> http://svnbook.red-bean.com/en/1.8/svn.ref.svnmucc.re.html

Thank you, I hadn't heard of svnmucc. I've taken a look and I can see the advantages of it when doing multiple operations (e.g. delete, copy, then move), but if I'm just copying files I don't see how it differs from doing "svn copy file1 file2 file3 [...] DEST_URL"?

I was hoping for a method that didn't require putting all of the file paths on the same command line (because they are very long, and a large number of files might be selected). This is why --targets was so useful when committing files, because I could write all of the file paths to a .txt beforehand and then just operate on that .txt.

Thanks for the help.

Re: SVN copy multiple files

Posted by Pavel Lyalyakin <pa...@visualsvn.com>.
Hello Nina,

On Mon, Dec 5, 2016 at 2:48 PM, Campbell, Nina
<ni...@t-tales.com> wrote:
> Is there a way to copy multiple files from WC to URL in one revision? In my
> current setup I am copying files from the working copy to a repository URL,
> so the copy is immediately committed. These files can be in multiple
> directories. However this means the target repository’s revision number is
> incremented per file.

Have you tried `svnmucc` Subversion Multiple URL Command Client?

http://svnbook.red-bean.com/en/1.8/svn.ref.svnmucc.re.html

--
With best regards,
Pavel Lyalyakin
VisualSVN Team

Re: SVN copy multiple files

Posted by Johan Corveleyn <jc...@gmail.com>.
Sorry, I misread your question (I read --parents instead of --targets
... must have my eyes checked ;-).

-- 
Johan

On Mon, Dec 5, 2016 at 2:38 PM, Campbell, Nina
<ni...@t-tales.com> wrote:
> Thanks for your response. I am already handling the intermediate directories, the issue I'm having is copying multiple files to a URL in the same revision without having to put all of their paths on the command line. Sorry if I was unclear! (I mentioned --targets as an example because it allows the user to operate on a single file containing all of the desired files' paths.)
>
> Cheers.
>
> From: Johan Corveleyn [mailto:jcorvel@gmail.com]
>> 'svn copy' does have a --parents option (introduced in 1.8 or 1.9, I'm not sure):
>
>> [[[
>> C:\>svn help copy
>> copy (cp): Copy files and directories in a working copy or repository.
>> usage: copy SRC[@REV]... DST
>
>>   SRC and DST can each be either a working copy (WC) path or URL:
>>    WC  -> WC:   copy and schedule for addition (with history)
>>     WC  -> URL:  immediately commit a copy of WC to URL
>>     URL -> WC:   check out URL into WC, schedule for addition
>>     URL -> URL:  complete server-side copy;  used to branch and tag
>>   All the SRCs must be of the same type. When copying multiple sources,
>>   they will be added as children of DST, which must be a directory.
>
>>...
>
>>   --parents                : make intermediate directories
>> ]]]

RE: SVN copy multiple files

Posted by "Campbell, Nina" <ni...@t-tales.com>.
Thanks for your response. I am already handling the intermediate directories, the issue I'm having is copying multiple files to a URL in the same revision without having to put all of their paths on the command line. Sorry if I was unclear! (I mentioned --targets as an example because it allows the user to operate on a single file containing all of the desired files' paths.)

Cheers.

From: Johan Corveleyn [mailto:jcorvel@gmail.com] 
> 'svn copy' does have a --parents option (introduced in 1.8 or 1.9, I'm not sure):

> [[[
> C:\>svn help copy
> copy (cp): Copy files and directories in a working copy or repository.
> usage: copy SRC[@REV]... DST

>   SRC and DST can each be either a working copy (WC) path or URL:
>    WC  -> WC:   copy and schedule for addition (with history)
>     WC  -> URL:  immediately commit a copy of WC to URL
>     URL -> WC:   check out URL into WC, schedule for addition
>     URL -> URL:  complete server-side copy;  used to branch and tag
>   All the SRCs must be of the same type. When copying multiple sources,
>   they will be added as children of DST, which must be a directory.

>...

>   --parents                : make intermediate directories
> ]]]

Re: SVN copy multiple files

Posted by Johan Corveleyn <jc...@gmail.com>.
On Mon, Dec 5, 2016 at 12:48 PM, Campbell, Nina
<ni...@t-tales.com> wrote:
...
> For committing files in a single revision I use --targets but there doesn’t
> seem to be a ‘copy’ equivalent of this command. Am I missing something
> obvious?

'svn copy' does have a --parents option (introduced in 1.8 or 1.9, I'm
not sure):

[[[
C:\>svn help copy
copy (cp): Copy files and directories in a working copy or repository.
usage: copy SRC[@REV]... DST

  SRC and DST can each be either a working copy (WC) path or URL:
    WC  -> WC:   copy and schedule for addition (with history)
    WC  -> URL:  immediately commit a copy of WC to URL
    URL -> WC:   check out URL into WC, schedule for addition
    URL -> URL:  complete server-side copy;  used to branch and tag
  All the SRCs must be of the same type. When copying multiple sources,
  they will be added as children of DST, which must be a directory.

...

  --parents                : make intermediate directories
]]]

-- 
Johan