3

I've been looking at SVN manuals but unable to find out simple usage examples or explanations of the "--incremental" option for "svn log" and "svn st".

I'm writing an open-source SVN GUI front-end so I need some basics about the usage of this flag.

You can see the noting of the --incremental here: http://durak.org/sean/pubs/software/version-control-with-subversion-1.6/svn.ref.svn.c.status.html

But it doesn't say anything about how to use it.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Simon
  • 183
  • 2
  • 7

2 Answers2

4

It's documented in svn help log and svn help status:

--incremental : give output suitable for concatenation

It means don't generate the outermost elements in XML mode, i.e. rather than

<?xml version="1.0"?>
<log>
<logentry> ... </logentry>
<logentry> ... </logentry>
</log>

which generates a complete, well-formed XML document, just generate

<logentry> ... </logentry>
<logentry> ... </logentry>

so that you can concatenate multiple svn log --xml --incremental -rX:Y outputs together, i.e.

svn log --xml --incremental -r 1:1000 > log.xml

and

svn log --xml --incremental -r   1:250  > log.xml
svn log --xml --incremental -r 250:500  >> log.xml
svn log --xml --incremental -r 500:750  >> log.xml
svn log --xml --incremental -r 750:1000 >> log.xml

will generate exactly the same output.

Rup
  • 33,765
  • 9
  • 83
  • 112
0

I can say that this incremental option helps you to maintain your own log from client perspective.

Let us say you have done log till latest revision to a file,

svn log > latestrevision.log

Now pipe this file to the svn log --incremental command to get updated log instead of double entries.

cat latestrevision.log | svn log --incremental > latestrevision.log

shiva
  • 21
  • 4
  • `svn log --incremental > latestrevision.log` will clobber whatever is in latestrevision.log. If you run with or without the `cat`, svn outputs the same content -- even if you modify the log messages in latestrevision.log. So it doesn't seem like it's using stdin at all. – idbrii Aug 19 '21 at 17:28