subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1044548 [18/39] - in /subversion/branches/ignore-mergeinfo: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ contrib/client-side/ contrib/hook-scripts/ contrib/server-side/ notes/api-errata/ notes/api-err...
Date Sat, 11 Dec 2010 00:16:08 GMT
Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/repos.c Sat Dec 11 00:15:55
2010
@@ -880,10 +880,10 @@ prep_working(dav_resource_combined *comb
                                   comb->priv.root.activity_id);
       if (txn_name == NULL)
         {
-          return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
-                               "An unknown activity was specified in the URL. "
-                               "This is generally caused by a problem in the "
-                               "client software.");
+          return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                                    "An unknown activity was specified in the "
+                                    "URL. This is generally caused by a "
+                                    "problem in the client software.");
         }
       comb->priv.root.txn_name = txn_name;
     }
@@ -896,10 +896,10 @@ prep_working(dav_resource_combined *comb
       if (serr->apr_err == SVN_ERR_FS_NO_SUCH_TRANSACTION)
         {
           svn_error_clear(serr);
-          return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                               "An activity was specified and found, but the "
-                               "corresponding SVN FS transaction was not "
-                               "found.");
+          return dav_svn__new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                                    "An activity was specified and found, but "
+                                    "the corresponding SVN FS transaction was "
+                                    "not found.");
         }
       return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
                                   "Could not open the SVN FS transaction "
@@ -956,8 +956,8 @@ prep_working(dav_resource_combined *comb
         }
       else if (!svn_string_compare(current_author, &request_author))
         {
-          return dav_new_error(pool, HTTP_NOT_IMPLEMENTED, 0,
-                   "Multi-author commits not supported.");
+          return dav_svn__new_error(pool, HTTP_NOT_IMPLEMENTED, 0,
+                                    "Multi-author commits not supported.");
         }
     }
 
@@ -1011,8 +1011,9 @@ prep_private(dav_resource_combined *comb
       /* Open the named transaction. */
 
       if (comb->priv.root.txn_name == NULL)
-        return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
-                             "An unknown txn name was specified in the URL.");
+        return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                                  "An unknown txn name was specified in the "
+                                  "URL.");
 
       serr = svn_fs_open_txn(&comb->priv.root.txn,
                              comb->priv.repos->fs,
@@ -1023,8 +1024,8 @@ prep_private(dav_resource_combined *comb
             {
               svn_error_clear(serr);
               comb->res.exists = FALSE;
-              return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                                   "Named transaction doesn't exist.");
+              return dav_svn__new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                                        "Named transaction doesn't exist.");
             }
           return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
                                       "Could not open specified transaction.",
@@ -1074,8 +1075,8 @@ prep_resource(dav_resource_combined *com
         return (*scan->prep)(comb);
     }
 
-  return dav_new_error(comb->res.pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                       "DESIGN FAILURE: unknown resource type");
+  return dav_svn__new_error(comb->res.pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                            "DESIGN FAILURE: unknown resource type");
 }
 
 
@@ -1106,7 +1107,7 @@ create_private_resource(const dav_resour
   /* versioned = baselined = working = FALSE */
 
   comb->res.uri = apr_pstrcat(base->pool, base->info->repos->root_path,
-                              path->data, NULL);
+                              path->data, (char *)NULL);
   comb->res.info = &comb->priv;
   comb->res.hooks = &dav_svn__hooks_repository;
   comb->res.pool = base->pool;
@@ -1140,7 +1141,7 @@ dav_svn_split_uri(request_rec *r,
                   const char *root_path,
                   const char **cleaned_uri,
                   int *trailing_slash,
-                  const char **repos_name,
+                  const char **repos_basename,
                   const char **relative_path,
                   const char **repos_path)
 {
@@ -1158,12 +1159,12 @@ dav_svn_split_uri(request_rec *r,
   if ((fs_path == NULL) && (fs_parent_path == NULL))
     {
       /* ### are SVN_ERR_APMOD codes within the right numeric space? */
-      return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                           SVN_ERR_APMOD_MISSING_PATH_TO_FS,
-                           "The server is misconfigured: "
-                           "either an SVNPath or SVNParentPath "
-                           "directive is required to specify the location "
-                           "of this resource's repository.");
+      return dav_svn__new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
+                                SVN_ERR_APMOD_MISSING_PATH_TO_FS,
+                                "The server is misconfigured: "
+                                "either an SVNPath or SVNParentPath "
+                                "directive is required to specify the location "
+                                "of this resource's repository.");
     }
 
   /* make a copy so that we can do some work on it */
