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

Re: svn copy driving me nuts - how to overwrite URLs in a vendor tree?

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-04-30 12:08:10 CEST

On Apr 30, 2007, at 00:38, hans henderson wrote:

> On 4/30/07, Matthew Hannigan wrote:
>> I think my svnset script would help you.
>> Archived, for instance, here:
>> http://svn.haxx.se/users/archive-2007-03/0113.shtml
>> Matt
> Thanks Matt, and hate to look a gift horse in the mouth, but:
> I'm a total noob relative to you all, not only regarding svn, but I
> don't even know what language your script is in. Is it like a batch
> file?
> I'm on Windows.

This script is for UNIX-like operating systems (as it says in the
message: "it's only for Unix anyway .. or cygwin I guess"). For UNIX
script files, the first line often tells you what language it's in
(or rather, what program to run to interpret the file). In this case:


That's the Korn shell. I don't use Windows so I don't know if the
Korn shell is available on Windows. I suspect not. You could use it
and most other UNIX software if you install Cygwin. If you don't want
to do that, and Korn shell is not available natively, you'll have to
rewrite the script in a language that is available on Windows, like
batch, Perl, Python, VisualBasic, etc.

> So I guess the answer to my fundamental question is "yes, subversion
> doesn't (easily) allow you overwrite one versioned tree with another,
> creating a new branch with changes tracked". Again, my specific
> example of what I was after:
> svn copy
> <URL path to>/new-add-on-fileset/xampp (5000 files in 870 directories)
> on top of
> <URL path to>/existing-core-fileset/xampp (14000 files in 4000
> folders)
> adding the new files/folders and overwriting the existing files
> (maybe 20% of
> the source fileset)
> And here's my workaround, suggestions for a more elegant solution
> would be most welcome:


> I plan to first checking the filesize of my repo, then do a commit and
> check again to confirm I've avoided adding a duplicate 300MB.
> As I said, it's a kludge, so any other suggestions are welcome.

Delete the directory, then copy it again. Subversion copies are
cheap, so this will take virtually no disk space in the repository:

svn delete <URL path to>/existing-core-fileset/xampp \
-m "Deleting xampp from existing-core-fileset"

svn copy <URL path to>/new-add-on-fileset/xampp \
<URL path to>/existing-core-fileset/xampp \
-m "Copying xampp from new-add-on-fileset to existing-core-fileset"

This will create two revisions; between these two commands, a
revision will exist where existing-core-fileset/xampp does not exist.
That's not elegant. If that's a problem for you, you may want to
investigate using mucc, the multiple-URL command client, which may be
able to do these two operations in one revision. mucc is part of the
Subversion source distribution.

> PS is it really the case that *nix cp doesn't allow you to overwrite
> one directory tree with another? What kind of workarounds do y'all do
> there?

The tar command can be used for that. It's common to see instructions
like "untar the new archive over the old directory." tar can also
operate on filesystem items directly, without using any archives,
which I think would be the equivalent of what you're asking. tar is
however not really applicable to manipulating the contents of
Subversion repositories.

To reply to the mailing list, please use your mailer's Reply To All  
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Apr 30 12:09:03 2007

This is an archived mail posted to the Subversion Users mailing list.