You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Nicolas Ramz <ni...@gmail.com> on 2015/05/27 14:12:53 UTC

Detecting root directory of repositiory

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 ?

Thank you,
-- 
*Nicolas RAMZ*
*Développeur Web*
nicolas.ramz@gmail.com | +33 6 43 34 73 47
www.warpdesign.fr | @warpdesign <http://www.twitter.com/warpdesign_>_
<https://www.twitter.com/warpdesign_>
windowsfun.fr | @wp_fun <https://twitter.com/wp_fun>

Re: Detecting root directory of repositiory

Posted by Pavel Lyalyakin <pa...@visualsvn.com>.
Hello Nicolas,

On Wed, May 27, 2015 at 3:12 PM, Nicolas Ramz <ni...@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

Re: Detecting root directory of repositiory

Posted by Branko Čibej <br...@wandisco.com>.
On 27.05.2015 14:12, Nicolas Ramz wrote:
> Is there a way to detect that current directory is the root of SVN
> repositiory by reading files into .svn directory ?

Please do not make any assumptions about the structure and contents of
the .svn directory. The only way to access that information should be
through the 'svn' command-line or the API.

-- Brane