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

Re: svn commit: r1507589 - in /subversion/trunk/subversion: libsvn_ra_serf/commit.c tests/cmdline/commit_tests.py

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 07 Aug 2013 12:10:40 +0100

breser_at_apache.org writes:

> Author: breser
> Date: Sat Jul 27 07:08:03 2013
> New Revision: 1507589
>
> URL: http://svn.apache.org/r1507589
> Log:
> Fix Issue #4400: commits fail with copy and deep delete under copy.
>
> * subversion/libsvn_ra_serf/commit.c
> (checkout_dir): Generate the working_url when a parent is added by combining
> the add parent's working_url and the unique (vs add parent) portion of the
> checkout directory's relpath.
>
> * subversion/tests/cmdline/commit_tests.py
> (commit_cp_with_deep_delete): Remove the XFail decorator from the test which
> will pass now.
>
> Modified:
> subversion/trunk/subversion/libsvn_ra_serf/commit.c
> subversion/trunk/subversion/tests/cmdline/commit_tests.py
>
> Modified: subversion/trunk/subversion/libsvn_ra_serf/commit.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/commit.c?rev=1507589&r1=1507588&r2=1507589&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_ra_serf/commit.c (original)
> +++ subversion/trunk/subversion/libsvn_ra_serf/commit.c Sat Jul 27 07:08:03 2013
> @@ -397,10 +397,21 @@ checkout_dir(dir_context_t *dir,
> {
> if (p_dir->added)
> {
> + /* Calculate how much of the relpath to skip to compose the
> + * working_url. If the relpath is an empty string then the parent
> + * is the root of the commit and we need to just add the entire
> + * relpath to the parent's working_url. Otherwise we need to skip
> + * the strlen(parent->relpath) + 1 to account for the slash.
> + * It is safe to assume that every added directory has a parent. */
> + dir_context_t *parent = p_dir->parent_dir;
> + size_t skip = strlen(parent->relpath);
> + if (skip)
> + skip++;
> +
> /* Implicitly checkout this dir now. */
> dir->working_url = svn_path_url_add_component2(
> - dir->parent_dir->working_url,
> - dir->name, dir->pool);
> + parent->working_url,
> + dir->relpath + skip, dir->pool);

Is svn_relpath_skip_ancestor better than the manual skip?

          char *relpath = svn_relpath_skip_ancestor(parent->relpath,
                                                    dir->relpath);

          dir->working_url = svn_path_url_add_component2(parent->working_url,
                                                         relpath, ...

Perhaps with an assert before using relpath?

          SVN_ERR_ASSERT(relpath
                         && ((strlen(parent->relpath) + strlen(relpath)
                              == strlen(dir->relpath) + 1)
                             || strlen(parent->relpath) == 0));

-- 
Philip Martin | Subversion Committer
WANdisco | Non-Stop Data
Received on 2013-08-07 13:11:18 CEST

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.