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

Re: CVS update: subversion/subversion/libsvn_wc apply_delta.c

From: Greg Stein <gstein_at_lyra.org>
Date: 2000-08-31 16:10:46 CEST

On Thu, Aug 31, 2000 at 01:44:18PM -0000, gstein@tigris.org wrote:
> User: gstein
> Date: 00/08/31 06:44:18
>
> Modified: subversion/include svn_wc.h
> subversion/libsvn_wc apply_delta.c
> Log:
> (svn_wc_get_change_walker): ADDED. provides a walker structure for effecting
> change against the working copy.

This function is *completely* untested. apply_delta.c still doesn't compile.
However, the logic seems pretty close.

WARNING: RA/DAV assumes that it can hold many dir_batons, parent_batons, and
file_batons at once. Specifically, a breadth first search of:

      A
     / \
    B C
    |
    D

This tree would be evaluated as A, B, C, D. Note that D is evaluated after
the traversal has "moved on" to C. The finish_directory calls go: D, C, B, A

The current WC code assumes a depth-first traversal. You must call
finish_directory on B (and D) before calling add_directory for C. This is
the whole "telescoping" thing vs. creating new batons.

I'm not sure whether requiring the walker to be used in a depth-first
traversal is a Good Thing or not. My first reaction is that depth-first
implies a recursive "producer". In my current code, I throw dirs onto the
end of a list (and just iterate over the list until it is empty) which
effects a breadth-first search.

Personally, I'd rather avoid stack-based recursion in SVN (would there be a
DoS or other attack that blows your stack?). That's why the breadth-first is
attractive, and why I implemented that on the first shot.

Thoughts?

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:07 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.