[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r943445 - in /subversion/trunk/subversion: svn/cl.h svn/log-cmd.c svn/main.c tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 12 May 2010 14:33:06 +0200

On Wed, May 12, 2010 at 08:13:55AM -0400, Mark Phippard wrote:
> It would also be easy to script and that has always been our position
> on adding options like this. Especially if we cannot implement the
> option internally more efficiently than the script.

Oh, it's not quite the same thing. What I wrote in the log message
has apparently mislead you. Sorry. Let me try to explain better:

To get the same output (log message, diff, log message, diff, etc.)
a script would be even slower because it would have to open an entirely
new connection to the server to get the log of every single
revision. It would work like this:

for rev in [1-1000]:
  svn log -r $rev
  svn diff -r ($rev - 1):$rev

While the command line client can do this:

client: server, give me all log messages from r1 to r1000 over a single
* server starts spooling log information to the client.
while server is spooling:
  * client opens another connection (#2)
  client: I just got the log for rN. What would svn diff -r(N-1):N do?
  * server starts diff-editor drive
  client: thanks!
  * client prints diff
  * client closes connection #2

So in this example the script needs about 1000 connections more
than the client does.

The script could achieve a similar level of performance by using
three threads:
T1: svn log -r 1-1000
T2: for rev in [1-1000]:
      svn diff -r ($rev - 1):$rev
and a third thread that joins the output the other two appropriately.
But I don't think anyone would bother to write such a script.
In fact, adding the feature to the CLI client was fairly easy,
probably easier than a wrapper script that does the above.

Received on 2010-05-12 14:33:45 CEST

This is an archived mail posted to the Subversion Dev mailing list.