Gilbert V
Gilbert V

Reputation: 1040

SVN getting todays log from using a batch file.

I am trying to write up a batch file that would run a schedule where it would get an log file in xml. Now whenever the batch file would run it would get it for today.

This is what I written very basic, Maybe reason why I am getting it wrong.

svn log -v -r {%date%} --xml http://repositorylocation.com > op7.xml

Now when I do that I get not only the date i need but the three letter ancrynom for day. And i need that removed but dont know how . Any advice?

I am running this on Windows XP.

Thank you.

Upvotes: 3

Views: 262

Answers (2)

Gus
Gus

Reputation: 6881

http://subversion.tigris.org/issues/show_bug.cgi?id=2849

The above seems to suggest that you could effect the date format by tweaking your locale, but that's a pretty bad hack... If the date format you are getting is reliably adding 0's in front of month and day hatbyzero's might work

The painful but extremely reliable way to do it is to parse the xml, parse the date and then reformat the date, set the value in the xml and then write the the fixed xml to a file This might be doable in groovy using xml slurper.

http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+XmlSlurper

Upvotes: 2

hatboyzero
hatboyzero

Reputation: 1937

Try the following:

set MONTH=%date:~4,2%
set DAY=%date:~7,2%
set YEAR=%date:~10,4%

That should give you the Month, Day, and Year, respectively. You can then handle that in your log file any way you want, i.e.

svn log -v -r {%MONTH%-%DAY%-%YEAR%} --xml http://repositorylocation.com > op7.xml

Upvotes: 1

Related Questions