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

Re: working copy corruption when network connection lost

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-05 01:14:44 CET

Ben Collins-Sussman <sussman@collab.net> writes:

> Philip Martin <philip@codematters.co.uk> writes:
>
> > Yes, this seems to work, although decrement_ref_count turned out to be
> > where I made the link to the parent.
>
> Why in decrement_ref_count, and not close_directory? Just curious.
> decrement_ref_count is really only supposed be about knowing when it's
> okay to free a pool, I thought.

Since I wrote that I have moved it into free_dir_baton :-)

Why is it there and not in close_directory? Well, decrement_ref_count
is the only place that checks the ref_count at present, it seemed like
a violation of this "rule" for close_directory to check it explicitly

   if (db->ref_count == 1) /* 1 is the magic number, probably... */
      make the link if added
   err = decrement_ref_count(db);
   if (err)
     return err;

Also free_dir_baton already has one svn_wc__entry_modify call to set
the new directory revision, a second to set the parent's entry seems
natural.

That said I don't really see what the ref_count achieves. It goes up
when subdirectories or files are opened, but these will be closed and
the ref_count decremented before the directory is closed. Is there
ever a case when close_directory calls decrement_ref_count and the
ref_count does not equal 1? Something to do with postfix text deltas
perhaps?

-- 
Philip
---------------------------------------------------------------------
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:54 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.