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

multi-arg commits

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2001-05-14 23:32:14 CEST

OK, we've been holding off tagging M2 until multi-target commits
work. I've been rewriting the commit driver
(libsvn_wc/adm_crawler.c), and last Friday Karl & I had a marathon
debugging session into the wee hours of night.

I've finally figured out what's wrong.

Originally there was *one* recursive driver routine. This routine had
two local variables:

   * path: the current directory you're examining the entries of
   * dir_baton: the baton that goes with path. (possibly NULL)

At any point in the recursion, a local mod could cause a 'bubbling up'
of batons in the "stack" linked-list. This was fine; if we returned
from several levels of recursion, we might discover that the local
'dir_baton' variable was no longer NULL -- it had been changed as a
bubble-up side-effect by a change deeper down. This was intentional;
we kept on using it if we wanted to recursively descend again. It
worked out great.

Now we have the recursion split between *two* routines that call one
another; this was to accomodate the special case of committing a
single file in a directory, rather than looping over all dirents. As
a result, 'dir_baton' is no longer a local heap variable that differs
at each level of recursion; it gets passed around as a double pointer.
This is causing great logical problems.

When I reverted back to single-pointers, the problem swung too far the
other direction; now the local 'dir_baton' variables in each routine
are losing context *too often*.

My conclusion is that the best thing to do is go back to a single
recursive function at the cost of not factorizing code where one
could. I'm going to rewrite now, trying to improve readability as
much as I can. :)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:30 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.