Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get local root path in svn?

Mercuril, Git and Bazaar has a way to get path root:

git rev-parse --show-toplevel
hg root 
bzr root

How print the local root path in subversion?

Update

Example:

> svn checkout https://example.com/svn/foo ~/foo --username fabiocerqueira
> cd ~/foo
> svn root (don't works)
  /home/user/project/foo/
like image 902
fabiocerqueira Avatar asked Aug 16 '12 16:08

fabiocerqueira


People also ask

How do I find my SVN repository path?

You need to find the virtual host in your apache configuration and look for a <Location> section that matches your url path and look for a SVNPath or SVNParentPath config line. This will tell you the location of your subversion repository.

How do I access my TortoiseSVN repository?

You can either store your repositories locally and access them using the file:// protocol or you can place them on a server and access them with the http:// or svn:// protocols. The two server protocols can also be encrypted. You use https:// or svn+ssh:// , or you can use svn:// with SASL.

How do I clone a local repository in SVN?

# Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have ...


2 Answers

Did some search and found nothing... Finally I saw the old friend svn info and see if works for you...

$ svn info | grep 'Root'
Repository Root: http://your.subversion.com/path/to/root

Hope this helps!!!

like image 112
Bharat Sinha Avatar answered Oct 05 '22 22:10

Bharat Sinha


Would the Working Copy Root Path from the svn info command provide what you need?

D:> svn info
Path: .
Working Copy Root Path: D:\workdir\local-tc-common-all
URL: svn://localhost/trunk/tc-common-all/src/main/bin
Repository Root: svn://localhost
Repository UUID: 4f1d1789-e46b-c140-9c77-f79c92213374
Revision: 61
Node Kind: directory
Schedule: normal
Last Changed Author: dweintraub
Last Changed Rev: 3
Last Changed Date: 2012-07-19 12:09:24 -0400 (Thu, 19 Jul 2012)

This gives you the root of the current checkout which seems to be what you're looking for. You can use the --xml switch which sometimes makes it easier to get programmatically since most programming languages are pretty good at parsing XML.

If you're looking for the root of the repository itself separate from the URL scheme, you could get that by taking the Repository Root out of the URL field.

like image 32
David W. Avatar answered Oct 05 '22 23:10

David W.