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

Re: svn commit: r33201 - in trunk/subversion: libsvn_wc tests/cmdline

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 20 Sep 2008 10:40:29 +0300 (Jerusalem Daylight Time)

> Modified: trunk/subversion/libsvn_wc/copy.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/copy.c?pathrev=33201&r1=33200&r2=33201
> ==============================================================================
> --- trunk/subversion/libsvn_wc/copy.c Fri Sep 19 17:55:55 2008 (r33200)
> +++ trunk/subversion/libsvn_wc/copy.c Fri Sep 19 18:05:40 2008 (r33201)
> @@ -316,8 +316,15 @@ get_copyfrom_url_rev_via_parent(const ch
> svn_wc_adm_access_t *src_access,
> apr_pool_t *pool)
> {
> - const char *parent_path = svn_path_dirname(src_path, pool);
> - const char *rest = svn_path_basename(src_path, pool);
> + const char *parent_path;
> + const char *rest;
> + const char *abs_src_path;
> +
> + SVN_ERR(svn_path_get_absolute(&abs_src_path, src_path, pool));
> +
> + parent_path = svn_path_dirname(abs_src_path, pool);
> + rest = svn_path_basename(abs_src_path, pool);
> +
> *copyfrom_url = NULL;
>
> while (! *copyfrom_url)
> @@ -353,9 +360,25 @@ get_copyfrom_url_rev_via_parent(const ch
> }
> else
> {
> + const char *last_parent_path = parent_path;
> +
> rest = svn_path_join(svn_path_basename(parent_path, pool),
> rest, pool);
> parent_path = svn_path_dirname(parent_path, pool);
> +
> + if (strcmp(parent_path, last_parent_path) == 0)
> + {

To clarify: do you know of a way to make this strcmp() return 0, or are
just coding defensively to avoid any possibility of infinite loop here
in the future?

> + /* If this happens, it probably means that parent_path is "".
> + But there's no reason to limit ourselves to just that case;
> + given everything else that's going on in this function, a
> + strcmp() is pretty cheap, and the result we're trying to
> + prevent is an infinite loop if svn_path_dirname() returns
> + its input unchanged. */
> + return svn_error_createf
> + (SVN_ERR_WC_COPYFROM_PATH_NOT_FOUND, NULL,
> + _("no parent with copyfrom information found above '%s'"),
> + svn_path_local_style(src_path, pool));
> + }
> }
> }
>
>
> Modified: trunk/subversion/tests/cmdline/copy_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/copy_tests.py?pathrev=33201&r1=33200&r2=33201
> ==============================================================================
> --- trunk/subversion/tests/cmdline/copy_tests.py Fri Sep 19 17:55:55 2008 (r33200)
> +++ trunk/subversion/tests/cmdline/copy_tests.py Fri Sep 19 18:05:40 2008 (r33201)
> @@ -3941,6 +3941,50 @@ def copy_into_absent_dir(sbox):
> 'cleanup', wc_dir)
>
>
> +def find_copyfrom_information_upstairs(sbox):
> + "renaming inside a copied subtree shouldn't hang"
> +
> + # The final command in this series would cause the client to hang...
> + #

I'm afraid it might still hang on Windows (due to the svn_path_is_ancestor() bug
I've discussed on IRC yesterday). I'll check mark the test "Skip" in that case.

Daniel

> @@ -4021,6 +4065,7 @@ test_list = [ None,
> unneeded_parents,
> double_parents_with_url,
> copy_into_absent_dir,
> + find_copyfrom_information_upstairs,
> ]
>
> if __name__ == '__main__':

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-20 09:40:50 CEST

This is an archived mail posted to the Subversion Dev mailing list.