@@ -1216,14 +1217,14 @@ dav_svn_split_uri(request_rec *r,
      ### slash. something about SVN-private-path */
 
   /* Depending on whether SVNPath or SVNParentPath was used, we need
-     to compute 'relative' and 'repos_name' differently.  */
+     to compute 'relative' and 'repos_basename' differently.  */
 
   /* Normal case:  the SVNPath command was used to specify a
      particular repository.  */
   if (fs_path != NULL)
     {
-      /* the repos_name is the last component of root_path. */
-      *repos_name = svn_dirent_basename(root_path, r->pool);
+      /* the repos_basename is the last component of root_path. */
+      *repos_basename = svn_dirent_basename(root_path, r->pool);
 
       /* 'relative' is already correct for SVNPath; the root_path
          already contains the name of the repository, so relative is
@@ -1241,10 +1242,10 @@ dav_svn_split_uri(request_rec *r,
       if (relative[1] == '\0')
         {
           /* ### are SVN_ERR_APMOD codes within the right numeric space? */
-          return dav_new_error(r->pool, HTTP_FORBIDDEN,
-                               SVN_ERR_APMOD_MALFORMED_URI,
-                               "The URI does not contain the name "
-                               "of a repository.");
+          return dav_svn__new_error(r->pool, HTTP_FORBIDDEN,
+                                    SVN_ERR_APMOD_MALFORMED_URI,
+                                    "The URI does not contain the name "
+                                    "of a repository.");
         }
 
       magic_end = ap_strchr_c(relative + 1, '/');
@@ -1264,7 +1265,7 @@ dav_svn_split_uri(request_rec *r,
         }
 
       /* return answer */
-      *repos_name = magic_component;
+      *repos_basename = magic_component;
     }
 
   /* We can return 'relative' at this point too. */
@@ -1289,9 +1290,9 @@ dav_svn_split_uri(request_rec *r,
         if (ch == '\0')
           {
             /* relative is just "!svn", which is malformed. */
-            return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                                 SVN_ERR_APMOD_MALFORMED_URI,
-                                 "Nothing follows the svn special_uri.");
+            return dav_svn__new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
+                                      SVN_ERR_APMOD_MALFORMED_URI,
+                                      "Nothing follows the svn special_uri.");
           }
         else
           {
@@ -1315,10 +1316,10 @@ dav_svn_split_uri(request_rec *r,
                         if (defn->numcomponents == 0)
                           *repos_path = NULL;
                         else
-                          return
-                            dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                                          SVN_ERR_APMOD_MALFORMED_URI,
-                                          "Missing info after special_uri.");
+                          return dav_svn__new_error(
+                                     r->pool, HTTP_INTERNAL_SERVER_ERROR,
+                                     SVN_ERR_APMOD_MALFORMED_URI,
+                                     "Missing info after special_uri.");
                       }
                     else if (relative[len3] == '/')
                       {
@@ -1339,12 +1340,11 @@ dav_svn_split_uri(request_rec *r,
                           {
                             /* Did we break from the loop prematurely? */
                             if (j != (defn->numcomponents - 1))
-                              return
-                                dav_new_error(r->pool,
-                                              HTTP_INTERNAL_SERVER_ERROR,
-                                              SVN_ERR_APMOD_MALFORMED_URI,
-                                              "Not enough components"
-                                              " after special_uri.");
+                              return dav_svn__new_error(
+                                         r->pool, HTTP_INTERNAL_SERVER_ERROR,
+                                         SVN_ERR_APMOD_MALFORMED_URI,
+                                         "Not enough components after "
+                                         "special_uri.");
 
                             if (! defn->has_repos_path)
                               /* It's okay to not have found a slash. */
@@ -1361,7 +1361,7 @@ dav_svn_split_uri(request_rec *r,
                     else
                       {
                         return
-                          dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
+                          dav_svn__new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
                                         SVN_ERR_APMOD_MALFORMED_URI,
                                         "Unknown data after special_uri.");
                       }
@@ -1372,9 +1372,9 @@ dav_svn_split_uri(request_rec *r,
 
             if (defn->name == NULL)
               return
-                dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                              SVN_ERR_APMOD_MALFORMED_URI,
-                              "Couldn't match subdir after special_uri.");
+                dav_svn__new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
+                                   SVN_ERR_APMOD_MALFORMED_URI,
+                                   "Couldn't match subdir after special_uri.");
           }
       }
     else
