Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting the svn log output

I have been generating change logs in subversion using the svn log command. To make it easier to read, I'd like to add a newline after each revision's comments. If the output initially appears like this:

------------------------------------------------------------------------
Revision 1
------------------------------------------------------------------------
Revision 2
------------------------------------------------------------------------

I would like it to appear like this instead:

------------------------------------------------------------------------
Revision 1


------------------------------------------------------------------------
Revision 2


------------------------------------------------------------------------

I tried using the following command in batch:

FOR /L %%i IN (starting_revision, 1, ending_revision) DO (

svn log branch_name -r %%i --incremental >> output.txt
echo. >> output.txt
echo. >> output.txt

)

This seemed to work initially, but since not every one of the revisions was made to the branch I am working on, it ended up printing extra newlines in some parts of the text file. Does anyone know how I might avoid this problem?

like image 896
Raj Prabakhar Avatar asked Jun 13 '14 17:06

Raj Prabakhar


People also ask

How do I view svn logs?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.

Where are svn logs stored?

By default going to be in /var/log/httpd .


1 Answers

You can use --xml option with the svn log command-line. Parsing xml'ed output will allow you to format it in any way you want.

like image 89
bahrep Avatar answered Oct 11 '22 23:10

bahrep