[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 13:27:47 CEST

On Apr 29, 2007, at 14:49, hans henderson wrote:

> My latest XAMPP-only "core" tree is here:
> repos/website/vendors/apache-friends/xamppcore/v1.61/xampp
>
> This currently happens to be exactly the same as:
> repos/website/vendors/current
>
> I've done an import of the Perl add-on installation tree to here:
> repos/website/vendors/apache-friends/perl-add-on/v5.8.8.819/xampp
>
> I would like to:
>
> svn copy svn://localhost/vendors/apache-friends/perl-add-on/
> v5.8.8.819/xampp \
> svn://localhost/vendors/current \
> -m "copying the Perl add-on v5.8.8.819 over /current/xampp"
>
> but that gives me:
>
> svn: Path 'current/xampp' already exists

I reread your first message above and I now understand what you're
trying to do. Deleting and copying, as I suggested, clearly doesn't
accomplish what you're trying to accomplish here. I'll restate the
problem as I understand it:

You are trying to store XAMPP in your repository, which apparently is
distributed as a core and then various modules. You have imported
these as

/vendors/apache-friends/xamppcore/v1.61/xampp
/vendors/apache-friends/perl-add-on/v5.8.8.819/xampp

You have copied xamppcore/v1.61/xampp to

/vendors/current/xampp

And the intention is that you would like to now "get all of perl-add-
on/v5.8.8.819/xampp into current/xampp too" and "svn cp" isn't doing
the job for you.

As has been explained, "svn cp" is not designed to do this job. It
does not work like the Windows Explorer copy function, which merges
the contents of the two folders. It does not work like the Mac OS
Finder copy function, which asks you if you want to delete the
existing directory before copying the new directory. It functions
like the UNIX "cp" command, which behaves as described in the cp
manpage. I was going to suggest reading "svn help cp" too, but I see
that it doesn't actually explain this aspect. Hopefully the
Subversion Book at http://svnbook.org does a better job.

The way you're using "current" here is nonstandard. The standard way,
according to the Vendor Branches chapter of the book, would be to
have a "current" for each thing that you import or load in. As I
explained earlier, svn_load_dirs.pl needs this. (Well, it doesn't
need it, strictly speaking, but it's the way the documentation
describes it.) Assuming that xamppcore and perl-add-on are two things
that you download from some web site, then those are the levels at
which you would have "current". (I'm going to call it "perl-add-on-1"
from now on since I assume there are multiple perl add-ons that you
might have.) So then:

/vendors/
        xamppcore/
                current/
                1.61/
        perl-add-on-1/
                current/
                5.8.8.819/
        perl-add-on-2/
                current/
                5.8.8.842/

The point of the vendor section of the repository is to track things
that others have distributed, the way they have distributed it. If
you want to combine these parts in some way, or modify them in other
ways, you should do so outside of /vendors. It could look like this:

/my-xampp/
        trunk/

To initially create my-xampp, do this (assuming that the directory
structure in xamppcore/current and perl-add-on-1/current are identical):

svn mkdir svn://localhost/my-xampp \
-m "Making empty directory for my-xampp"

svn cp svn://localhost/vendors/xamppcore/1.61 \
svn://localhost/my-xampp/trunk \
-m "Copying xamppcore/1.61 to trunk"

svn checkout svn://localhost/my-xampp/trunk

cd trunk

Now you need to "somehow" bring perl-add-on-1/5.8.8.819 into that
trunk working copy. I was going to suggest a merge:

svn merge -r0:HEAD svn://localhost/vendors/perl-add-on-1/5.8.8.819

Unfortunately that doesn't seem to work ("svn: Unable to find
repository location for 'svn://localhost/vendors/perl-add-
on-1/5.8.8.819' in revision 0"). Possibly this could be made to work
with the proper --diff3-cmd argument. You might have to write a
special diff3 script.

If you can't get this to work, you'll have to manually issue "svn cp"
commands, copying all the pieces from vendors/perl-add-on-1/5.8.8.819
into the right places in my-xampp/trunk. Finally you commit it with
the log message "Adding perl-add-on-1/5.8.8.819 to my-xampp." It's
essential that you always record the version number in the log message.

Now that you have my-xampp/trunk set up, it'll be easy to update it
in the future. If a new version 1.62 of xamppcore is released, you
use svn_load_dirs.pl to load it in to vendors/xamppcore/current and
copy it to vendors/xamppcore/1.62. Then you can merge it into your my-
xampp trunk working copy:

cd trunk

svn merge svn://localhost/vendors/xamppcore/1.61 \
svn://localhost/vendors/xamppcore/1.62

svn ci -m "Upgrading to xamppcore 1.62"

The same goes for perl-add-on-1 or any other part.

The only way you'll know that you need to merge from xamppcore/1.61
in this example is if you record in the log messages that 1.61 was
the last version you used, or if you happen to remember it off the
top of your head.

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Apr 30 13:28:36 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.