@@ -1420,7 +1420,6 @@ cleanup_fs_access(void *data)
 /* Helper func to construct a special 'parentpath' private resource. */
 static dav_error *
 get_parentpath_resource(request_rec *r,
-                        const char *root_path,
                         dav_resource **resource)
 {
   const char *new_uri;
@@ -1459,12 +1458,12 @@ get_parentpath_resource(request_rec *r,
   if (r->uri[len-1] != '/')
     {
       new_uri = apr_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri),
-                            "/", NULL);
+                            "/", (char *)NULL);
       apr_table_setn(r->headers_out, "Location",
                      ap_construct_url(r->pool, new_uri, r));
-      return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
-                           "Requests for a collection must have a "
-                           "trailing slash on the URI.");
+      return dav_svn__new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
+                                "Requests for a collection must have a "
+                                "trailing slash on the URI.");
     }
 
   /* No other "prepping" of resource needs to happen -- no opening
@@ -1771,8 +1770,8 @@ parse_querystring(request_rec *r, const 
     {
       peg_rev = SVN_STR_TO_REV(prevstr);
       if (!SVN_IS_VALID_REVNUM(peg_rev))
-        return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
-                             "invalid peg rev in query string");
+        return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                                  "invalid peg rev in query string");
     }
   else
     {
@@ -1788,8 +1787,8 @@ parse_querystring(request_rec *r, const 
     {
       working_rev = SVN_STR_TO_REV(wrevstr);
       if (!SVN_IS_VALID_REVNUM(working_rev))
-        return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
-                             "invalid working rev in query string");
+        return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                                  "invalid working rev in query string");
     }
   else
     {
@@ -1802,8 +1801,8 @@ parse_querystring(request_rec *r, const 
      Our node-tracing algorithms can't handle that scenario, so we'll
      disallow it here. */
   if (working_rev > peg_rev)
-    return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
-                         "working rev greater than peg rev.");
+    return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                              "working rev greater than peg rev.");
 
   /* If WORKING_REV and PEG_REV are equivalent, we want to return the
      resource at the revision.  Otherwise, WORKING_REV is older than
@@ -1844,8 +1843,8 @@ parse_querystring(request_rec *r, const 
 
       newpath = apr_hash_get(locations, &working_rev, sizeof(svn_revnum_t));
       if (! newpath)
-        return dav_new_error(pool, HTTP_NOT_FOUND, 0,
-                             "path doesn't exist in that revision.");
+        return dav_svn__new_error(pool, HTTP_NOT_FOUND, 0,
+                                  "path doesn't exist in that revision.");
 
       /* Redirect folks to a canonical, peg-revision-only location.
          If they used a peg revision in this request, we can use a
@@ -1857,10 +1856,10 @@ parse_querystring(request_rec *r, const 
                                                    comb->priv.repos->root_path,
                                                    newpath, working_rev),
                                       r));
-      return dav_new_error(r->pool,
-                           prevstr ? HTTP_MOVED_PERMANENTLY
-                                   : HTTP_MOVED_TEMPORARILY,
-                           0, "redirecting to canonical location");
+      return dav_svn__new_error(r->pool,
+                                prevstr ? HTTP_MOVED_PERMANENTLY
+                                        : HTTP_MOVED_TEMPORARILY,
+                                0, "redirecting to canonical location");
     }
 
   return NULL;
@@ -1882,7 +1881,7 @@ get_resource(request_rec *r,
   dav_resource_combined *comb;
   dav_svn_repos *repos;
   const char *cleaned_uri;
-  const char *repos_name;
+  const char *repo_basename;
   const char *relative;
   const char *repos_path;
   const char *repos_key;
@@ -1915,7 +1914,7 @@ get_resource(request_rec *r,
 
       if (strcmp(parentpath, uri) == 0)
         {
-          err = get_parentpath_resource(r, root_path, resource);
+          err = get_parentpath_resource(r, resource);
           if (err)
             return err;
           return NULL;
@@ -1925,7 +1924,7 @@ get_resource(request_rec *r,
   /* This does all the work of interpreting/splitting the request uri. */
   err = dav_svn_split_uri(r, r->uri, root_path,
                           &cleaned_uri, &had_slash,
-                          &repos_name, &relative, &repos_path);
+                          &repo_basename, &relative, &repos_path);
   if (err)
     return err;
 
