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

Re: [PATCH] Fix for issue 1797 case two. A non-recursive commit of a deleted directory fails post-commit.

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2004-03-21 18:35:19 CET

makl <makl@tigris.org> writes:

> [[[
> Fix for issue 1797 case two. A non-recursive commit of a deleted
> directory fails post-commit.
>
> Patch from <makl@tigris.org>

It's a bit mangled, both the log message and the patch itself appear
to combine the library changes and the test changes into a change to
one file.

>
> * subversion/libsvn_client/commit.c
> (svn_client_commit): Always lock deleted directories recursive.
> (commit_deleted_directory_tree_non_recursive_1): New
> regression test for case one. Currently XFail.
> (commit_deleted_directory_tree_non_recursive_2_1): New
> regression test for case two with one deleted directory.
> (commit_deleted_directory_tree_non_recursive_2_1): New
> regression test for case two with three independent deleted
> directories.
> ]]]
>
>
> Index: subversion/libsvn_client/commit.c
> ===================================================================
> --- subversion/libsvn_client/commit.c (revision 9145)
> +++ subversion/libsvn_client/commit.c (working copy)
> @@ -1097,8 +1097,25 @@
> /* If the final target is a dir, we want to recursively lock it */
> if (kind == svn_node_dir)
> {
> +
> if (nonrecursive)
> - APR_ARRAY_PUSH (dirs_to_lock, const char *) = target;
> + {
> + const svn_wc_entry_t *tmp_entry;
> + svn_wc_adm_access_t *tmp_adm_access;
> +
> + SVN_ERR (svn_wc_adm_open2 (&tmp_adm_access, NULL, target,
> + FALSE, 0, pool));
> + SVN_ERR (svn_wc_entry (&tmp_entry, target, tmp_adm_access,
> + TRUE, pool));
> + if (!tmp_entry
> + || (tmp_entry->schedule == svn_wc_schedule_delete))
> + APR_ARRAY_PUSH (dirs_to_lock_recursive,
> + const char *) = target;
> + else
> + APR_ARRAY_PUSH (dirs_to_lock, const char *) = target;
> +
> + SVN_ERR (svn_wc_adm_close (tmp_adm_access));
> + }
> else
> APR_ARRAY_PUSH (dirs_to_lock_recursive, const char *) = target;
> }
> @@ -1141,8 +1158,26 @@
> if (kind == svn_node_dir)
> {
> if (nonrecursive)
> - APR_ARRAY_PUSH (dirs_to_lock,
> - const char *) = apr_pstrdup (pool, target);
> + {
> + const svn_wc_entry_t *tmp_entry;
> + svn_wc_adm_access_t *tmp_adm_access;
> +
> + SVN_ERR (svn_wc_adm_open2 (&tmp_adm_access, NULL, target,
> + FALSE, 0, subpool));
> + SVN_ERR (svn_wc_entry (&tmp_entry, target, tmp_adm_access,
> + TRUE, subpool));
> + if (!tmp_entry
> + || (tmp_entry->schedule == svn_wc_schedule_delete))
> + APR_ARRAY_PUSH (dirs_to_lock_recursive,
> + const char *) = apr_pstrdup (pool,
> + target);
> + else
> + APR_ARRAY_PUSH (dirs_to_lock,
> + const char *) = apr_pstrdup (pool,
> + target);
> +
> + SVN_ERR (svn_wc_adm_close (tmp_adm_access));
> + }
> else
> APR_ARRAY_PUSH (dirs_to_lock_recursive,
> const char *) = apr_pstrdup (pool, target);

That looks like almost identical code twice, could the bits be combined?

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Mar 21 18:35:36 2004

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.