SVN copy multiple files

561 views
Skip to first unread message

Campbell, Nina

unread,
Dec 5, 2016, 6:49:40 AM12/5/16
to us...@subversion.apache.org

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.

Pavel Lyalyakin

unread,
Dec 5, 2016, 6:53:25 AM12/5/16
to Campbell, Nina, us...@subversion.apache.org
Hello Nina,

On Mon, Dec 5, 2016 at 2:48 PM, Campbell, Nina
<nina.c...@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

Johan Corveleyn

unread,
Dec 5, 2016, 8:12:36 AM12/5/16
to Campbell, Nina, us...@subversion.apache.org
On Mon, Dec 5, 2016 at 12:48 PM, Campbell, Nina
<nina.c...@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

Campbell, Nina

unread,
Dec 5, 2016, 8:30:48 AM12/5/16
to Pavel Lyalyakin, us...@subversion.apache.org
From: Pavel Lyalyakin [mailto:pavel.l...@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.

Campbell, Nina

unread,
Dec 5, 2016, 8:39:10 AM12/5/16
to Johan Corveleyn, us...@subversion.apache.org
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.

Johan Corveleyn

unread,
Dec 5, 2016, 9:01:00 AM12/5/16
to Campbell, Nina, us...@subversion.apache.org
Sorry, I misread your question (I read --parents instead of --targets
... must have my eyes checked ;-).

--
Johan
Reply all
Reply to author
Forward
0 new messages