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?

2 Answers 2

6

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.

Sign up to request clarification or add additional context in comments.

Comments

6

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.

1 Comment

This is such a great answer! Piping the output gives you so many options. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.