Easy way to get SVN repository URL for ant build
I'm in the sad process of migrating a Mercurial repository to Subversion. Our ant build grabbed the version of the working copy and stuck it in the build product using hg id -i
, for purposes of traceability. This global ID is all you need to know to track down the version that was built.
Of course, it's not that easy with SVN. I know how to get the version of the working copy (or, ahem, range of versions in the WC) using svnversion
, but that alo开发者_开发知识库ne doesn't tell you the full story: you need to know which branch or tag you're on.
Is there an easy way to grab the repository URL corresponding to a WC path? What I want is the 'URL' line that's returned from svn info
, but I really don't want to parse multi-line output to get it. There has to be an easy way to get just that information back.
Doesn't there?
I miss my DVCS. :(
From the command line it looks like you're pretty much stuck parsing svn info. However you can use the svn ant tasks to help you out http://subclipse.tigris.org/svnant/svntask.html#info. This will set a bunch of properties one of which is your repo url, I suspect it will be repourl but that isn't super well documented, it might be url.
精彩评论