@@ -1938,9 +1937,9 @@ get_resource(request_rec *r,
     {
       /* ...then the URL to the repository is actually one implicit
          component longer... */
-      root_path = svn_uri_join(root_path, repos_name, r->pool);
+      root_path = svn_uri_join(root_path, repo_basename, r->pool);
       /* ...and we need to specify exactly what repository to open. */
-      fs_path = svn_dirent_join(fs_parent_path, repos_name, r->pool);
+      fs_path = svn_dirent_join(fs_parent_path, repo_basename, r->pool);
     }
 
   /* Start building and filling a 'combination' object. */
@@ -2011,7 +2010,7 @@ get_resource(request_rec *r,
   repos->repo_name = repo_name;
 
   /* The repository filesystem basename */
-  repos->repo_basename = repos_name;
+  repos->repo_basename = repo_basename;
 
   /* An XSL transformation */
   repos->xslt_uri = xslt_uri;
@@ -2090,7 +2089,7 @@ get_resource(request_rec *r,
   }
 
   /* Retrieve/cache open repository */
-  repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, NULL);
+  repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, (char *)NULL);
   apr_pool_userdata_get(&userdata, repos_key, r->connection->pool);
   repos->repos = userdata;
   if (repos->repos == NULL)
@@ -2253,12 +2252,12 @@ get_resource(request_rec *r,
                                          "/",
                                          r->args ? "?" : "",
                                          r->args ? r->args : "",
-                                         NULL);
+                                         (char *)NULL);
       apr_table_setn(r->headers_out, "Location",
                      ap_construct_url(r->pool, new_path, r));
-      return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
-                           "Requests for a collection must have a "
-                           "trailing slash on the URI.");
+      return dav_svn__new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
+                                "Requests for a collection must have a "
+                                "trailing slash on the URI.");
     }
 
   /* HTTPv2: for write-requests, out-of-dateness checks happen via
@@ -2280,12 +2279,12 @@ get_resource(request_rec *r,
      doofus typed it in manually or has a buggy client. */
   /* ### pick something other than HTTP_INTERNAL_SERVER_ERROR */
   /* ### are SVN_ERR_APMOD codes within the right numeric space? */
-  return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                       SVN_ERR_APMOD_MALFORMED_URI,
-                       "The URI indicated a resource within Subversion's "
-                       "special resource area, but does not exist. This is "
-                       "generally caused by a problem in the client "
-                       "software.");
+  return dav_svn__new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
+                            SVN_ERR_APMOD_MALFORMED_URI,
+                            "The URI indicated a resource within Subversion's "
+                            "special resource area, but does not exist. This "
+                            "is generally caused by a problem in the client "
+                            "software.");
 }
 
 
@@ -2387,11 +2386,11 @@ get_parent_resource(const dav_resource *
 
   /* If we didn't create parent resource above, complain. */
   if (! *parent_resource)
-    return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                         apr_psprintf(resource->pool,
-                                      "get_parent_resource was called for "
-                                      "%s (type %d)",
-                                      resource->uri, resource->type));
+    return dav_svn__new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                              apr_psprintf(resource->pool,
+                                           "get_parent_resource was called for "
+                                           "%s (type %d)",
+                                           resource->uri, resource->type));
 
   return NULL;
 }
@@ -2610,18 +2609,18 @@ open_stream(const dav_resource *resource
     {
       if (resource->type != DAV_RESOURCE_TYPE_WORKING)
         {
-          return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                               "Resource body changes may only be made to "
-                               "working resources [at this time].");
+          return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                                    "Resource body changes may only be made to "
+                                    "working resources (at this time).");
         }
     }
 
 #if 1
   if (mode == DAV_MODE_WRITE_SEEKABLE)
     {
-      return dav_new_error(resource->pool, HTTP_NOT_IMPLEMENTED, 0,
-                           "Resource body writes cannot use ranges "
-                           "[at this time].");
+      return dav_svn__new_error(resource->pool, HTTP_NOT_IMPLEMENTED, 0,
+                                "Resource body writes cannot use ranges "
+                                "(at this time).");
     }
 #endif
 
