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

Re: Detecting root directory of repositiory

From: Pavel Lyalyakin <pavel.lyalyakin_at_visualsvn.com>
Date: Wed, 27 May 2015 15:41:31 +0300

Hello Nicolas,

On Wed, May 27, 2015 at 3:12 PM, Nicolas Ramz <nicolas.ramz_at_gmail.com> wrote:
> Is there a way to detect that current directory is the root of SVN
> repositiory by reading files into .svn directory ?
>
> I think "svn info" could be used for that. Problem is that some machines may
> not have access to "svn" command line (if using tortoise and svn is not in
> command PATH for example).
>
> In case "svn info" (or any other command line) is the only way, what would
> be the proper way to do it ?

Beginning with Subversion 1.8, `svn info` prints repository-relative
URLs. See Subversion 1.8 Release Notes entry at
http://subversion.apache.org/docs/release-notes/1.8.html#svn-info.

For example, if you run `svn info` at the root of the repository, you'll see
[[[
...
Relative URL: ^/
Repository Root: https://svn.example.com/svn/TestRepo
...
]]]

If you run `svn info` in a subtree, you'll see

[[[
...
Relative URL: ^/TestProject/trunk
Repository Root: https://svn.example.com/svn/TestRepo
...
]]]

--
With best regards,
Pavel Lyalyakin
VisualSVN Team
Received on 2015-05-27 14:42:20 CEST

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.