From 68301b10e52aedbf076b5b08303439d75c192e18 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 11 Nov 2013 01:00:29 +0000 Subject: Import svn-1.8.4, which includes fixes for both security and merge handling. --- subversion/libsvn_ra_serf/commit.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'subversion/libsvn_ra_serf/commit.c') diff --git a/subversion/libsvn_ra_serf/commit.c b/subversion/libsvn_ra_serf/commit.c index 56a2bce..9682a65 100644 --- a/subversion/libsvn_ra_serf/commit.c +++ b/subversion/libsvn_ra_serf/commit.c @@ -397,10 +397,18 @@ checkout_dir(dir_context_t *dir, { if (p_dir->added) { + /* 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; + 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( - dir->parent_dir->working_url, - dir->name, dir->pool); + parent->working_url, + relpath, dir->pool); return SVN_NO_ERROR; } p_dir = p_dir->parent_dir; @@ -1924,7 +1932,18 @@ add_file(const char *path, if (handler->sline.code != 404) { - return svn_error_createf(SVN_ERR_RA_DAV_ALREADY_EXISTS, NULL, + if (handler->sline.code != 200) + { + svn_error_t *err; + + err = svn_ra_serf__error_on_status(handler->sline, + handler->path, + handler->location); + + SVN_ERR(err); + } + + return svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL, _("File '%s' already exists"), path); } } -- cgit v1.1