@@ -2814,9 +2813,9 @@ seek_stream(dav_stream *stream, apr_off_
 {
   /* ### fill this in */
 
-  return dav_new_error(stream->res->pool, HTTP_NOT_IMPLEMENTED, 0,
-                       "Resource body read/write cannot use ranges "
-                       "(at this time)");
+  return dav_svn__new_error(stream->res->pool, HTTP_NOT_IMPLEMENTED, 0,
+                            "Resource body read/write cannot use ranges "
+                            "(at this time)");
 }
 
 /* Returns whether the DAV resource lacks potential for generation of
@@ -3110,8 +3109,8 @@ deliver(const dav_resource *resource, ap
       && resource->type != DAV_RESOURCE_TYPE_WORKING
       && resource->info->restype != DAV_SVN_RESTYPE_PARENTPATH_COLLECTION)
     {
-      return dav_new_error(resource->pool, HTTP_CONFLICT, 0,
-                           "Cannot GET this type of resource.");
+      return dav_svn__new_error(resource->pool, HTTP_CONFLICT, 0,
+                                "Cannot GET this type of resource.");
     }
 
   if (resource->collection)
@@ -3338,7 +3337,7 @@ deliver(const dav_resource *resource, ap
           /* ### The xml output doesn't like to see a trailing slash on
              ### the visible portion, so avoid that. */
           if (is_dir)
-            href = apr_pstrcat(entry_pool, href, "/", NULL);
+            href = apr_pstrcat(entry_pool, href, "/", (char *)NULL);
 
           if (gen_html)
             name = href;
@@ -3429,8 +3428,8 @@ deliver(const dav_resource *resource, ap
       bkt = apr_bucket_eos_create(output->c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, bkt);
       if ((status = ap_pass_brigade(output, bb)) != APR_SUCCESS)
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                             "Could not write EOS to filter.");
+        return dav_svn__new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                                  "Could not write EOS to filter.");
 
       return NULL;
     }
@@ -3476,8 +3475,9 @@ deliver(const dav_resource *resource, ap
                                         "is really a file",
                                         resource->pool);
           if (!is_file)
-            return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0,
-                                 "the delta base does not refer to a file");
+            return dav_svn__new_error(resource->pool, HTTP_BAD_REQUEST, 0,
+                                      "the delta base does not refer to a "
+                                      "file");
 
           /* Okay. Let's open up a delta stream for the client to read. */
           serr = svn_fs_get_file_delta_stream(&txd_stream,
@@ -3563,8 +3563,9 @@ deliver(const dav_resource *resource, ap
         APR_BRIGADE_INSERT_TAIL(bb, bkt);
         if ((status = ap_pass_brigade(output, bb)) != APR_SUCCESS) {
           /* ### what to do with status; and that HTTP code... */
-          return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                               "Could not write data to filter.");
+          return dav_svn__new_error(resource->pool,
+                                    HTTP_INTERNAL_SERVER_ERROR, 0,
+                                    "Could not write data to filter.");
         }
       }
 
@@ -3574,8 +3575,9 @@ deliver(const dav_resource *resource, ap
       APR_BRIGADE_INSERT_TAIL(bb, bkt);
       if ((status = ap_pass_brigade(output, bb)) != APR_SUCCESS) {
         /* ### what to do with status; and that HTTP code... */
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                             "Could not write EOS to filter.");
+        return dav_svn__new_error(resource->pool,
+                                  HTTP_INTERNAL_SERVER_ERROR, 0,
+                                  "Could not write EOS to filter.");
       }
 
       return NULL;
@@ -3592,17 +3594,18 @@ create_collection(dav_resource *resource
   if (resource->type != DAV_RESOURCE_TYPE_WORKING
       && resource->type != DAV_RESOURCE_TYPE_REGULAR)
     {
-      return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                           "Collections can only be created within a working "
-                           "or regular collection [at this time].");
+      return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                                "Collections can only be created within a "
+                                "working or regular collection (at this "
+                                "time).");
     }
 
   /* ...regular resources allowed only if autoversioning is turned on. */
   if (resource->type == DAV_RESOURCE_TYPE_REGULAR
       && ! (resource->info->repos->autoversioning))
-    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                         "MKCOL called on regular resource, but "
-                         "autoversioning is not active.");
+    return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                              "MKCOL called on regular resource, but "
+                              "autoversioning is not active.");
 
   /* ### note that the parent was checked out at some point, and this
      ### is being preformed relative to the working rsrc for that parent */
@@ -3664,7 +3667,7 @@ copy_resource(const dav_resource *src,
       (src->pool, "Got a COPY request with src arg '%s' and dst arg '%s'",
       src->uri, dst->uri);
 
-      return dav_new_error(src->pool, HTTP_NOT_IMPLEMENTED, 0, msg);
+      return dav_svn__new_error(src->pool, HTTP_NOT_IMPLEMENTED, 0, msg);
   */
 
   /* ### Safeguard: see issue #916, whereby we're allowing an
@@ -3672,14 +3675,14 @@ copy_resource(const dav_resource *src,
      a new baseline afterwards.  We need to safeguard here that nobody
      is calling COPY with the baseline as a Destination! */
   if (dst->baselined && dst->type == DAV_RESOURCE_TYPE_VERSION)
-    return dav_new_error(src->pool, HTTP_PRECONDITION_FAILED, 0,
-                         "Illegal: COPY Destination is a baseline.");
+    return dav_svn__new_error(src->pool, HTTP_PRECONDITION_FAILED, 0,
+                              "Illegal: COPY Destination is a baseline.");
 
   if (dst->type == DAV_RESOURCE_TYPE_REGULAR
       && !(dst->info->repos->autoversioning))
-    return dav_new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                         "COPY called on regular resource, but "
-                         "autoversioning is not active.");
+    return dav_svn__new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                              "COPY called on regular resource, but "
+                              "autoversioning is not active.");
 
   /* Auto-versioning copy of regular resource: */
   if (dst->type == DAV_RESOURCE_TYPE_REGULAR)
