subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1066452 [7/11] - in /subversion/branches/performance: ./ build/ build/ac-macros/ build/generator/ contrib/hook-scripts/ notes/ notes/api-errata/1.7/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/include/ subvers...
Date Wed, 02 Feb 2011 13:04:59 GMT
Modified: subversion/branches/performance/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/mirror.c?rev=1066452&r1=1066451&r2=1066452&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/mirror.c Wed Feb  2 13:04:51 2011
@@ -28,6 +28,8 @@
 #include <httpd.h>
 #include <http_core.h>
 
+#include "private/svn_fspath.h"
+
 #include "dav_svn.h"
 
 
@@ -147,10 +149,7 @@ apr_status_t dav_svn__location_in_filter
        (that is, if our root path matches that of the master server). */
     apr_uri_parse(r->pool, master_uri, &uri);
     root_dir = dav_svn__get_root_dir(r);
-    if (uri.path)
-        canonicalized_uri = svn_uri_canonicalize(uri.path, r->pool);
-    else
-        canonicalized_uri = uri.path;
+    canonicalized_uri = svn_urlpath__canonicalize(uri.path, r->pool);
     if (strcmp(canonicalized_uri, root_dir) == 0) {
         ap_remove_input_filter(f);
         return ap_get_brigade(f->next, bb, mode, block, readbytes);
@@ -269,10 +268,7 @@ apr_status_t dav_svn__location_body_filt
        (that is, if our root path matches that of the master server). */
     apr_uri_parse(r->pool, master_uri, &uri);
     root_dir = dav_svn__get_root_dir(r);
-    if (uri.path)
-        canonicalized_uri = svn_uri_canonicalize(uri.path, r->pool);
-    else
-        canonicalized_uri = uri.path;
+    canonicalized_uri = svn_urlpath__canonicalize(uri.path, r->pool);
     if (strcmp(canonicalized_uri, root_dir) == 0) {
         ap_remove_output_filter(f);
         return ap_pass_brigade(f->next, bb);

Modified: subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c?rev=1066452&r1=1066451&r2=1066452&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/mod_dav_svn.c Wed Feb  2 13:04:51
2011
@@ -37,6 +37,8 @@
 #include "svn_dso.h"
 #include "mod_dav_svn.h"
 
+#include "private/svn_fspath.h"
+
 #include "dav_svn.h"
 #include "mod_authz_svn.h"
 
@@ -172,10 +174,10 @@ create_dir_config(apr_pool_t *p, char *d
   /* NOTE: dir==NULL creates the default per-dir config */
   dir_conf_t *conf = apr_pcalloc(p, sizeof(*conf));
 
-  /*In subversion context dir is always considered to be coming from
-   <Location /blah> directive. So we treat it as URI. */
+  /* In subversion context dir is always considered to be coming from
+     <Location /blah> directive. So we treat it as a urlpath. */
   if (dir)
-    conf->root_dir = svn_uri_canonicalize(dir, p);
+    conf->root_dir = svn_urlpath__canonicalize(dir, p);
   conf->bulk_updates = CONF_FLAG_ON;
   conf->v2_protocol = CONF_FLAG_ON;
 
@@ -226,6 +228,8 @@ static const char *
 SVNMasterURI_cmd(cmd_parms *cmd, void *config, const char *arg1)
 {
   dir_conf_t *conf = config;
+  apr_uri_t parsed_uri;
+  const char *uri_base_name = "";
 
   /* SVNMasterURI requires mod_proxy and mod_proxy_http
    * (r->handler = "proxy-server" in mirror.c), make sure
@@ -234,7 +238,15 @@ SVNMasterURI_cmd(cmd_parms *cmd, void *c
     return "module mod_proxy not loaded, required for SVNMasterURI";
   if (ap_find_linked_module("mod_proxy_http.c") == NULL)
     return "module mod_proxy_http not loaded, required for SVNMasterURI";
-
+  if (APR_SUCCESS != apr_uri_parse(cmd->pool, arg1, &parsed_uri))
+    return "unable to parse SVNMasterURI value";
+  if (parsed_uri.path)
+    uri_base_name = svn_urlpath__basename(
+                        svn_urlpath__canonicalize(parsed_uri.path, cmd->pool),
+                        cmd->pool);
+  if (! *uri_base_name)
+    return "SVNMasterURI value must not be a server root";
+  
   conf->master_uri = apr_pstrdup(cmd->pool, arg1);
 
   return NULL;

Modified: subversion/branches/performance/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/reports/update.c?rev=1066452&r1=1066451&r2=1066452&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/reports/update.c Wed Feb  2 13:04:51
2011
@@ -39,6 +39,7 @@
 #include "svn_dav.h"
 #include "svn_props.h"
 #include "private/svn_log.h"
+#include "private/svn_fspath.h"
 
 #include "../dav_svn.h"
 
@@ -98,14 +99,8 @@ typedef struct item_baton_t {
   svn_boolean_t text_changed;        /* Did the file's contents change? */
   svn_boolean_t added;               /* File added? (Implies text_changed.) */
   svn_boolean_t copyfrom;            /* File copied? */
-  apr_array_header_t *changed_props; /* array of const char * prop names */
   apr_array_header_t *removed_props; /* array of const char * prop names */
 
-  /* "entry props" */
-  const char *committed_rev;
-  const char *committed_date;
-  const char *last_author;
-
 } item_baton_t;
 
 
@@ -184,19 +179,19 @@ make_child_baton(item_baton_t *parent, c
   baton->parent = parent;
 
   /* Telescope the path based on uc->anchor.  */
-  baton->path = svn_uri_join(parent->path, baton->name, pool);
+  baton->path = svn_fspath__join(parent->path, baton->name, pool);
 
   /* Telescope the path based on uc->dst_path in the exact same way. */
-  baton->path2 = svn_uri_join(parent->path2, baton->name, pool);
+  baton->path2 = svn_fspath__join(parent->path2, baton->name, pool);
 
   /* Telescope the third path:  it's relative, not absolute, to
      dst_path.  Now, we gotta be careful here, because if this
      operation had a target, and we're it, then we have to use the
      basename of our source reflection instead of our own.  */
   if ((*baton->uc->target) && (! parent->parent))
-    baton->path3 = svn_path_join(parent->path3, baton->uc->target, pool);
+    baton->path3 = svn_relpath_join(parent->path3, baton->uc->target, pool);
   else
-    baton->path3 = svn_path_join(parent->path3, baton->name, pool);
+    baton->path3 = svn_relpath_join(parent->path3, baton->name, pool);
 
   return baton;
 }
@@ -414,7 +409,7 @@ close_helper(svn_boolean_t is_dir, item_
 
   /* ### ack!  binary names won't float here! */
   /* If this is a copied file/dir, we can have removed props. */
-  if (baton->removed_props && (! baton->added || baton->copyfrom))
+  if (baton->removed_props && baton->copyfrom)
     {
       const char *qname;
       int i;
@@ -429,61 +424,15 @@ close_helper(svn_boolean_t is_dir, item_
         }
     }
 
-  if ((! baton->uc->send_all) && baton->changed_props && (! baton->added))
-    {
-      /* Tell the client to fetch all the props */
-      SVN_ERR(dav_svn__brigade_puts(baton->uc->bb, baton->uc->output,
-                                    "<S:fetch-props/>" DEBUG_CR));
-    }
-
-  SVN_ERR(dav_svn__brigade_puts(baton->uc->bb, baton->uc->output, "<S:prop>"));
-
-  /* Both modern and non-modern clients need the checksum... */
   if (baton->text_checksum)
     {
       SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                      "<V:md5-checksum>%s</V:md5-checksum>",
+                                      "<S:prop>"
+                                      "<V:md5-checksum>%s</V:md5-checksum>"
+                                      "</S:prop>",
                                       baton->text_checksum));
     }
 
-  /* ...but only non-modern clients want the 3 CR-related properties
-     sent like here, because they can't handle receiving these special
-     props inline like any other prop.
-     ### later on, compress via the 'scattered table' solution as
-     discussed with gstein.  -bmcs */
-  if (! baton->uc->send_all)
-    {
-      /* ### grrr, these DAV: property names are already #defined in
-         ra_dav.h, and statically defined in liveprops.c.  And now
-         they're hardcoded here.  Isn't there some header file that both
-         sides of the network can share?? */
-
-      /* ### special knowledge: svn_repos_dir_delta2 will never send
-       *removals* of the commit-info "entry props". */
-      if (baton->committed_rev)
-        SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                        "<D:version-name>%s</D:version-name>",
-                                        baton->committed_rev));
-
-      if (baton->committed_date)
-        SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                        "<D:creationdate>%s</D:creationdate>",
-                                        baton->committed_date));
-
-      if (baton->last_author)
-        SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
-                                        "<D:creator-displayname>%s"
-                                        "</D:creator-displayname>",
-                                        apr_xml_quote_string(baton->pool,
-                                                             baton->last_author,
-                                                             1)));
-
-    }
-
-  /* Close unconditionally, because we sent checksum unconditionally. */
-  SVN_ERR(dav_svn__brigade_puts(baton->uc->bb, baton->uc->output,
-                                "</S:prop>" DEBUG_CR));
-
   if (baton->added)
     SVN_ERR(dav_svn__brigade_printf(baton->uc->bb, baton->uc->output,
                                     "</S:add-%s>" DEBUG_CR,
@@ -646,8 +595,10 @@ upd_change_xxx_prop(void *baton,
   if (qname == name)
     qname = apr_pstrdup(b->pool, name);
 
-
-  if (b->uc->send_all)
+  /* Even if we are not in send-all mode we have the prop changes already,
+     so send them to the client now instead of telling the client to fetch
+     them later. */
+  if (b->uc->send_all || !b->added)
     {
       if (value)
         {
@@ -683,56 +634,16 @@ upd_change_xxx_prop(void *baton,
                                           qname));
         }
     }
-  else  /* don't do inline response, just cache prop names for close_helper */
+  else if (!value) /* This is an addition in 'skelta' mode so there is no
+                      need for an inline response since property fetching
+                      is implied in addition.  We still need to cache
+                      property removals because a copied path might
+                      have removed properties. */
     {
-      /* For now, store certain entry props, because we'll need to send
-         them later as standard DAV ("D:") props.  ### this should go
-         away and we should just tunnel those props on through for the
-         client to deal with. */
-#define NSLEN (sizeof(SVN_PROP_ENTRY_PREFIX) - 1)
-      if (! strncmp(name, SVN_PROP_ENTRY_PREFIX, NSLEN))
-        {
-          if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
-            {
-              b->committed_rev = value ?
-                apr_pstrdup(b->pool, value->data) : NULL;
-            }
-          else if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
-            {
-              b->committed_date = value ?
-                apr_pstrdup(b->pool, value->data) : NULL;
-            }
-          else if (strcmp(name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
-            {
-              b->last_author = value ?
-                apr_pstrdup(b->pool, value->data) : NULL;
-            }
-          else if ((strcmp(name, SVN_PROP_ENTRY_LOCK_TOKEN) == 0)
-                   && (! value))
-            {
-              /* We only support delete of lock tokens, not add/modify. */
-              if (! b->removed_props)
-                b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
-              APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
-            }
-          return SVN_NO_ERROR;
-        }
-#undef NSLEN
-
-      if (value)
-        {
-          if (! b->changed_props)
-            b->changed_props = apr_array_make(b->pool, 1, sizeof(name));
+      if (! b->removed_props)
+        b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
 
-          APR_ARRAY_PUSH(b->changed_props, const char *) = qname;
-        }
-      else
-        {
-          if (! b->removed_props)
-            b->removed_props = apr_array_make(b->pool, 1, sizeof(name));
-
-          APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
-        }
+      APR_ARRAY_PUSH(b->removed_props, const char *) = qname;
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/performance/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/repos.c?rev=1066452&r1=1066451&r2=1066452&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/repos.c Wed Feb  2 13:04:51 2011
@@ -49,6 +49,7 @@
 #include "svn_ra.h"  /* for SVN_RA_CAPABILITY_* */
 #include "svn_dirent_uri.h"
 #include "private/svn_log.h"
+#include "private/svn_fspath.h"
 
 #include "dav_svn.h"
 
@@ -1937,7 +1938,7 @@ get_resource(request_rec *r,
     {
       /* ...then the URL to the repository is actually one implicit
          component longer... */
-      root_path = svn_uri_join(root_path, repo_basename, r->pool);
+      root_path = svn_urlpath__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, repo_basename, r->pool);
     }
@@ -2299,11 +2300,11 @@ get_parent_path(const char *path, apr_po
 
   if (len > 0)
     {
-      /* Remove any trailing slash; else svn_uri_dirname() asserts. */
+      /* Remove any trailing slash; else svn_path_dirname() asserts. */
       if (tmp[len-1] == '/')
         tmp[len-1] = '\0';
 
-      return svn_uri_dirname(tmp, pool);
+      return svn_path_dirname(tmp, pool);
     }
 
   return path;

Modified: subversion/branches/performance/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/mod_dav_svn/version.c?rev=1066452&r1=1066451&r2=1066452&view=diff
==============================================================================
--- subversion/branches/performance/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/performance/subversion/mod_dav_svn/version.c Wed Feb  2 13:04:51 2011
@@ -40,6 +40,7 @@
 #include "private/svn_repos_private.h"
 #include "private/svn_dav_protocol.h"
 #include "private/svn_log.h"
+#include "private/svn_fspath.h"
 
 #include "dav_svn.h"
 
@@ -1234,7 +1235,7 @@ dav_svn__build_lock_hash(apr_hash_t **lo
                 return derr;
 
               /* Create an absolute fs-path */
-              lockpath = svn_uri_join(path_prefix, cdata, pool);
+              lockpath = svn_fspath__join(path_prefix, cdata, pool);
               if (lockpath && locktoken)
                 {
                   apr_hash_set(hash, lockpath, APR_HASH_KEY_STRING, locktoken);



Mime
View raw message