On Wed, May 07, 2003 at 04:44:19PM -0500, email@example.com wrote:
> Brian Denny <firstname.lastname@example.org> writes:
> > I'm thinking that cleaning up missing/deleted dirs right *before* the
> > call to maybe_bump_dir_info might be the right thing?
> > No, wait, maybe_bump_dir_info can recurse up the directory tree... so
> > the cleanup needs to happen *inside* that loop?
> Hm... I'm not able to say without re-learning what that code does.
> I'll try to take a look at this later and help you make a decision.
Alright, here is a stab at cleaning up this loose end. I don't know
how to create a test for this case since it requires that the process
be interrupted at a particular point, but I checked by hand that a
scenario which, without this patch, would leave behind an entry for
the missing item, now does the right thing.
Comments welcome (as always).
Followup to r5814 (Issue #1075 - update receiving delete for missing
directory). Make sure to clean up missing directories any time we bump
a revision number.
(maybe_bump_dir_info): For each directory that we actually bump,
remove any entries for missing or 'deleted' children.
--- subversion/libsvn_wc/update_editor.c (revision 5877)
+++ subversion/libsvn_wc/update_editor.c (working copy)
@@ -295,6 +295,8 @@
+ apr_hash_t *entries, *dirents;
+ apr_hash_index_t *hi;
if (--bdi->ref_count > 0)
return SVN_NO_ERROR; /* directory isn't done yet */
@@ -338,6 +340,38 @@
+ /* Clean up deleted/missing directories. */
+ SVN_ERR (svn_wc_adm_retrieve (&adm_access, eb->adm_access, bdi->path,
+ SVN_ERR (svn_wc_entries_read (&entries, adm_access, TRUE, pool));
+ SVN_ERR (svn_io_get_dirents (&dirents, bdi->path, pool));
+ for (hi = apr_hash_first (pool, entries); hi; hi = apr_hash_next (hi))
+ const void *key;
+ apr_ssize_t klen;
+ void *val;
+ const svn_wc_entry_t *current_entry;
+ /* Get the next entry */
+ apr_hash_this (hi, &key, &klen, &val);
+ current_entry = val;
+ /* Skip THIS_DIR. */
+ if (! strcmp (key, SVN_WC_ENTRY_THIS_DIR))
+ /* If the item is a 'deleted' or missing dir, remove it. */
+ if (current_entry->kind == svn_node_dir
+ && (current_entry->deleted
+ || (! apr_hash_get (dirents, key, klen))))
+ svn_wc__entry_remove (entries, current_entry->name);
+ } /* end entries loop */
+ SVN_ERR (svn_wc__entries_write (entries, adm_access, pool));
/* we exited the for loop because there are no more parents */
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Sat May 10 06:51:25 2003