@@ -3748,15 +3751,15 @@ remove_resource(dav_resource *resource, 
          || resource->type == DAV_RESOURCE_TYPE_ACTIVITY
          || (resource->type == DAV_RESOURCE_TYPE_PRIVATE
              && resource->info->restype == DAV_SVN_RESTYPE_TXN_COLLECTION)))
-    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                           "DELETE called on invalid resource type.");
+    return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                              "DELETE called on invalid resource type.");
 
   /* ...and regular resources only if autoversioning is turned on. */
   if (resource->type == DAV_RESOURCE_TYPE_REGULAR
       && ! (resource->info->repos->autoversioning))
-    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                         "DELETE called on regular resource, but "
-                         "autoversioning is not active.");
+    return dav_svn__new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                              "DELETE called on regular resource, but "
+                              "autoversioning is not active.");
 
   /* Handle activity deletions (early exit). */
   if (resource->type == DAV_RESOURCE_TYPE_ACTIVITY)
@@ -3889,9 +3892,9 @@ move_resource(dav_resource *src,
   if (src->type != DAV_RESOURCE_TYPE_REGULAR
       || dst->type != DAV_RESOURCE_TYPE_REGULAR
       || !(src->info->repos->autoversioning))
-    return dav_new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                         "MOVE only allowed on two public URIs, and "
-                         "autoversioning must be active.");
+    return dav_svn__new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                              "MOVE only allowed on two public URIs, and "
+                              "autoversioning must be active.");
 
   /* Change the dst VCR into a WR, in place.  This creates a txn and
      changes dst->info->root from a rev-root into a txn-root. */
@@ -3984,9 +3987,9 @@ do_walk(walker_ctx_t *ctx, int depth)
   /* ### need to allow more walking in the future */
   if (params->root->type != DAV_RESOURCE_TYPE_REGULAR)
     {
-      return dav_new_error(params->pool, HTTP_METHOD_NOT_ALLOWED, 0,
-                           "Walking the resource hierarchy can only be done "
-                           "on 'regular' resources [at this time].");
+      return dav_svn__new_error(params->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+                                "Walking the resource hierarchy can only be "
+                                "done on 'regular' resources [at this time].");
     }
 
   /* assert: collection resource. isdir == TRUE. repos_path != NULL. */
@@ -4055,7 +4058,7 @@ do_walk(walker_ctx_t *ctx, int depth)
                         apr_pstrmemdup(iterpool,
                                        ctx->repos_path->data,
                                        ctx->repos_path->len),
-                        key, NULL);
+                        key, (char *)NULL);
           if (! dav_svn__allow_read(ctx->info.r, ctx->info.repos,
                                     repos_relpath, ctx->info.root.rev,
                                     iterpool))
@@ -4119,6 +4122,12 @@ walk(const dav_walk_params *params, int 
   walker_ctx_t ctx = { 0 };
   dav_error *err;
 
+  if (params->root->info->restype == DAV_SVN_RESTYPE_PARENTPATH_COLLECTION)
+    {
+      /* Cannot walk an SVNParentPath collection, there is no repository. */
+      return NULL;
+    }
+
   ctx.params = params;
 
   ctx.wres.walk_ctx = params->walk_ctx;
@@ -4212,7 +4221,7 @@ dav_svn__create_working_resource(dav_res
   /* collection = FALSE.   ### not necessarily correct */
 
   res->uri = apr_pstrcat(base->pool, base->info->repos->root_path,
-                         path, NULL);
+                         path, (char *)NULL);
   res->hooks = &dav_svn__hooks_repository;
   res->pool = base->pool;
 
@@ -4292,8 +4301,8 @@ dav_svn__create_version_resource(dav_res
 
   result = parse_version_uri(comb, uri, NULL, 0);
   if (result != 0)
-    return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                         "Could not parse version resource uri.");
+    return dav_svn__new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                              "Could not parse version resource uri.");
 
   err = prep_version(comb);
   if (err)
