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 2013/03/08 17:50:42 UTC
svn commit: r1454459 - in
/subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon: fetch.c
ra_neon.h util.c
Author: cmpilato
Date: Fri Mar 8 16:50:41 2013
New Revision: 1454459
URL: http://svn.apache.org/r1454459
Log:
On the '1.7.x-issue4257' branch: fix issue #4257 ("neon get_dir leads
to bogus NODES rows").
* subversion/libsvn_ra_neon/ra_neon.h,
* subversion/libsvn_ra_neon/util.c
(svn_ra_neon__get_url_path): New helper function.
* subversion/libsvn_ra_neon/fetch.c
(svn_ra_neon__get_dir): Use svn_ra_neon__get_url_path() in the HEAD
lookup case to ensure that we aren't comparing apples (full URLs) to
oranges (URL paths).
Patch by: philip
(Tweaked be me.)
Modified:
subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/fetch.c
subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/ra_neon.h
subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/util.c
Modified: subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/fetch.c?rev=1454459&r1=1454458&r2=1454459&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/fetch.c Fri Mar 8 16:50:41 2013
@@ -796,7 +796,7 @@ svn_error_t *svn_ra_neon__get_dir(svn_ra
need to create a bc_url. */
if ((! SVN_IS_VALID_REVNUM(revision)) && (fetched_rev == NULL))
{
- final_url = url;
+ SVN_ERR(svn_ra_neon__get_url_path(&final_url, url, pool));
}
else
{
Modified: subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/ra_neon.h?rev=1454459&r1=1454458&r2=1454459&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/ra_neon.h Fri Mar 8 16:50:41 2013
@@ -1173,6 +1173,13 @@ const char *
svn_ra_neon__uri_unparse(const ne_uri *uri,
apr_pool_t *pool);
+/* Wrappre around ne_uri_parse() which parses a URL and returns only
+ the server path portion thereof. */
+svn_error_t *
+svn_ra_neon__get_url_path(const char **urlpath,
+ const char *url,
+ apr_pool_t *pool);
+
/* Sets *SUPPORTS_DEADPROP_COUNT to non-zero if server supports
* deadprop-count property. Uses FINAL_URL to discover this informationn
* if it is not already cached. */
Modified: subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/util.c?rev=1454459&r1=1454458&r2=1454459&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/branches/1.7.x-issue4257/subversion/libsvn_ra_neon/util.c Fri Mar 8 16:50:41 2013
@@ -1600,6 +1600,29 @@ svn_ra_neon__uri_unparse(const ne_uri *u
return result;
}
+svn_error_t *
+svn_ra_neon__get_url_path(const char **urlpath,
+ const char *url,
+ apr_pool_t *pool)
+{
+ ne_uri parsed_url;
+ svn_error_t *err = SVN_NO_ERROR;
+
+ ne_uri_parse(url, &parsed_url);
+ if (parsed_url.path)
+ {
+ *urlpath = apr_pstrdup(pool, parsed_url.path);
+ }
+ else
+ {
+ err = svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
+ _("Neon was unable to parse URL '%s'"), url);
+ }
+ ne_uri_free(&parsed_url);
+
+ return err;
+}
+
/* Sets *SUPPORTS_DEADPROP_COUNT to non-zero if server supports
* deadprop-count property. */
svn_error_t *