cedrajin21
cedrajin21

Reputation: 65

How to get the revision number from a svn tag using groovy

Does any one know how can i extract the revision number using groovy from a svn tag

-r revision http://svn/....

output : revision

is there a equivalent of sed in groovy or something?

Thanks in advance

Upvotes: 2

Views: 1193

Answers (1)

pczeus
pczeus

Reputation: 7868

You can run a Groovy script, using the GString.execute() method to accomplish this:

def url = "http://your.subversion.url/svn/YourRepository"
println "svn info --show-item last-changed-revision $url".execute().text

Which will print out the latest revision number for that SVN path.

Upvotes: 3

Related Questions