@@ -4320,12 +4329,12 @@ handle_post_request(request_rec *r,
   status = dav_svn__parse_request_skel(&request_skel, r, pool);
 
   if (status != OK)
-    return dav_new_error(pool, status, 0,
-                         "Error parsing skel POST request body.");
+    return dav_svn__new_error(pool, status, 0,
+                              "Error parsing skel POST request body.");
 
   if (svn_skel__list_length(request_skel) < 1)
-    return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
-                         "Unable to identify skel POST request flavor.");
+    return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                              "Unable to identify skel POST request flavor.");
 
   if (svn_skel__matches_atom(request_skel->children, "create-txn"))
     {
@@ -4333,8 +4342,8 @@ handle_post_request(request_rec *r,
     }
   else
     {
-      return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
-                           "Unsupported skel POST request flavor.");
+      return dav_svn__new_error(pool, HTTP_BAD_REQUEST, 0,
+                                "Unsupported skel POST request flavor.");
     }
   /* NOTREACHED */
 }
@@ -4362,8 +4371,8 @@ int dav_svn__method_post(request_rec *r)
     }
   else
     {
-      derr = dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0,
-                           "Unsupported POST request type.");
+      derr = dav_svn__new_error(resource->pool, HTTP_BAD_REQUEST, 0,
+                                "Unsupported POST request type.");
     }
 
   /* If something went wrong above, we'll generate a response back to

Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/util.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/util.c Sat Dec 11 00:15:55
2010
@@ -39,6 +39,27 @@
 
 
 dav_error *
+dav_svn__new_error(apr_pool_t *pool,
+                   int status,
+                   int error_id,
+                   const char *desc)
+{
+/*
+ * Note: dav_new_error() in httpd 2.0/2.2 always treated
+ * the errno field in dav_error as an apr_status_t when
+ * logging; on some platforms errno and apr_status_t
+ * aren't directly interchangeable.  The code for httpd
+ * > 2.2 below perpetuates this.
+ */
+#if AP_MODULE_MAGIC_AT_LEAST(20091119,0)
+  /* old code assumed errno was valid; keep assuming */
+  return dav_new_error(pool, status, error_id, errno, desc);
+#else
+  return dav_new_error(pool, status, error_id, desc);
+#endif
+}
+
+dav_error *
 dav_svn__new_error_tag(apr_pool_t *pool,
                        int status,
                        int error_id,
@@ -46,6 +67,10 @@ dav_svn__new_error_tag(apr_pool_t *pool,
                        const char *namespace,
                        const char *tagname)
 {
+#if AP_MODULE_MAGIC_AT_LEAST(20091119,0)
+  return dav_new_error_tag(pool, status, error_id, 0,
+                           desc, namespace, tagname);
+#else
   /* dav_new_error_tag will record errno but Subversion makes no attempt
      to ensure that it is valid.  We reset it to avoid putting incorrect
      information into the error log, at the expense of possibly removing
@@ -53,6 +78,7 @@ dav_svn__new_error_tag(apr_pool_t *pool,
   errno = 0;
 
   return dav_new_error_tag(pool, status, error_id, desc, namespace, tagname);
+#endif
 }
 
 
@@ -107,6 +133,9 @@ dav_svn__convert_err(svn_error_t *serr,
       case SVN_ERR_FS_PATH_ALREADY_LOCKED:
         status = HTTP_LOCKED;
         break;
+      case SVN_ERR_FS_PROP_BASEVALUE_MISMATCH:
+        status = HTTP_PRECONDITION_FAILED;
+        break;
         /* add other mappings here */
       }
 
@@ -570,8 +599,8 @@ dav_svn__final_flush_or_error(request_re
     {
       apr_status_t apr_err = ap_fflush(output, bb);
       if (apr_err && (! derr))
-        derr = dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                             "Error flushing brigade.");
+        derr = dav_svn__new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                                  "Error flushing brigade.");
     }
   return derr;
 }

Modified: subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/version.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/mod_dav_svn/version.c Sat Dec 11 00:15:55
2010
@@ -41,7 +41,6 @@
 #include "private/svn_log.h"
 
 #include "dav_svn.h"
-#include "mod_dav_svn.h"
 
 
 svn_error_t *
