How to get local root path in svn?

Mercuril, Git, and Bazaar have a way to get the root of the path:

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

How to print 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/ 
+7
source share
4 answers

I did a search and found nothing ... Finally I saw an old friend svn info and saw if it works for you ...

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

Hope this helps !!!

+3
source

Did the Working Copy Root Path from the svn info 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 check, which seems to be what you are looking for. You can use the --xml switch, which sometimes simplifies the programming process, since most programming languages ​​are well versed in XML analysis.

If you are searching for the root of the repository separately from the URL scheme, you can get this by extracting the root repository from the URL field.

+3
source

If you install the SlikSvn client, you can do “svn information” at any level of verification, and it will return the local root path.

0
source

I am using svn info | awk -F: '/Root Path: (.*)/ { print $2 }' | xargs svn info | awk -F: '/Root Path: (.*)/ { print $2 }' | xargs svn info | awk -F: '/Root Path: (.*)/ { print $2 }' | xargs for Linux and Windows via Cygwin.

0
source

All Articles