Brian Denny <brian@briandenny.net> writes:
> (1) I *think* that the editor could "do the right thing" by
> always generating a delta when the source directory is missing --
> i.e., if the directory is present in the target, do an
> add (restore), and if it's absent in the target, do a delete. But
> that would also require some way of signaling a missing path to the
> reporter as distinct from a deleted path (not to mention that i have
> no idea how the missing item should be represented in the transaction
> "source tree").
'svn update' will replace missing directories, even if nothing has
changed in the repository. Can that mechanism be used to cause the
delete to get sent?
> (2) Do everything as we are doing it, but in recursively_tweak_entries,
> check for a missing directory, and just remove the parent dir's
> entry for it (i.e., assume that any directory which is still missing
> at the end of an update.
>
> Idea #2 seems a *lot* simpler -- but is it too hacky?
It looks like a bit of a timebomb--removing an entry that has not been
deleted would be a serious mistake.
> I'm open to other ideas. I just barely understand the update code now,
> so there may be some clean, simple solution that i'm missing.
>
> -brian
>
> p.s., Here's a one-off patch for idea #2:
>
> Index: subversion/libsvn_wc/adm_ops.c
> ===================================================================
> --- subversion/libsvn_wc/adm_ops.c (revision 5680)
> +++ subversion/libsvn_wc/adm_ops.c (working copy)
> @@ -105,12 +105,28 @@
> else if (current_entry->kind == svn_node_dir)
> {
> svn_wc_adm_access_t *child_access;
> - const char *child_path
> - = svn_path_join (svn_wc_adm_access_path (dirpath), name, subpool);
> - SVN_ERR (svn_wc_adm_retrieve (&child_access, dirpath, child_path,
> - subpool));
> - SVN_ERR (recursively_tweak_entries
> - (child_access, child_url, new_rev, subpool));
> + const char *child_path, *path;
> + apr_hash_t *dirents;
> + svn_boolean_t missing;
> +
> + path = svn_wc_adm_access_path (dirpath);
> + svn_io_get_dirents(&dirents, path, subpool);
> + missing = (apr_hash_get (dirents, name, APR_HASH_KEY_STRING)
> + == NULL);
> +
If this is the best approach then don't implement it like that, use
svn_wc__adm_missing instead.
> + if (missing)
> + {
> + svn_wc__entry_remove (entries, name);
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 20 23:44:47 2003