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

[DESIGN] libsvn_wc can't run loggy operations from log file

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2006-06-28 08:18:40 CEST

Well, right before I thought I finished making svn_wc_merge2 loggy, I
found out libsvn_wc has big problems with running the log file
svn_wc_merge2 generates when called from a log file.

The problem
=========
When writing a log file to make a function loggy, there is no way to
know which logfiles already exist as created by other functions. In
the case from svn_wc_merge2, this means we overwrite log file 0
(.svn/log).

Then, not knowing we're called from a log file, svn_wc_merge2 calls
svn_wc__run_log which runs all existing logs. When run from a log
file, there may exist more log files than the one we just created from
svn_wc_merge2. svn_wc__run_log runs *all* logs, not just the one we
need it to run...

A solution
=========

One solution would be to create specific prefixes to the logs:

 update-log.*
 merge-log.*

That way a caller can tell svn_wc__run_log *which* log file it wants
to run and overwriting of log files can be prevented; with the
exception of 1 case: an operation calls itself from a log file.
(Currently we don't do that: update calls merge, but merge doesn't
call update or itself.)

Pro: quite simple to implement
Con: we can no longer assume we run all logs by running log, log.1 ..
log.n; we'll need to find '*log' and run all logs from the result list
(which by extention of our old scheme runs *log.1 .. *log.n too).

Another solution
============

Another solution - which would keep the log.1 ... log.n scheme without
prefixes - is to move the log file creation counter to the adm_access
structure and let svn_wc__write_log handle not overwriting existing
logs.

In this case, a system has to be created to run exactly 1 log file.

Pro: ?
Con: The numbering of log.1 .. log.n may become discontinuous, so, we
need a system to find all logs (which is in effect the same problem as
above).
Con: more invasive.

Well, I'd like some expert opinions on this one. I understand this
issue will need a wc-format bump, no matter which solution we choose.
Given the extent of the code which needs modifying, I don't think
proposing backport to 1.4 is realistic, so, it looks like 1.5 will
have a wc-format number bump too :-(

Please shoot!

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 28 08:19:13 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.