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

RE: Svn tags and branch creation

From: Patwardhan, Rajesh <rajesh.patwardhan_at_etrade.com>
Date: 2007-08-29 17:46:19 CEST

 

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2007b@ryandesign.com]
Sent: Monday, August 27, 2007 1:16 AM
To: Patwardhan, Rajesh
Cc: users@subversion.tigris.org
Subject: Re: Svn tags and branch creation

On Aug 26, 2007, at 23:56, Patwardhan, Rajesh wrote:

> Wondering how users are handling the creation of tags and branches if
> a branch or tag already exists ...
>
> For e.g
> 1/ Url: http://svn.mycompany.com/svn/
>
> 2/ I have the typical project -- trunk
> branches --|
> --> mybranch
> tags
>
> Now if a branch for e.g. mybranch exists and I try to create it again
>
> 3/ svn copy $URL/trunk $URL/branches/mybranch now if the mybranch
> exists then I would expect the svn operation to fail ..
> But I get
> mybranch/trunk
>
> Any hints or scripts.

>>> The behavior of the svn cp command is consistent with the behavior
of the Unix cp command.

Agreed: This is as per unix but in unix I can do test to see if the
directory \ file I am copying exists in the destination.
How can I simulate that with Subversion.
Is svn ls the only method or could someone suggest other alternatives.
Is there a hook someone else already has ...

> I am contemplating using svn ls from within the pre-commit hook.
> But svn ls for existing or non existing url only returns a exit code
> of 0, so I have to rely on the message returned by the command ...
>
> In case it exists then listing else non existent url error message.
>
> Is this message guaranteed to not change?

If you're talking about parsing for the message "svn: URL 'http://
whatever/branches/whatever' non-existent in that revision" then I would
advise against that. Sure, it could change.

"svn ls <nonexistent_url>" does return an exit status of 1, so I would
recommend using that instead. I'm using Subversion 1.4.4; if you're
using an earlier version, you should probably upgrade. This may have
been fixed recently.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Aug 29 18:07:15 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.