subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1512198 - in /subversion/branches/1.8.x-issue4400: ./ subversion/libsvn_ra_serf/commit.c
Date Fri, 09 Aug 2013 08:30:35 GMT
Author: breser
Date: Fri Aug  9 08:30:35 2013
New Revision: 1512198

URL: http://svn.apache.org/r1512198
Log:
On the 1.8.x-issue4400 branch merge r1512195 from trunk.

Modified:
    subversion/branches/1.8.x-issue4400/   (props changed)
    subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c

Propchange: subversion/branches/1.8.x-issue4400/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1512195

Modified: subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c?rev=1512198&r1=1512197&r2=1512198&view=diff
==============================================================================
--- subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/1.8.x-issue4400/subversion/libsvn_ra_serf/commit.c Fri Aug  9 08:30:35
2013
@@ -397,21 +397,18 @@ 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. */
+          /* Calculate the working_url by skipping the shared ancestor bewteen
+           * the parent->relpath and dir->relpath.  This is safe since an
+           * add is guaranteed to have a parent that is checked out. */
           dir_context_t *parent = p_dir->parent_dir;
-          size_t skip = strlen(parent->relpath);
-          if (skip)
-            skip++;
+          const char *relpath = svn_relpath_skip_ancestor(parent->relpath,
+                                                          dir->relpath);
 
           /* Implicitly checkout this dir now. */
+          SVN_ERR_ASSERT(parent->working_url);
           dir->working_url = svn_path_url_add_component2(
                                    parent->working_url,
-                                   dir->relpath + skip, dir->pool);
+                                   relpath, dir->pool);
           return SVN_NO_ERROR;
         }
       p_dir = p_dir->parent_dir;



Mime
View raw message