diff options
author | peter <peter@FreeBSD.org> | 2013-11-11 01:00:29 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2013-11-11 01:00:29 +0000 |
commit | 68301b10e52aedbf076b5b08303439d75c192e18 (patch) | |
tree | c05673887167c7ecd55a62ed72830f5186f453c1 /subversion/libsvn_ra_serf/commit.c | |
parent | 3b9f7e96381479fb03ae2c36d490a38718f71083 (diff) | |
download | FreeBSD-src-68301b10e52aedbf076b5b08303439d75c192e18.zip FreeBSD-src-68301b10e52aedbf076b5b08303439d75c192e18.tar.gz |
Import svn-1.8.4, which includes fixes for both security and merge
handling.
Diffstat (limited to 'subversion/libsvn_ra_serf/commit.c')
-rw-r--r-- | subversion/libsvn_ra_serf/commit.c | 25 |
1 files changed, 22 insertions, 3 deletions
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); } } |