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

RE: how to detect read-only branch from client?

From: Bert Huijben <bert_at_qqmail.nl>
Date: Wed, 15 Feb 2017 14:50:13 +0100

> -----Original Message-----
> From: Torsten Mueller [mailto:muellerto_at_runbox.com]
> Sent: woensdag 15 februari 2017 08:41
> To: users_at_subversion.apache.org
> Subject: Re: how to detect read-only branch from client?
> Andrew Reedick <jreedick_at_incomm.com> schrieb:
> > Not a complete solution, but it's a start. Craft a "svn mkdir" that
> > includes the url to test and a url that will always fail
> That's it. The key is to create a nested directory in a branch, this
> means a directory which has a non-existing parent, and doing that
> without the --parent parameter:
> Test/ro is a readonly branch
> Test/rw is a normal (read/write) branch
> trying to create directory "a/b":
> $ svn mkdir -m"xx" https://repository/svn/Binaries/Test/ro/a/b"
> svn: E175013: Access to '/svn/Binaries/!svn/txr/50-1u/Test/ro/a/b'
> forbidden
> $ svn mkdir -m"xx" https://repository/svn/Binaries/Test/rw/a/b"
> svn: E160013: Try 'svn mkdir --parents' instead?
> svn: E160013: File not found: transaction '50-1v', path '/Test/rw/a/b'
> This gives two distiguishable messages: in the first case it fails
> because of the readonly property, in the second case because of the
> missing --parent parameter. No revision is made iin both cases - great.

A better way would be to perform the operation, but *not* specify a log
message and configure no editor either. In that case the operation will fail
client side after these checks via the missing log message.

But then there is always the option that the read-only-ness is applied via a
hook script... And in this case this trickery just fails.

Received on 2017-02-15 14:50:34 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.