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

Re: SVN Copy Question...

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Tue, 23 Dec 2008 02:29:16 -0600

On Dec 22, 2008, at 13:44, BRM wrote:

> I have two repository trees I am working on merging; however, it is
> not possible to merge the changes between the trees because they
> are from separate modules in a previous CVS repository.
> I'd like to use the SVN Copy (or SVN move) commands to be able to
> track the merging; however, I usually get an error that the file
> already exists.
>
> Is there a way to do the svn copy/move and overwrite an existing
> file in the same transaction?

I don't think there's a command to overwrite an existing file
specifically, but you can certainly delete the existing file and
replace it with a new file or a file copied from elsewhere all in the
same transaction.

> (i.e. instead of having to go delete the file first, then do the
> copy/move second, do it as a single commit, or have the copy/move
> comit the changes between the two files as the commit..).

You can either get a working copy of the repository and do the delete
and move there before committing:

$ svn checkout $REPO_URL wc
$ cd wc
$ svn delete foo/myfile
$ svn copy bar/myfile foo/myfile
$ svn commit -m "replacing foo/myfile with bar/myfile"

Or if you want to do everything with repository URLs without a
working copy, then you can use the svnmucc command line client
instead of the usual svn command line client. I don't have an example
handy but here's its usage message:

$ svnmucc
Multiple URL Command Client (for Subversion)

Usage: svnmucc [OPTION]... [ACTION]...

Actions:
   cp REV URL1 URL2 copy URL1_at_REV to URL2
   mkdir URL create new directory URL
   mv URL1 URL2 move URL1 to URL2
   rm URL delete URL
   put SRC-FILE URL add or modify file URL with contents copied
                         from SRC-FILE
   propset NAME VAL URL Set property NAME on URL to value VAL
   propdel NAME URL Delete property NAME from URL

Options:
   -h, --help display this text
   -m, --message ARG use ARG as a log message
   -F, --file ARG read log message from file ARG
   -u, --username ARG commit the changes as username ARG
   -p, --password ARG use ARG as the password
   -U, --root-url ARG interpret all action URLs are relative to ARG
   -r, --revision ARG use revision ARG as baseline for changes
   -n, --non-interactive don't prompt the user about anything
   -X, --extra-args ARG append arguments from file ARG (one per line;
                         use "-" to read from standard input)
   --config-dir ARG use ARG to override the config directory

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=990449

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2008-12-23 09:30:21 CET

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.