On Tue, May 13, 2003 at 04:59:08PM -0500, sussman@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_wc/entries.c Tue May 13 16:59:06 2003
>...
> @@ -327,6 +331,34 @@
> }
> }
>
> + /* Is this entry incomplete? */
> + {
> + const char *incompletestr;
> +
> + incompletestr = apr_hash_get (atts, SVN_WC__ENTRY_ATTR_INCOMPLETE,
> + APR_HASH_KEY_STRING);
> +
> + entry->incomplete = FALSE;
> + if (incompletestr)
> + {
> + if (! strcmp (incompletestr, "true"))
> + entry->incomplete = TRUE;
> + else if (! strcmp (incompletestr, "false"))
> + entry->incomplete = FALSE;
> + else if (! strcmp (incompletestr, ""))
> + entry->incomplete = FALSE;
These other two states are not possible. The flag can be present and set to
"true", or it will not be present. There isn't a need to check for "false"
or the empty string.
>...
> +++ trunk/subversion/libsvn_wc/update_editor.c Tue May 13 16:59:06 2003
>...
> @@ -299,45 +298,14 @@
> if (--bdi->ref_count > 0)
> return SVN_NO_ERROR; /* directory isn't done yet */
>
> - /* Bump this dir to the new revision if this directory is, or is
> - beneath, the target of an update, or unconditionally if this
> - is a checkout. */
> - if (eb->is_checkout || bdi->parent || (! eb->target))
> - {
> - apr_uint32_t modify_flags = SVN_WC__ENTRY_MODIFY_REVISION;
> -
> - tmp_entry.revision = eb->target_revision;
> - tmp_entry.url = bdi->new_URL;
> -
> - if (bdi->new_URL)
> - modify_flags |= SVN_WC__ENTRY_MODIFY_URL;
> -
> - SVN_ERR (svn_wc_adm_retrieve (&adm_access, eb->adm_access, bdi->path,
> - pool));
> -
> - SVN_ERR (svn_wc__entry_modify (adm_access, NULL, &tmp_entry,
> - modify_flags, TRUE, pool));
> - }
Where did this code go? I saw nothing in the new code for handling new_URL.
>...
> + /* The refcount is zero, thus we remove the 'incomplete' flag. */
> + SVN_ERR (svn_wc_adm_retrieve (&adm_access, eb->adm_access, bdi->path,
> + pool));
> + tmp_entry.incomplete = FALSE;
> + SVN_ERR (svn_wc__entry_modify (adm_access, NULL /* this_dir */,
> + &tmp_entry,
> + SVN_WC__ENTRY_MODIFY_INCOMPLETE,
> + TRUE /* immediate write */, pool));
Will the incomplete flag always be set at this point in the code? IOW,
should we maybe test and only run this when if 'incomplete' was set?
>...
> @@ -763,6 +756,16 @@
> db->pool);
> copyfrom_revision = pb->edit_baton->target_revision;
>
> + /* Immediately create an entry for the new directory in the parent.
> + Note that the parent must already be either added or opened, and
> + thus it's in an 'incomplete' state just like the new dir. */
> + tmp_entry.kind = svn_node_dir;
> + tmp_entry.deleted = FALSE;
> + SVN_ERR (svn_wc__entry_modify (adm_access, db->name, &tmp_entry,
> + (SVN_WC__ENTRY_MODIFY_KIND
> + | SVN_WC__ENTRY_MODIFY_DELETED),
> + TRUE /* immediate write */, pool));
Shouldn't that be the "incomplete" flag rather than "deleted" ? And set it
to TRUE... IOW, the comments don't appear to match the code.
>...
> + apr_uint32_t modify_flags = 0;
>
> /* kff todo: check that the dir exists locally, find it somewhere if
> its not there? Yes, all this and more... And ancestor_url and
> @@ -816,6 +823,21 @@
> pool);
>
> *child_baton = this_dir_baton;
> +
> + /* Mark directory as being at target_revision, but incomplete. */
> +
> + tmp_entry.revision = eb->target_revision;
> + modify_flags |= SVN_WC__ENTRY_MODIFY_REVISION;
> +
> + tmp_entry.incomplete = TRUE;
> + modify_flags |= SVN_WC__ENTRY_MODIFY_INCOMPLETE;
> +
> + SVN_ERR (svn_wc_adm_retrieve (&adm_access, eb->adm_access,
> + this_dir_baton->path, pool));
> + SVN_ERR (svn_wc__entry_modify (adm_access, NULL /* THIS_DIR */,
> + &tmp_entry, modify_flags,
> + TRUE /* immediate write */,
> + pool));
Why have the 'modify_flags' variable? Just insert the constants right into
the call to __entry_modify. You init it to zero, then unconditionally mask
in values to it. It can be simplified...
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 14 01:26:55 2003