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

Re: calling svn copy twice...

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 8 Dec 2010 17:35:55 +0200

Michael Kessler wrote on Wed, Dec 08, 2010 at 16:24:56 +0100:
> Am Mittwoch, den 08.12.2010, 15:06 +0100 schrieb Ludwig, Michael:
> > > > I don't understand this behaviour. I expect an error message.
> >
> > > That's actually perfectly analogous to the behaviour of the unix
> > > cp command, when copying directories:
> >
> > > So svn's cp behaviour is simply based on the standard behaviour
> > > of cp.
> >
> Buf if you call the svn copy a third time it will throw an error and
> does not change anything in the repo.
>
> Futher calls of "cp -r src dest" do not result in a error message and
> anything in src will be copied to dest/src all the time.
>
> > And there is no special treatment for branches/ or tags/, they're
> > just like any other directory, even though they probably have
> > special meaning to most users.
> >
> > Michael
>
> Yes, the trunk/tags/branches is logical concept.
>
> To avoid changes of existing tags I'll use "svn info" to check if my
> destination tag directory exists and abort if it does, otherwise i do
> the the svn copy.
>

And is it possible to say:
        "Copy $URL1 to $URL2 *unless* $URL2 already exists"
?
(in an atomic manner)

I'm not sure. Perhaps
        svnmucc mkdir $URL2 rm $URL2 copy $URL1 $URL2
will do the trick, but I haven't tested it...

> Cheers
> Michael
>
>
>
>
>
>
>
>
>
>
Received on 2010-12-08 16:38:25 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.