views:

25

answers:

5

I would like to take all the commit messages in my subversion log and just concatenate them into one text file, preferably using the svn command line on windows.

Each commit message has this format:

- r1 message
- r1 message
- r1 message

What I would like is something like:

- r1 message
- r1 message
- r2 message
- r2 message
- r3 message
[...]
- r1000 message

Update

I thought the above was clear, but what I don't want in the log is this type of info:

r2130 | user| 2010-03-19 10:36:13 -0400 (Fri, 19 Mar 2010) | 1 line

No meta data, I simply want the commit messages.

A: 

from the windows command line, not sure how to get rid of the lines of -------

svn log - q > svn.log
BioBuckyBall
I updated my question to be a little more clear, since this method adds metadata that is undesired.
user144182
updated answer.
BioBuckyBall
This gets rid of commit message, leaving the --------- and the revision identifier lines.
user144182
sorry, I somehow missed the 'message' in your fake output. In that case you are going to need to parse the output in which case @Davide Gualano has a workable answer
BioBuckyBall
A: 

Withn Tortoise SVN you can right-click, select Tortoise/Show Log. Select all logs and paste them in a file.

I updated my question to be a little more clear, since this method also adds metadata that is undesired.
user144182
A: 

If you're a Java developer, you can use SVNKit to write exactly the kind of Subversion extract program you wish.

Otherwise, as others have answered, you can take the log output and manually manipulate it.

Gilbert Le Blanc
+2  A: 

You can use the --xml parameter of the svn log command, which set the output format to xml, and than easily parse it with some scripting language to produce the text file you need.
In python something like:

from xml.dom.minidom import parse
xml = parse("log.xml")
entries = xml.getElementsByTagName("logentry")
for e in entries:
    rev = e.getAttribute("revision")
    msg = e.getElementsByTagName("msg")[0].firstChild.nodeValue
    print "-r" + rev + " " + msg

Save it as parseLog.py, and then simply launch

svn log --xml > log.xml
python parseLog.py > revisions.txt
Davide Gualano
Seems there is no easy way to do this with the command line only, this is acceptable since most of my installs have python. Also the "rx" in the log was simply to identify the log message, not that I want the revision number specifically in the message. Thank you though, this will work with some changes.
user144182
+1  A: 

As Davide Gualano suggested you can use the --xml command to produce a output which can be parsed. Use an arbitrary xslt processor and a xslt file to produce the output you need. See svn2cl for an example.

tobsen