You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2011/01/27 06:38:31 UTC
svn commit: r1063999 -
/subversion/branches/uris-as-urls/subversion/libsvn_ra_svn/editorp.c
Author: cmpilato
Date: Thu Jan 27 05:38:30 2011
New Revision: 1063999
URL: http://svn.apache.org/viewvc?rev=1063999&view=rev
Log:
On the 'uris-as-urls' branch: Fix the last of the failing svnserve
tests (I think).
* subversion/libsvn_ra_svn/editorp.c
(ra_svn_handle_add_dir, ra_svn_handle_add_file): Ah. So now we
learn that while commits transmit full URLs for copyfrom_urls in
these functions, the replay functionality sends fspaths. So,
sigh, we code for both scenarios.
Modified:
subversion/branches/uris-as-urls/subversion/libsvn_ra_svn/editorp.c
Modified: subversion/branches/uris-as-urls/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/uris-as-urls/subversion/libsvn_ra_svn/editorp.c?rev=1063999&r1=1063998&r2=1063999&view=diff
==============================================================================
--- subversion/branches/uris-as-urls/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/uris-as-urls/subversion/libsvn_ra_svn/editorp.c Thu Jan 27 05:38:30 2011
@@ -34,6 +34,7 @@
#include "svn_delta.h"
#include "svn_dirent_uri.h"
#include "svn_ra_svn.h"
+#include "svn_path.h"
#include "svn_pools.h"
#include "svn_private_config.h"
@@ -523,8 +524,17 @@ static svn_error_t *ra_svn_handle_add_di
SVN_ERR(lookup_token(ds, token, FALSE, &entry));
subpool = svn_pool_create(entry->pool);
path = svn_relpath_canonicalize(path, pool);
+
+ /* Some operations pass COPY_PATH as a full URL (commits, etc.).
+ Others (replay, e.g.) deliver an fspath. That's ... annoying. */
if (copy_path)
- copy_path = svn_url_canonicalize(copy_path, pool);
+ {
+ if (svn_path_is_url(copy_path))
+ copy_path = svn_url_canonicalize(copy_path, pool);
+ else
+ copy_path = svn_fspath__canonicalize(copy_path, pool);
+ }
+
SVN_CMD_ERR(ds->editor->add_directory(path, entry->baton, copy_path,
copy_rev, subpool, &child_baton));
store_token(ds, child_baton, child_token, FALSE, subpool);
@@ -621,8 +631,17 @@ static svn_error_t *ra_svn_handle_add_fi
SVN_ERR(lookup_token(ds, token, FALSE, &entry));
ds->file_refs++;
path = svn_relpath_canonicalize(path, pool);
+
+ /* Some operations pass COPY_PATH as a full URL (commits, etc.).
+ Others (replay, e.g.) deliver an fspath. That's ... annoying. */
if (copy_path)
- copy_path = svn_url_canonicalize(copy_path, pool);
+ {
+ if (svn_path_is_url(copy_path))
+ copy_path = svn_url_canonicalize(copy_path, pool);
+ else
+ copy_path = svn_fspath__canonicalize(copy_path, pool);
+ }
+
file_entry = store_token(ds, NULL, file_token, TRUE, ds->file_pool);
SVN_CMD_ERR(ds->editor->add_file(path, entry->baton, copy_path, copy_rev,
ds->file_pool, &file_entry->baton));