aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/libsvn_ra_serf/commit.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2013-11-11 01:00:29 +0000
committerPeter Wemm <peter@FreeBSD.org>2013-11-11 01:00:29 +0000
commit6573976d8d3ffbe3d00487ebc8c11e3eb4033f17 (patch)
treec05673887167c7ecd55a62ed72830f5186f453c1 /subversion/libsvn_ra_serf/commit.c
parent97551b2898eb459e9b616947d87d026d27b61518 (diff)
downloadsrc-6573976d8d3ffbe3d00487ebc8c11e3eb4033f17.tar.gz
src-6573976d8d3ffbe3d00487ebc8c11e3eb4033f17.zip
Import svn-1.8.4, which includes fixes for both security and mergevendor/subversion/subversion-1.8.4
handling.
Notes
Notes: svn path=/vendor/subversion/dist/; revision=257934 svn path=/vendor/subversion/subversion-1.8.4/; revision=257935; tag=vendor/subversion/subversion-1.8.4
Diffstat (limited to 'subversion/libsvn_ra_serf/commit.c')
-rw-r--r--subversion/libsvn_ra_serf/commit.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/subversion/libsvn_ra_serf/commit.c b/subversion/libsvn_ra_serf/commit.c
index 56a2bcea1e3b..9682a65f2021 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);
}
}