@@ -84,8 +83,8 @@ set_auto_revprops(dav_resource *resource
 
   if (! (resource->type == DAV_RESOURCE_TYPE_WORKING
          && resource->info->auto_checked_out))
-    return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                         "Set_auto_revprops called on invalid resource.");
+    return dav_svn__new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                              "Set_auto_revprops called on invalid resource.");
 
   if ((serr = dav_svn__attach_auto_revprops(resource->info->root.txn,
                                             resource->info->repos_path,
@@ -143,6 +142,7 @@ get_vsn_options(apr_pool_t *p, apr_text_
   /* Send SVN_RA_CAPABILITY_* capabilities. */
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_DEPTH);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_LOG_REVPROPS);
+  apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS);
   apr_text_append(p, phdr, SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY);
   /* Mergeinfo is a special case: here we merely say that the server
    * knows how to handle mergeinfo -- whether the repository does too
@@ -235,19 +235,19 @@ get_option(const dav_resource *resource,
       apr_table_set(r->headers_out, SVN_DAV_ROOT_URI_HEADER, repos_root_uri);
       apr_table_set(r->headers_out, SVN_DAV_ME_RESOURCE_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_me_resource_uri(r), NULL));
+                                dav_svn__get_me_resource_uri(r), (char *)NULL));
       apr_table_set(r->headers_out, SVN_DAV_REV_ROOT_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_rev_root_stub(r), NULL));
+                                dav_svn__get_rev_root_stub(r), (char *)NULL));
       apr_table_set(r->headers_out, SVN_DAV_REV_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_rev_stub(r), NULL));
+                                dav_svn__get_rev_stub(r), (char *)NULL));
       apr_table_set(r->headers_out, SVN_DAV_TXN_ROOT_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_txn_root_stub(r), NULL));
+                                dav_svn__get_txn_root_stub(r), (char *)NULL));
       apr_table_set(r->headers_out, SVN_DAV_TXN_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
-                                dav_svn__get_txn_stub(r), NULL));
+                                dav_svn__get_txn_stub(r), (char *)NULL));
     }
 
   return NULL;
@@ -301,8 +301,9 @@ vsn_control(dav_resource *resource, cons
   /* All mod_dav_svn resources are versioned objects;  so it doesn't
      make sense to call vsn_control on a resource that exists . */
   if (resource->exists)
-    return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0,
-                         "vsn_control called on already-versioned resource.");
+    return dav_svn__new_error(resource->pool, HTTP_BAD_REQUEST, 0,
+                              "vsn_control called on already-versioned "
+                              "resource.");
 
   /* Only allow a NULL target, which means an create an 'empty' VCR. */
   if (target != NULL)
@@ -413,8 +414,9 @@ dav_svn__checkout(dav_resource *resource
           shared_txn_name = dav_svn__get_txn(resource->info->repos,
                                              shared_activity);
           if (! shared_txn_name)
-            return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                                 "Cannot look up a txn_name by activity");
+            return dav_svn__new_error(resource->pool,
+                                      HTTP_INTERNAL_SERVER_ERROR, 0,
+                                      "Cannot look up a txn_name by activity");
         }
 
       /* Tweak the VCR in-place, making it into a WR.  (Ignore the
@@ -889,21 +891,21 @@ dav_svn__checkin(dav_resource *resource,
       shared_txn_name = dav_svn__get_txn(resource->info->repos,
                                          shared_activity);
       if (! shared_txn_name)
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                             "Cannot look up a txn_name by activity");
+        return dav_svn__new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                                  "Cannot look up a txn_name by activity");
 
       /* Sanity checks */
       if (resource->info->root.txn_name
           && (strcmp(shared_txn_name, resource->info->root.txn_name) != 0))
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                             "Internal txn_name doesn't match"
-                             " autoversioning transaction.");
+        return dav_svn__new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                                  "Internal txn_name doesn't match "
+                                  "autoversioning transaction.");
 
       if (! resource->info->root.txn)
         /* should already be open by checkout */
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-                             "Autoversioning txn isn't open "
-                             "when it should be.");
+        return dav_svn__new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+                                  "Autoversioning txn isn't open "
+                                  "when it should be.");
 
       err = set_auto_revprops(resource);
       if (err)
@@ -1015,22 +1017,6 @@ deliver_report(request_rec *r,
 
   if (doc->root->ns == ns)
     {
-      /* If the "SVNPathAuthz short_circuit" directive is used,
-         resource->info->repos->repo_name becomes NULL.  */
-      if (resource->info->repos->repo_name == NULL)
-        {
-          const char *cleaned_uri, *relative_path, *repos_path;
-          int trailing_slash;
-          dav_error *err;
-
-          err = dav_svn_split_uri(r, r->uri, dav_svn__get_root_dir(r),
-                                  &cleaned_uri, &trailing_slash,
-                                  &(resource->info->repos->repo_name), 
-                                  &relative_path, &repos_path);
-          if (err)
-            return err;
-        }
-
       /* ### note that these report names should have symbols... */
 
       if (strcmp(doc->root->name, "update-report") == 0)



Mime
View raw message