6

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?

Raj Prabakhar
  • 165
  • 1
  • 3
  • 7

2 Answers2

5

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.

bahrep
  • 29,961
  • 12
  • 103
  • 150
5

If you want one line log then you can use

svn log | perl -l40pe 's/^-+/\n/'

I want one line log so I used above command.

rahul.sapkal23
  • 707
  • 9
  • 15