subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcor...@apache.org
Subject svn commit: r1067787 [2/9] - in /subversion/branches/diff-optimizations-bytes: ./ build/ notes/ notes/commit-access-templates/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_diff/ su...
Date Sun, 06 Feb 2011 22:19:13 GMT
Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/fetch.c Sun Feb  6 22:19:08 2011
@@ -1997,8 +1997,8 @@ cdata_handler(void *userdata, int state,
             /* Short write without associated error?  "Can't happen." */
             return svn_error_createf(SVN_ERR_STREAM_UNEXPECTED_EOF, NULL,
                                      _("Error writing to '%s': unexpected EOF"),
-                                     svn_path_local_style(rb->namestr->data,
-                                                          rb->pool));
+                                     svn_relpath_local_style(rb->namestr->data,
+                                                             rb->pool));
           }
       }
       break;

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_deleted_rev.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_deleted_rev.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_deleted_rev.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_deleted_rev.c Sun Feb  6 22:19:08 2011
@@ -137,8 +137,8 @@ svn_ra_neon__get_deleted_rev(svn_ra_sess
                                          ras, ras->url->data,
                                          peg_revision,
                                          pool));
-  final_bc_url = svn_path_url_add_component(bc_url.data, bc_relative.data,
-                                            pool);
+  final_bc_url = svn_path_url_add_component2(bc_url.data, bc_relative.data,
+                                             pool);
 
   body = apr_psprintf(pool,
                       "<?xml version=\"1.0\" encoding=\"utf-8\"?>"

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_location_segments.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_location_segments.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_location_segments.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/get_location_segments.c Sun Feb  6 22:19:08 2011
@@ -194,7 +194,7 @@ svn_ra_neon__get_location_segments(svn_r
   SVN_ERR(svn_ra_neon__get_baseline_info(NULL, &bc_url, &bc_relative, NULL,
                                          ras, ras->url->data,
                                          peg_revision, subpool));
-  bc = svn_path_url_add_component(bc_url.data, bc_relative.data, subpool);
+  bc = svn_path_url_add_component2(bc_url.data, bc_relative.data, subpool);
 
   err = svn_ra_neon__parsed_request(ras, "REPORT", bc,
                                     request_body->data, NULL, NULL,

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/merge.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/merge.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/merge.c Sun Feb  6 22:19:08 2011
@@ -37,6 +37,8 @@
 #include "svn_xml.h"
 
 #include "private/svn_dav_protocol.h"
+#include "private/svn_fspath.h"
+
 #include "svn_private_config.h"
 
 #include "ra_neon.h"
@@ -257,7 +259,7 @@ static svn_error_t * handle_resource(mer
     }
 
   /* a collection or regular resource */
-  if (! svn_path_is_ancestor(mc->base_href, mc->href->data))
+  if (! svn_urlpath__is_ancestor(mc->base_href, mc->href->data))
     {
       /* ### need something better than APR_EGENERAL */
       return svn_error_createf(APR_EGENERAL, NULL,
@@ -267,7 +269,7 @@ static svn_error_t * handle_resource(mer
     }
 
   /* given HREF of the form: BASE "/" RELATIVE, extract the relative portion */
-  relative = svn_path_is_child(mc->base_href, mc->href->data, NULL);
+  relative = svn_urlpath__is_child(mc->base_href, mc->href->data, NULL);
   if (! relative) /* the paths are equal */
     relative = "";
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/props.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/props.c Sun Feb  6 22:19:08 2011
@@ -710,26 +710,28 @@ svn_ra_neon__search_for_starting_props(s
   ne_uri_free(&parsed_url);
 
   /* Try to get the starting_props from the public url.  If the
-     resource no longer exists in HEAD, we'll get a failure.  That's
-     fine: just keep removing components and trying to get the
-     starting_props from parent directories. */
+     resource no longer exists in HEAD or is forbidden, we'll get a
+     failure.  That's fine: just keep removing components and trying
+     to get the starting_props from parent directories. */
   while (! svn_path_is_empty(path_s->data))
     {
       svn_pool_clear(iterpool);
       err = svn_ra_neon__get_starting_props(rsrc, sess, path_s->data,
                                             NULL, iterpool);
       if (! err)
-        break;   /* found an existing parent! */
+        break;   /* found an existing, readable parent! */
 
-      if (err->apr_err != SVN_ERR_FS_NOT_FOUND)
+      if ((err->apr_err != SVN_ERR_FS_NOT_FOUND) &&
+          (err->apr_err != SVN_ERR_RA_DAV_FORBIDDEN))
         return err;  /* found a _real_ error */
 
       /* else... lop off the basename and try again. */
       /* ### TODO: path_s is an absolute, schema-less URI, but
          ### technically not an FS_PATH. */
       svn_stringbuf_set(lopped_path,
-                        svn_path_join(svn_path_basename(path_s->data, iterpool),
-                                      lopped_path->data, iterpool));
+                        svn_relpath_join(svn_urlpath__basename(path_s->data,
+                                                               iterpool),
+                                         lopped_path->data, iterpool));
 
       len = path_s->len;
       svn_path_remove_component(path_s);
@@ -878,9 +880,9 @@ svn_error_t *svn_ra_neon__get_baseline_p
   /* don't forget to tack on the parts we lopped off in order to find
      the VCC...  We are expected to return a URI decoded relative
      path, so decode the lopped path first. */
-  my_bc_relative = svn_path_join(relative_path->data,
-                                 svn_path_uri_decode(lopped_path, pool),
-                                 pool);
+  my_bc_relative = svn_relpath_join(relative_path->data,
+                                    svn_path_uri_decode(lopped_path, pool),
+                                    pool);
 
   /* if they want the relative path (could be, they're just trying to find
      the baseline collection), then return it */

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c Sun Feb  6 22:19:08 2011
@@ -558,8 +558,12 @@ svn_ra_neon__copy_href(svn_stringbuf_t *
 
   apr_uri_t uri;
   apr_status_t apr_status;
+
   /* SRC can have trailing '/' */
-  src = svn_path_canonicalize(src, pool);
+  if (svn_path_is_url(src))
+    src = svn_uri_canonicalize(src, pool);
+  else
+    src = svn_urlpath__canonicalize(src, pool);
   apr_status = apr_uri_parse(pool, src, &uri);
 
   if (apr_status != APR_SUCCESS)
@@ -594,7 +598,7 @@ generate_error(svn_ra_neon__request_t *r
                                                req->url));
         case 403:
           return svn_error_create(SVN_ERR_RA_DAV_FORBIDDEN, NULL,
-                                  apr_psprintf(pool, _("access to '%s' forbidden"),
+                                  apr_psprintf(pool, _("Access to '%s' forbidden"),
                                                req->url));
 
         case 301:

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c Sun Feb  6 22:19:08 2011
@@ -1792,7 +1792,8 @@ svn_ra_serf__discover_vcc(const char **v
         }
       else
         {
-          if (err->apr_err != SVN_ERR_FS_NOT_FOUND)
+          if ((err->apr_err != SVN_ERR_FS_NOT_FOUND) &&
+              (err->apr_err != SVN_ERR_RA_DAV_FORBIDDEN))
             {
               return err;  /* found a _real_ error */
             }
@@ -1803,16 +1804,23 @@ svn_ra_serf__discover_vcc(const char **v
 
               /* Okay, strip off a component from PATH. */
               path = svn_urlpath__dirname(path, pool);
+
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+              /* An error occurred on conns. serf 0.4.0 remembers that
+                 the connection had a problem. We need to reset it, in
+                 order to use it again.  */
+              serf_connection_reset(conn->conn);
+#endif
             }
         }
     }
   while ((path[0] != '\0')
-         && (! (path[0] == '/') && (path[1] == '\0')));
+         && (! (path[0] == '/' && path[1] == '\0')));
 
   if (!*vcc_url)
     {
       return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
-                              _("The OPTIONS response did not include the "
+                              _("The PROPFIND response did not include the "
                                 "requested version-controlled-configuration "
                                 "value"));
     }
@@ -1924,6 +1932,10 @@ svn_ra_serf__error_on_status(int status_
                                      " please relocate")
                                  : _("Repository moved temporarily to '%s';"
                                      " please relocate"), location);
+      case 403:
+        return svn_error_createf(SVN_ERR_RA_DAV_FORBIDDEN, NULL,
+                                 _("Access to '%s' forbidden"), path);
+
       case 404:
         return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
                                  _("'%s' path not found"), path);

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_svn/protocol?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_svn/protocol Sun Feb  6 22:19:08 2011
@@ -370,8 +370,7 @@ second place for auth-request point as n
                 [ end-rev:number ] changed-paths:bool strict-node:bool
                 ? limit:number
                 ? include-merged-revisions:bool
-                all-revprops | revprops
-                ? ( revprop:string ... ) )
+                all-revprops | revprops ( revprop:string ... ) )
     Before sending response, server sends log entries, ending with "done".
     If a client does not want to specify a limit, it should send 0 as the
     limit parameter.  rev-props excludes author, date, and log; they are

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/authz.c Sun Feb  6 22:19:08 2011
@@ -33,6 +33,7 @@
 #include "svn_repos.h"
 #include "svn_config.h"
 #include "svn_ctype.h"
+#include "private/svn_fspath.h"
 
 
 /*** Structures. ***/
@@ -56,9 +57,9 @@ struct authz_lookup_baton {
 
   /* The following are used exclusively in recursive lookups. */
 
-  /* The path in the repository to authorize. */
+  /* The path in the repository (an fspath) to authorize. */
   const char *repos_path;
-  /* repos_path prefixed by the repository name. */
+  /* repos_path prefixed by the repository name and a colon. */
   const char *qualified_repos_path;
 
   /* Whether, at the end of a recursive lookup, access is granted. */
@@ -275,6 +276,23 @@ authz_parse_line(const char *name, const
 }
 
 
+/* Return TRUE iff the access rules in SECTION_NAME apply to PATH_SPEC
+ * (which is a repository name, colon, and repository fspath, such as
+ * "myrepos:/trunk/foo").
+ */
+static svn_boolean_t
+is_applicable_section(const char *path_spec,
+                      const char *section_name)
+{
+  apr_size_t path_spec_len = strlen(path_spec);
+
+  return ((strncmp(path_spec, section_name, path_spec_len) == 0)
+          && (path_spec[path_spec_len - 1] == '/'
+              || section_name[path_spec_len] == '/'
+              || section_name[path_spec_len] == '\0'));
+}
+
+
 /* Callback to parse a section and update the authz_baton if the
  * section denies access to the subtree the baton describes.
  */
@@ -285,10 +303,10 @@ authz_parse_section(const char *section_
   svn_boolean_t conclusive;
 
   /* Does the section apply to us? */
-  if (svn_path_is_ancestor(b->qualified_repos_path,
-                           section_name) == FALSE
-      && svn_path_is_ancestor(b->repos_path,
-                              section_name) == FALSE)
+  if (is_applicable_section(b->qualified_repos_path,
+                            section_name) == FALSE
+      && is_applicable_section(b->repos_path,
+                               section_name) == FALSE)
     return TRUE;
 
   /* Work out what this section grants. */
@@ -398,8 +416,8 @@ authz_get_any_access_parser_cb(const cha
 
   /* Does the section apply to the query? */
   if (section_name[0] == '/'
-      || strncasecmp(section_name, b->repos_path,
-                     strlen(b->repos_path)) == 0)
+      || strncmp(section_name, b->qualified_repos_path,
+                 strlen(b->qualified_repos_path)) == 0)
     {
       b->allow = b->deny = svn_authz_none;
 
@@ -433,7 +451,9 @@ authz_get_any_access(svn_config_t *cfg, 
   baton.user = user;
   baton.required_access = required_access;
   baton.access = FALSE; /* Deny access by default. */
-  baton.repos_path = apr_pstrcat(pool, repos_name, ":/", (char *)NULL);
+  baton.repos_path = "/";
+  baton.qualified_repos_path = apr_pstrcat(pool, repos_name,
+                                           ":/", (char *)NULL);
   
   /* We could have used svn_config_enumerate2 for "repos_name:/".
    * However, this requires access for root explicitly (which the user
@@ -746,18 +766,20 @@ svn_repos_authz_check_access(svn_authz_t
                              svn_boolean_t *access_granted,
                              apr_pool_t *pool)
 {
-  const char *current_path = path;
+  const char *current_path;
 
   /* If PATH is NULL, check if the user has *any* access. */
   if (!path)
     {
       *access_granted = authz_get_any_access(authz->cfg, repos_name,
-                                             user, required_access,
-                                             pool);
+                                             user, required_access, pool);
       return SVN_NO_ERROR;
     }
 
   /* Determine the granted access for the requested path. */
+  path = svn_fspath__canonicalize(path, pool);
+  current_path = path;
+  
   while (!authz_get_path_access(authz->cfg, repos_name,
                                 current_path, user,
                                 required_access,
@@ -774,7 +796,7 @@ svn_repos_authz_check_access(svn_authz_t
         }
 
       /* Work back to the parent path. */
-      current_path = svn_dirent_dirname(current_path, pool);
+      current_path = svn_fspath__dirname(current_path, pool);
     }
 
   /* If the caller requested recursive access, we need to walk through

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/commit.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/commit.c Sun Feb  6 22:19:08 2011
@@ -38,6 +38,7 @@
 #include "svn_props.h"
 #include "repos.h"
 #include "svn_private_config.h"
+#include "private/svn_fspath.h"
 #include "private/svn_repos_private.h"
 
 
@@ -165,6 +166,147 @@ check_authz(struct edit_baton *editor_ba
   return SVN_NO_ERROR;
 }
 
+
+/* Return a directory baton allocated in POOL which represents
+   FULL_PATH, which is the immediate directory child of the directory
+   represented by PARENT_BATON.  EDIT_BATON is the commit editor
+   baton.  WAS_COPIED reveals whether or not this directory is the
+   result of a copy operation.  BASE_REVISION is the base revision of
+   the directory. */
+static struct dir_baton *
+make_dir_baton(struct edit_baton *edit_baton,
+               struct dir_baton *parent_baton,
+               const char *full_path,
+               svn_boolean_t was_copied,
+               svn_revnum_t base_revision,
+               apr_pool_t *pool)
+{
+  struct dir_baton *db;
+  db = apr_pcalloc(pool, sizeof(*db));
+  db->edit_baton = edit_baton;
+  db->parent = parent_baton;
+  db->pool = pool;
+  db->path = full_path;
+  db->was_copied = was_copied;
+  db->base_rev = base_revision;
+  return db;
+}
+
+
+/* This function is the shared guts of add_file() and add_directory(),
+   which see for the meanings of the parameters.  The only extra
+   parameter here is IS_DIR, which is TRUE when adding a directory,
+   and FALSE when adding a file.  */
+static svn_error_t *
+add_file_or_directory(const char *path,
+                      void *parent_baton,
+                      const char *copy_path,
+                      svn_revnum_t copy_revision,
+                      svn_boolean_t is_dir,
+                      apr_pool_t *pool,
+                      void **return_baton)
+{
+  struct dir_baton *pb = parent_baton;
+  struct edit_baton *eb = pb->edit_baton;
+  apr_pool_t *subpool = svn_pool_create(pool);
+  svn_boolean_t was_copied = FALSE;
+  const char *full_path;
+
+  full_path = svn_fspath__join(eb->base_path,
+                               svn_relpath_canonicalize(path, pool), pool);
+
+  /* Sanity check. */
+  if (copy_path && (! SVN_IS_VALID_REVNUM(copy_revision)))
+    return svn_error_createf
+      (SVN_ERR_FS_GENERAL, NULL,
+       _("Got source path but no source revision for '%s'"), full_path);
+
+  if (copy_path)
+    {
+      const char *fs_path;
+      svn_fs_root_t *copy_root;
+      svn_node_kind_t kind;
+      size_t repos_url_len;
+      svn_repos_authz_access_t required;
+
+      /* Copy requires recursive write access to the destination path
+         and write access to the parent path. */
+      required = svn_authz_write | (is_dir ? svn_authz_recursive : 0);
+      SVN_ERR(check_authz(eb, full_path, eb->txn_root,
+                          required, subpool));
+      SVN_ERR(check_authz(eb, pb->path, eb->txn_root,
+                          svn_authz_write, subpool));
+
+      /* Check PATH in our transaction.  Make sure it does not exist
+         unless its parent directory was copied (in which case, the
+         thing might have been copied in as well), else return an
+         out-of-dateness error. */
+      SVN_ERR(svn_fs_check_path(&kind, eb->txn_root, full_path, subpool));
+      if ((kind != svn_node_none) && (! pb->was_copied))
+        return out_of_date(full_path, kind);
+
+      /* For now, require that the url come from the same repository
+         that this commit is operating on. */
+      copy_path = svn_path_uri_decode(copy_path, subpool);
+      repos_url_len = strlen(eb->repos_url);
+      if (strncmp(copy_path, eb->repos_url, repos_url_len) != 0)
+        return svn_error_createf
+          (SVN_ERR_FS_GENERAL, NULL,
+           _("Source url '%s' is from different repository"), copy_path);
+
+      fs_path = apr_pstrdup(subpool, copy_path + repos_url_len);
+
+      /* Now use the "fs_path" as an absolute path within the
+         repository to make the copy from. */
+      SVN_ERR(svn_fs_revision_root(&copy_root, eb->fs,
+                                   copy_revision, subpool));
+
+      /* Copy also requires (recursive) read access to the source */
+      required = svn_authz_read | (is_dir ? svn_authz_recursive : 0);
+      SVN_ERR(check_authz(eb, fs_path, copy_root, required, subpool));
+
+      SVN_ERR(svn_fs_copy(copy_root, fs_path,
+                          eb->txn_root, full_path, subpool));
+      was_copied = TRUE;
+    }
+  else
+    {
+      /* No ancestry given, just make a new directory or empty file.
+         Note that we don't perform an existence check here like the
+         copy-from case does -- that's because svn_fs_make_*()
+         already errors out if the file already exists.  Verify write
+         access to the full path and to the parent. */
+      SVN_ERR(check_authz(eb, full_path, eb->txn_root,
+                          svn_authz_write, subpool));
+      SVN_ERR(check_authz(eb, pb->path, eb->txn_root,
+                          svn_authz_write, subpool));
+      if (is_dir)
+        SVN_ERR(svn_fs_make_dir(eb->txn_root, full_path, subpool));
+      else
+        SVN_ERR(svn_fs_make_file(eb->txn_root, full_path, subpool));
+    }
+
+  /* Cleanup our temporary subpool. */
+  svn_pool_destroy(subpool);
+
+  /* Build a new child baton. */
+  if (is_dir)
+    {
+      *return_baton = make_dir_baton(eb, pb, full_path, was_copied,
+                                     SVN_INVALID_REVNUM, pool);
+    }
+  else
+    {
+      struct file_baton *new_fb = apr_pcalloc(pool, sizeof(*new_fb));
+      new_fb->edit_baton = eb;
+      new_fb->path = full_path;
+      *return_baton = new_fb;
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
 
 /*** Editor functions ***/
 
@@ -231,7 +373,10 @@ delete_entry(const char *path,
   svn_node_kind_t kind;
   svn_revnum_t cr_rev;
   svn_repos_authz_access_t required = svn_authz_write;
-  const char *full_path = svn_path_join(eb->base_path, path, pool);
+  const char *full_path;
+
+  full_path = svn_fspath__join(eb->base_path,
+                               svn_relpath_canonicalize(path, pool), pool);
 
   /* Check PATH in our transaction.  */
   SVN_ERR(svn_fs_check_path(&kind, eb->txn_root, full_path, pool));
@@ -262,26 +407,6 @@ delete_entry(const char *path,
 }
 
 
-static struct dir_baton *
-make_dir_baton(struct edit_baton *edit_baton,
-               struct dir_baton *parent_baton,
-               const char *full_path,
-               svn_boolean_t was_copied,
-               svn_revnum_t base_revision,
-               apr_pool_t *pool)
-{
-  struct dir_baton *db;
-  db = apr_pcalloc(pool, sizeof(*db));
-  db->edit_baton = edit_baton;
-  db->parent = parent_baton;
-  db->pool = pool;
-  db->path = full_path;
-  db->was_copied = was_copied;
-  db->base_rev = base_revision;
-  return db;
-}
-
-
 static svn_error_t *
 add_directory(const char *path,
               void *parent_baton,
@@ -290,88 +415,8 @@ add_directory(const char *path,
               apr_pool_t *pool,
               void **child_baton)
 {
-  struct dir_baton *pb = parent_baton;
-  struct edit_baton *eb = pb->edit_baton;
-  const char *full_path = svn_path_join(eb->base_path, path, pool);
-  apr_pool_t *subpool = svn_pool_create(pool);
-  svn_boolean_t was_copied = FALSE;
-
-  /* Sanity check. */
-  if (copy_path && (! SVN_IS_VALID_REVNUM(copy_revision)))
-    return svn_error_createf
-      (SVN_ERR_FS_GENERAL, NULL,
-       _("Got source path but no source revision for '%s'"), full_path);
-
-  if (copy_path)
-    {
-      const char *fs_path;
-      svn_fs_root_t *copy_root;
-      svn_node_kind_t kind;
-      size_t repos_url_len;
-
-      /* Copy requires recursive write access to the destination path
-         and write access to the parent path. */
-      SVN_ERR(check_authz(eb, full_path, eb->txn_root,
-                          svn_authz_write | svn_authz_recursive,
-                          subpool));
-      SVN_ERR(check_authz(eb, pb->path, eb->txn_root,
-                          svn_authz_write, subpool));
-
-      /* Check PATH in our transaction.  Make sure it does not exist
-         unless its parent directory was copied (in which case, the
-         thing might have been copied in as well), else return an
-         out-of-dateness error. */
-      SVN_ERR(svn_fs_check_path(&kind, eb->txn_root, full_path, subpool));
-      if ((kind != svn_node_none) && (! pb->was_copied))
-        return out_of_date(full_path, kind);
-
-      /* For now, require that the url come from the same repository
-         that this commit is operating on. */
-      copy_path = svn_path_uri_decode(copy_path, subpool);
-      repos_url_len = strlen(eb->repos_url);
-      if (strncmp(copy_path, eb->repos_url, repos_url_len) != 0)
-        return svn_error_createf
-          (SVN_ERR_FS_GENERAL, NULL,
-           _("Source url '%s' is from different repository"), copy_path);
-
-      fs_path = apr_pstrdup(subpool, copy_path + repos_url_len);
-
-      /* Now use the "fs_path" as an absolute path within the
-         repository to make the copy from. */
-      SVN_ERR(svn_fs_revision_root(&copy_root, eb->fs,
-                                   copy_revision, subpool));
-
-      /* Copy also requires recursive read access to the source
-         path. */
-      SVN_ERR(check_authz(eb, fs_path, copy_root,
-                          svn_authz_read | svn_authz_recursive,
-                          subpool));
-
-      SVN_ERR(svn_fs_copy(copy_root, fs_path,
-                          eb->txn_root, full_path, subpool));
-      was_copied = TRUE;
-    }
-  else
-    {
-      /* No ancestry given, just make a new directory.  We don't
-         bother with an out-of-dateness check here because
-         svn_fs_make_dir will error out if PATH already exists.
-         Verify write access to the full path and the parent
-         directory. */
-      SVN_ERR(check_authz(eb, full_path, eb->txn_root,
-                          svn_authz_write, subpool));
-      SVN_ERR(check_authz(eb, pb->path, eb->txn_root,
-                          svn_authz_write, subpool));
-      SVN_ERR(svn_fs_make_dir(eb->txn_root, full_path, subpool));
-    }
-
-  /* Cleanup our temporary subpool. */
-  svn_pool_destroy(subpool);
-
-  /* Build a new dir baton for this directory. */
-  *child_baton = make_dir_baton(eb, pb, full_path, was_copied,
-                                SVN_INVALID_REVNUM, pool);
-  return SVN_NO_ERROR;
+  return add_file_or_directory(path, parent_baton, copy_path, copy_revision,
+                               TRUE /* is_dir */, pool, child_baton);
 }
 
 
@@ -385,7 +430,10 @@ open_directory(const char *path,
   struct dir_baton *pb = parent_baton;
   struct edit_baton *eb = pb->edit_baton;
   svn_node_kind_t kind;
-  const char *full_path = svn_path_join(eb->base_path, path, pool);
+  const char *full_path;
+
+  full_path = svn_fspath__join(eb->base_path,
+                               svn_relpath_canonicalize(path, pool), pool);
 
   /* Check PATH in our transaction.  If it does not exist,
      return a 'Path not present' error. */
@@ -425,8 +473,6 @@ apply_textdelta(void *file_baton,
 }
 
 
-
-
 static svn_error_t *
 add_file(const char *path,
          void *parent_baton,
@@ -435,92 +481,11 @@ add_file(const char *path,
          apr_pool_t *pool,
          void **file_baton)
 {
-  struct file_baton *new_fb;
-  struct dir_baton *pb = parent_baton;
-  struct edit_baton *eb = pb->edit_baton;
-  const char *full_path = svn_path_join(eb->base_path, path, pool);
-  apr_pool_t *subpool = svn_pool_create(pool);
-
-  /* Sanity check. */
-  if (copy_path && (! SVN_IS_VALID_REVNUM(copy_revision)))
-    return svn_error_createf
-      (SVN_ERR_FS_GENERAL, NULL,
-       _("Got source path but no source revision for '%s'"), full_path);
-
-  if (copy_path)
-    {
-      const char *fs_path;
-      svn_fs_root_t *copy_root;
-      svn_node_kind_t kind;
-      size_t repos_url_len;
-
-      /* Copy requires recursive write to the destination path and
-         parent path. */
-      SVN_ERR(check_authz(eb, full_path, eb->txn_root,
-                          svn_authz_write, subpool));
-      SVN_ERR(check_authz(eb, pb->path, eb->txn_root,
-                          svn_authz_write, subpool));
-
-      /* Check PATH in our transaction.  Make sure it does not exist
-         unless its parent directory was copied (in which case, the
-         thing might have been copied in as well), else return an
-         out-of-dateness error. */
-      SVN_ERR(svn_fs_check_path(&kind, eb->txn_root, full_path, subpool));
-      if ((kind != svn_node_none) && (! pb->was_copied))
-        return out_of_date(full_path, kind);
-
-      /* For now, require that the url come from the same repository
-         that this commit is operating on. */
-      copy_path = svn_path_uri_decode(copy_path, subpool);
-      repos_url_len = strlen(eb->repos_url);
-      if (strncmp(copy_path, eb->repos_url, repos_url_len) != 0)
-            return svn_error_createf
-              (SVN_ERR_FS_GENERAL, NULL,
-               _("Source url '%s' is from different repository"), copy_path);
-
-      fs_path = apr_pstrdup(subpool, copy_path + repos_url_len);
-
-      /* Now use the "fs_path" as an absolute path within the
-         repository to make the copy from. */
-      SVN_ERR(svn_fs_revision_root(&copy_root, eb->fs,
-                                   copy_revision, subpool));
-
-      /* Copy also requires read access to the source */
-      SVN_ERR(check_authz(eb, fs_path, copy_root,
-                          svn_authz_read, subpool));
-
-      SVN_ERR(svn_fs_copy(copy_root, fs_path,
-                          eb->txn_root, full_path, subpool));
-    }
-  else
-    {
-      /* No ancestry given, just make a new, empty file.  Note that we
-         don't perform an existence check here like the copy-from case
-         does -- that's because svn_fs_make_file() already errors out
-         if the file already exists.  Verify write access to the full
-         path and to the parent. */
-      SVN_ERR(check_authz(eb, full_path, eb->txn_root, svn_authz_write,
-                          subpool));
-      SVN_ERR(check_authz(eb, pb->path, eb->txn_root, svn_authz_write,
-                          subpool));
-      SVN_ERR(svn_fs_make_file(eb->txn_root, full_path, subpool));
-    }
-
-  /* Cleanup our temporary subpool. */
-  svn_pool_destroy(subpool);
-
-  /* Build a new file baton */
-  new_fb = apr_pcalloc(pool, sizeof(*new_fb));
-  new_fb->edit_baton = eb;
-  new_fb->path = full_path;
-
-  *file_baton = new_fb;
-  return SVN_NO_ERROR;
+  return add_file_or_directory(path, parent_baton, copy_path, copy_revision,
+                               FALSE /* is_dir */, pool, file_baton);
 }
 
 
-
-
 static svn_error_t *
 open_file(const char *path,
           void *parent_baton,
@@ -533,7 +498,10 @@ open_file(const char *path,
   struct edit_baton *eb = pb->edit_baton;
   svn_revnum_t cr_rev;
   apr_pool_t *subpool = svn_pool_create(pool);
-  const char *full_path = svn_path_join(eb->base_path, path, pool);
+  const char *full_path;
+
+  full_path = svn_fspath__join(eb->base_path,
+                               svn_relpath_canonicalize(path, pool), pool);
 
   /* Check for read authorization. */
   SVN_ERR(check_authz(eb, full_path, eb->txn_root,
@@ -873,7 +841,7 @@ svn_repos_get_commit_editor5(const svn_d
   eb->commit_callback_baton = callback_baton;
   eb->authz_callback = authz_callback;
   eb->authz_baton = authz_baton;
-  eb->base_path = apr_pstrdup(subpool, base_path);
+  eb->base_path = svn_fspath__canonicalize(base_path, subpool);
   eb->repos = repos;
   eb->repos_url = repos_url;
   eb->repos_name = svn_dirent_basename(svn_repos_path(repos, subpool),

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/delta.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/delta.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/delta.c Sun Feb  6 22:19:08 2011
@@ -233,11 +233,15 @@ svn_repos_dir_delta2(svn_fs_root_t *src_
   const char *authz_root_path;
 
   /* SRC_PARENT_DIR must be valid. */
-  if (! src_parent_dir)
+  if (src_parent_dir)
+    src_parent_dir = svn_relpath_canonicalize(src_parent_dir, pool);
+  else
     return not_a_dir_error("source parent", src_parent_dir);
 
   /* TGT_FULLPATH must be valid. */
-  if (! tgt_fullpath)
+  if (tgt_fullpath)
+    tgt_fullpath = svn_relpath_canonicalize(tgt_fullpath, pool);
+  else
     return svn_error_create(SVN_ERR_FS_PATH_SYNTAX, 0,
                             _("Invalid target path"));
 
@@ -248,12 +252,12 @@ svn_repos_dir_delta2(svn_fs_root_t *src_
   /* Calculate the fs path implicitly used for editor->open_root, so
      we can do an authz check on that path first. */
   if (*src_entry)
-    authz_root_path = svn_dirent_dirname(tgt_fullpath, pool);
+    authz_root_path = svn_relpath_dirname(tgt_fullpath, pool);
   else
     authz_root_path = tgt_fullpath;
 
   /* Construct the full path of the source item. */
-  src_fullpath = svn_path_join(src_parent_dir, src_entry, pool);
+  src_fullpath = svn_relpath_join(src_parent_dir, src_entry, pool);
 
   /* Get the node kinds for the source and target paths.  */
   SVN_ERR(svn_fs_check_path(&tgt_kind, tgt_root, tgt_fullpath, pool));
@@ -958,8 +962,8 @@ delta_dirs(struct context *c,
       apr_hash_this(hi, &key, &klen, &val);
       t_entry = val;
       tgt_kind = t_entry->kind;
-      t_fullpath = svn_path_join(target_path, t_entry->name, subpool);
-      e_fullpath = svn_path_join(edit_path, t_entry->name, subpool);
+      t_fullpath = svn_relpath_join(target_path, t_entry->name, subpool);
+      e_fullpath = svn_relpath_join(edit_path, t_entry->name, subpool);
 
       /* Can we find something with the same name in the source
          entries hash? */
@@ -967,7 +971,7 @@ delta_dirs(struct context *c,
         {
           svn_node_kind_t src_kind;
 
-          s_fullpath = svn_path_join(source_path, t_entry->name, subpool);
+          s_fullpath = svn_relpath_join(source_path, t_entry->name, subpool);
           src_kind = s_entry->kind;
 
           if (depth == svn_depth_infinity
@@ -1043,7 +1047,7 @@ delta_dirs(struct context *c,
           apr_hash_this(hi, NULL, NULL, &val);
           s_entry = val;
           src_kind = s_entry->kind;
-          e_fullpath = svn_path_join(edit_path, s_entry->name, subpool);
+          e_fullpath = svn_relpath_join(edit_path, s_entry->name, subpool);
 
           /* Do we actually want to delete the dir if we're non-recursive? */
           if (depth == svn_depth_infinity

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/dump.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/dump.c Sun Feb  6 22:19:08 2011
@@ -89,8 +89,8 @@ store_delta(apr_file_t **tempfile, svn_f
 
 struct edit_baton
 {
-  /* The path which implicitly prepends all full paths coming into
-     this editor.  This will almost always be "" or "/".  */
+  /* The relpath which implicitly prepends all full paths coming into
+     this editor.  This will almost always be "".  */
   const char *path;
 
   /* The stream to dump to. */
@@ -137,13 +137,13 @@ struct dir_baton
   /* has this directory been written to the output stream? */
   svn_boolean_t written_out;
 
-  /* the absolute path to this directory */
+  /* the repository relpath associated with this directory */
   const char *path;
 
-  /* the comparison path and revision of this directory.  if both of
-     these are valid, use them as a source against which to compare
-     the directory instead of the default comparison source of PATH in
-     the previous revision. */
+  /* The comparison repository relpath and revision of this directory.
+     If both of these are valid, use them as a source against which to
+     compare the directory instead of the default comparison source of
+     PATH in the previous revision. */
   const char *cmp_path;
   svn_revnum_t cmp_rev;
 
@@ -189,18 +189,18 @@ make_dir_baton(const char *path,
 
   /* Construct the full path of this node. */
   if (pb)
-    full_path = svn_path_join(eb->path, path, pool);
+    full_path = svn_relpath_join(eb->path, path, pool);
   else
     full_path = apr_pstrdup(pool, eb->path);
 
   /* Remove leading slashes from copyfrom paths. */
   if (cmp_path)
-    cmp_path = ((*cmp_path == '/') ? cmp_path + 1 : cmp_path);
+    cmp_path = svn_relpath_canonicalize(cmp_path, pool);
 
   new_db->edit_baton = eb;
   new_db->parent_dir_baton = pb;
   new_db->path = full_path;
-  new_db->cmp_path = cmp_path ? apr_pstrdup(pool, cmp_path) : NULL;
+  new_db->cmp_path = cmp_path;
   new_db->cmp_rev = cmp_rev;
   new_db->added = added;
   new_db->written_out = FALSE;
@@ -225,7 +225,7 @@ make_dir_baton(const char *path,
   */
 static svn_error_t *
 dump_node(struct edit_baton *eb,
-          const char *path,    /* an absolute path. */
+          const char *path,
           svn_node_kind_t kind,
           enum svn_node_action action,
           svn_boolean_t is_copy,
@@ -245,7 +245,7 @@ dump_node(struct edit_baton *eb,
   /* Write out metadata headers for this file node. */
   SVN_ERR(svn_stream_printf(eb->stream, pool,
                             SVN_REPOS_DUMPFILE_NODE_PATH ": %s\n",
-                            (*path == '/') ? path + 1 : path));
+                            path));
   if (kind == svn_node_file)
     SVN_ERR(svn_stream_printf(eb->stream, pool,
                               SVN_REPOS_DUMPFILE_NODE_KIND ": file\n"));
@@ -255,7 +255,7 @@ dump_node(struct edit_baton *eb,
 
   /* Remove leading slashes from copyfrom paths. */
   if (cmp_path)
-    cmp_path = ((*cmp_path == '/') ? cmp_path + 1 : cmp_path);
+    cmp_path = svn_relpath_canonicalize(cmp_path, pool);
 
   /* Validate the comparison path/rev. */
   if (ARE_VALID_COPY_ARGS(cmp_path, cmp_rev))
@@ -682,8 +682,8 @@ open_directory(const char *path,
      record the same for this one. */
   if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev))
     {
-      cmp_path = svn_path_join(pb->cmp_path,
-                               svn_dirent_basename(path, pool), pool);
+      cmp_path = svn_relpath_join(pb->cmp_path,
+                                  svn_relpath_basename(path, pool), pool);
       cmp_rev = pb->cmp_rev;
     }
 
@@ -779,8 +779,8 @@ open_file(const char *path,
      record the same for this one. */
   if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev))
     {
-      cmp_path = svn_path_join(pb->cmp_path,
-                               svn_dirent_basename(path, pool), pool);
+      cmp_path = svn_relpath_join(pb->cmp_path,
+                                  svn_relpath_basename(path, pool), pool);
       cmp_rev = pb->cmp_rev;
     }
 
@@ -1059,7 +1059,7 @@ svn_repos_dump_fs3(svn_repos_t *repos,
          non-incremental dump. */
       use_deltas_for_rev = use_deltas && (incremental || i != start_rev);
       SVN_ERR(get_dump_editor(&dump_editor, &dump_edit_baton, fs, to_rev,
-                              "/", stream, notify_func, notify_baton,
+                              "", stream, notify_func, notify_baton,
                               start_rev, use_deltas_for_rev, FALSE, subpool));
 
       /* Drive the editor in one way or another. */
@@ -1072,8 +1072,8 @@ svn_repos_dump_fs3(svn_repos_t *repos,
         {
           svn_fs_root_t *from_root;
           SVN_ERR(svn_fs_revision_root(&from_root, fs, from_rev, subpool));
-          SVN_ERR(svn_repos_dir_delta2(from_root, "/", "",
-                                       to_root, "/",
+          SVN_ERR(svn_repos_dir_delta2(from_root, "", "",
+                                       to_root, "",
                                        dump_editor, dump_edit_baton,
                                        NULL,
                                        NULL,
@@ -1166,7 +1166,7 @@ verify_directory_entry(void *baton, cons
                        void *val, apr_pool_t *pool)
 {
   struct dir_baton *db = baton;
-  char *path = svn_path_join(db->path, (const char *)key, pool);
+  char *path = svn_relpath_join(db->path, (const char *)key, pool);
   svn_node_kind_t kind;
   apr_hash_t *dirents;
   svn_filesize_t len;

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load-fs-vtable.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load-fs-vtable.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load-fs-vtable.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/load-fs-vtable.c Sun Feb  6 22:19:08 2011
@@ -28,7 +28,6 @@
 #include "svn_fs.h"
 #include "svn_repos.h"
 #include "svn_string.h"
-#include "svn_path.h"
 #include "svn_props.h"
 #include "repos.h"
 #include "svn_private_config.h"
@@ -36,9 +35,11 @@
 #include "svn_checksum.h"
 #include "svn_subst.h"
 #include "svn_ctype.h"
+#include "svn_dirent_uri.h"
 
 #include <apr_lib.h>
 
+#include "private/svn_fspath.h"
 #include "private/svn_dep_compat.h"
 #include "private/svn_mergeinfo_private.h"
 
@@ -56,7 +57,7 @@ struct parse_baton
   svn_boolean_t use_pre_commit_hook;
   svn_boolean_t use_post_commit_hook;
   enum svn_repos_load_uuid uuid_action;
-  const char *parent_dir;
+  const char *parent_dir; /* repository relpath, or NULL */
   svn_repos_notify_func_t notify_func;
   void *notify_baton;
   svn_repos_notify_t *notify;
@@ -170,16 +171,12 @@ prefix_mergeinfo_paths(svn_string_t **me
       const char *path, *merge_source;
 
       apr_hash_this(hi, &key, NULL, &rangelist);
-      merge_source = key;
-
-      /* The svn:mergeinfo property syntax demands absolute repository
-         paths, so prepend a leading slash if PARENT_DIR lacks one.  */
-      if (*parent_dir != '/')
-        path = svn_path_join_many(pool, "/", parent_dir,
-                                  merge_source + 1, NULL);
-      else
-        path = svn_path_join(parent_dir, merge_source + 1, pool);
+      merge_source = svn_relpath_canonicalize(key, pool);
 
+      /* The svn:mergeinfo property syntax demands a repos abspath */
+      path = svn_fspath__canonicalize(svn_relpath_join(parent_dir,
+                                                       merge_source, pool),
+                                      pool);
       apr_hash_set(prefixed_mergeinfo, path, APR_HASH_KEY_STRING, rangelist);
     }
   return svn_mergeinfo_to_string(mergeinfo_val, prefixed_mergeinfo, pool);
@@ -336,10 +333,11 @@ make_node_baton(struct node_baton **node
   if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_PATH,
                           APR_HASH_KEY_STRING)))
   {
+    val = svn_relpath_canonicalize(val, pool);
     if (rb->pb->parent_dir)
-      nb->path = svn_path_join(rb->pb->parent_dir, val, pool);
+      nb->path = svn_relpath_join(rb->pb->parent_dir, val, pool);
     else
-      nb->path = apr_pstrdup(pool, val);
+      nb->path = val;
   }
 
   if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_KIND,
@@ -374,11 +372,11 @@ make_node_baton(struct node_baton **node
   if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH,
                           APR_HASH_KEY_STRING)))
     {
+      val = svn_relpath_canonicalize(val, pool);
       if (rb->pb->parent_dir)
-        nb->copyfrom_path = svn_path_join(rb->pb->parent_dir,
-                                          (*val == '/' ? val + 1 : val), pool);
+        nb->copyfrom_path = svn_relpath_join(rb->pb->parent_dir, val, pool);
       else
-        nb->copyfrom_path = apr_pstrdup(pool, val);
+        nb->copyfrom_path = val;
     }
 
   if ((val = apr_hash_get(headers, SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM,
@@ -667,7 +665,6 @@ set_node_property(void *baton,
   struct node_baton *nb = baton;
   struct revision_baton *rb = nb->rb;
   struct parse_baton *pb = rb->pb;
-  const char *parent_dir = pb->parent_dir;
 
   if (strcmp(name, SVN_PROP_MERGEINFO) == 0)
     {
@@ -706,13 +703,13 @@ set_node_property(void *baton,
       SVN_ERR(renumber_mergeinfo_revs(&renumbered_mergeinfo, prop_val, rb,
                                       nb->pool));
       value = renumbered_mergeinfo;
-      if (parent_dir)
+      if (pb->parent_dir)
         {
-          /* Prefix the merge source paths with PARENT_DIR. */
+          /* Prefix the merge source paths with PB->parent_dir. */
           /* ASSUMPTION: All source paths are included in the dump stream. */
           svn_string_t *mergeinfo_val;
-          SVN_ERR(prefix_mergeinfo_paths(&mergeinfo_val, value, parent_dir,
-                                         nb->pool));
+          SVN_ERR(prefix_mergeinfo_paths(&mergeinfo_val, value,
+                                         pb->parent_dir, nb->pool));
           value = mergeinfo_val;
         }
     }
@@ -945,6 +942,9 @@ svn_repos_get_fs_build_parser3(const svn
   svn_repos_parse_fns2_t *parser = apr_pcalloc(pool, sizeof(*parser));
   struct parse_baton *pb = apr_pcalloc(pool, sizeof(*pb));
 
+  if (parent_dir)
+    parent_dir = svn_relpath_canonicalize(parent_dir, pool);
+
   parser->new_revision_record = new_revision_record;
   parser->new_node_record = new_node_record;
   parser->uuid_record = uuid_record;

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/log.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/log.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/log.c Sun Feb  6 22:19:08 2011
@@ -1052,6 +1052,7 @@ get_path_histories(apr_array_header_t **
 {
   svn_fs_root_t *root;
   apr_pool_t *iterpool;
+  svn_error_t *err;
   int i;
 
   /* Create a history object for each path so we can walk through
@@ -1093,7 +1094,6 @@ get_path_histories(apr_array_header_t **
 
       if (i < MAX_OPEN_HISTORIES)
         {
-          svn_error_t *err;
           err = svn_fs_node_history(&info->hist, root, this_path, pool);
           if (err
               && ignore_missing_locations
@@ -1115,10 +1115,20 @@ get_path_histories(apr_array_header_t **
           info->newpool = NULL;
         }
 
-      SVN_ERR(get_history(info, fs,
-                          strict_node_history,
-                          authz_read_func, authz_read_baton,
-                          hist_start, pool));
+      err = get_history(info, fs,
+                        strict_node_history,
+                        authz_read_func, authz_read_baton,
+                        hist_start, pool);
+      if (err
+          && ignore_missing_locations
+          && (err->apr_err == SVN_ERR_FS_NOT_FOUND ||
+              err->apr_err == SVN_ERR_FS_NOT_DIRECTORY ||
+              err->apr_err == SVN_ERR_FS_NO_SUCH_REVISION))
+        {
+          svn_error_clear(err);
+          continue;
+        }
+      SVN_ERR(err);
       APR_ARRAY_PUSH(*histories, struct path_info *) = info;
     }
   svn_pool_destroy(iterpool);

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/node_tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/node_tree.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/node_tree.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/node_tree.c Sun Feb  6 22:19:08 2011
@@ -41,6 +41,7 @@
 #include "svn_repos.h"
 #include "repos.h"
 #include "svn_private_config.h"
+#include "private/svn_fspath.h"
 
 /*** NOTE: This editor is unique in that it currently is hard-coded to
      be anchored at the root directory of the filesystem.  This
@@ -161,7 +162,7 @@ find_real_base_location(const char **pat
       svn_revnum_t rev;
 
       find_real_base_location(&path, &rev, node->parent, pool);
-      *path_p = svn_path_join(path, node->name, pool);
+      *path_p = svn_fspath__join(path, node->name, pool);
       *rev_p = rev;
       return;
     }

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/rev_hunt.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_repos/rev_hunt.c Sun Feb  6 22:19:08 2011
@@ -37,6 +37,7 @@
 #include "svn_props.h"
 #include "svn_mergeinfo.h"
 #include "repos.h"
+#include "private/svn_fspath.h"
 
 
 /* Note:  this binary search assumes that the datestamp properties on
@@ -624,9 +625,9 @@ svn_repos__prev_location(svn_revnum_t *a
   SVN_ERR(svn_fs_copied_from(&copy_src_rev, &copy_src_path,
                              copy_root, copy_path, pool));
   if (! strcmp(copy_path, path) == 0)
-    remainder = svn_path_is_child(copy_path, path, pool);
+    remainder = svn_fspath__is_child(copy_path, path, pool);
   if (prev_path)
-    *prev_path = svn_path_join(copy_src_path, remainder, pool);
+    *prev_path = svn_fspath__join(copy_src_path, remainder, pool);
   if (appeared_rev)
     *appeared_rev = svn_fs_revision_root_revision(copy_root);
   if (prev_rev)

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c Sun Feb  6 22:19:08 2011
@@ -1,5 +1,5 @@
 /*
- * adler32.c :  routines for doing diffs
+ * adler32.c :  routines for handling Adler-32 checksums
  *
  * ====================================================================
  *    Licensed to the Apache Software Foundation (ASF) under one

Propchange: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb  6 22:19:08 2011
@@ -1 +1 @@
-/subversion/trunk/subversion/libsvn_subr/adler32.c:1054278-1064450
+/subversion/trunk/subversion/libsvn_subr/adler32.c:1054278-1067783

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/checksum.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/checksum.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/checksum.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/checksum.c Sun Feb  6 22:19:08 2011
@@ -34,6 +34,8 @@
 #include "sha1.h"
 #include "md5.h"
 
+#include "svn_private_config.h"
+
 
 
 /* Returns the digest size of it's argument. */
@@ -398,3 +400,31 @@ svn_checksum_size(const svn_checksum_t *
 {
   return DIGESTSIZE(checksum->kind);
 }
+
+svn_error_t *
+svn_checksum_mismatch_err(const svn_checksum_t *expected,
+                          const svn_checksum_t *actual,
+                          apr_pool_t *scratch_pool,
+                          const char *fmt,
+                          ...)
+{
+  if (!svn_checksum_match(expected, actual))
+    {
+      va_list ap;
+      const char *desc;
+
+      va_start(ap, fmt);
+      desc = apr_pvsprintf(scratch_pool, fmt, ap);
+      va_end(ap);
+    
+      return svn_error_createf(SVN_ERR_CHECKSUM_MISMATCH, NULL,
+                               _("%s:\n"
+                                 "   expected:  %s\n"
+                                 "     actual:  %s\n"),
+                    desc,               
+                    svn_checksum_to_cstring_display(expected, scratch_pool),
+                    svn_checksum_to_cstring_display(actual, scratch_pool));
+    }
+  else
+    return SVN_NO_ERROR;
+}

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/dirent_uri.c Sun Feb  6 22:19:08 2011
@@ -484,6 +484,12 @@ canonicalize(path_type_t type, const cha
         {
           /* Noop segment, so do nothing. */
         }
+      else if (type == type_uri && seglen == 3
+               && src[0] == '%' && src[1] == '2'
+               && canonicalize_to_upper(src[2]) == 'E')
+        {
+          /* '%2E' is equivalent to '.', so this is a noop segment */
+        }
 #ifdef SVN_USE_DOS_PATHS
       /* If this is the first path segment of a file:// URI and it contains a
          windows drive letter, convert the drive letter to upper case. */
@@ -1401,8 +1407,8 @@ svn_uri_get_longest_ancestor(const char 
   apr_size_t uri_ancestor_len;
   apr_size_t i = 0;
 
-  assert(svn_path_is_canonical(uri1, NULL));
-  assert(svn_path_is_canonical(uri2, NULL));
+  assert(svn_uri_is_canonical(uri1, NULL));
+  assert(svn_uri_is_canonical(uri2, NULL));
 
   /* Find ':' */
   while (1)
@@ -2232,7 +2238,6 @@ svn_dirent_is_under_root(svn_boolean_t *
                          const char *base_path,
                          const char *path,
                          apr_pool_t *pool)
-
 {
   apr_status_t status;
   char *full_path;
@@ -2485,14 +2490,13 @@ const char *
 svn_fspath__dirname(const char *fspath,
                     apr_pool_t *pool)
 {
-  const char *result;
   assert(svn_fspath__is_canonical(fspath));
 
-  result = apr_pstrcat(pool, "/", svn_relpath_dirname(fspath + 1, pool),
+  if (fspath[0] == '/' && fspath[1] == '\0')
+    return apr_pstrdup(pool, fspath);
+  else
+    return apr_pstrcat(pool, "/", svn_relpath_dirname(fspath + 1, pool),
                        (char *)NULL);
-
-  assert(svn_fspath__is_canonical(result));
-  return result;
 }
 
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c Sun Feb  6 22:19:08 2011
@@ -453,8 +453,9 @@ print_error(svn_error_t *err, FILE *stre
   /* Only print the same APR error string once. */
   else if (err->message)
     {
-      svn_error_clear(svn_cmdline_fprintf(stream, err->pool, "%s%s\n",
-                                          prefix, err->message));
+      svn_error_clear(svn_cmdline_fprintf(stream, err->pool,
+                                          "%sE%06d: %s\n",
+                                          prefix, err->apr_err, err->message));
     }
   else
     {
@@ -472,7 +473,8 @@ print_error(svn_error_t *err, FILE *stre
         }
 
       svn_error_clear(svn_cmdline_fprintf(stream, err->pool,
-                                          "%s%s\n", prefix, err_string));
+                                          "%sE%06d: %s\n",
+                                          prefix, err->apr_err, err_string));
     }
 }
 
@@ -503,7 +505,7 @@ svn_handle_error2(svn_error_t *err,
 
   /* ### The rest of this file carefully avoids using svn_pool_*(),
      preferring apr_pool_*() instead.  I can't remember why -- it may
-     be an artifact of r3719, or it may be for some deeper reason --
+     be an artifact of r843793, or it may be for some deeper reason --
      but I'm playing it safe and using apr_pool_*() here too. */
   apr_pool_create(&subpool, err->pool);
   empties = apr_array_make(subpool, 0, sizeof(apr_status_t));
@@ -567,8 +569,9 @@ svn_handle_warning2(FILE *stream, svn_er
 
   svn_error_clear(svn_cmdline_fprintf
                   (stream, err->pool,
-                   _("%swarning: %s\n"),
-                   prefix, svn_err_best_message(err, buf, sizeof(buf))));
+                   _("%swarning: W%06d: %s\n"),
+                   prefix, err->apr_err,
+                   svn_err_best_message(err, buf, sizeof(buf))));
   fflush(stream);
 }
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/io.c Sun Feb  6 22:19:08 2011
@@ -85,29 +85,40 @@
 #define RETRY_INITIAL_SLEEP 1000
 #define RETRY_MAX_SLEEP 128000
 
-#define RETRY_LOOP(err, expr, test)                                        \
+#define RETRY_LOOP(err, expr, retry_test, sleep_test)                      \
   do                                                                       \
     {                                                                      \
       apr_status_t os_err = APR_TO_OS_ERROR(err);                          \
       int sleep_count = RETRY_INITIAL_SLEEP;                               \
       int retries;                                                         \
       for (retries = 0;                                                    \
-           retries < RETRY_MAX_ATTEMPTS && (test);                         \
-           ++retries, os_err = APR_TO_OS_ERROR(err))                       \
+           retries < RETRY_MAX_ATTEMPTS && (retry_test);                   \
+           os_err = APR_TO_OS_ERROR(err))                                  \
         {                                                                  \
-          apr_sleep(sleep_count);                                          \
-          if (sleep_count < RETRY_MAX_SLEEP)                               \
-            sleep_count *= 2;                                              \
+          if (sleep_test)                                                  \
+            {                                                              \
+              ++retries;                                                   \
+              apr_sleep(sleep_count);                                      \
+              if (sleep_count < RETRY_MAX_SLEEP)                           \
+                sleep_count *= 2;                                          \
+            }                                                              \
           (err) = (expr);                                                  \
         }                                                                  \
     }                                                                      \
   while (0)
 
 #if defined(EDEADLK) && APR_HAS_THREADS
-#define EDEADLK_RETRY_LOOP(err, expr)                                      \
-  RETRY_LOOP(err, expr, (os_err == EDEADLK))
+#define FILE_LOCK_RETRY_LOOP(err, expr)                                    \
+  RETRY_LOOP(err,                                                          \
+             expr,                                                         \
+             (APR_STATUS_IS_EINTR(err) || os_err == EDEADLK),              \
+             (!APR_STATUS_IS_EINTR(err)))
 #else
-#define EDEADLK_RETRY_LOOP(err, expr) ((void)0)
+#define FILE_LOCK_RETRY_LOOP(err, expr)                                    \
+  RETRY_LOOP(err,                                                          \
+             expr,                                                         \
+             (APR_STATUS_IS_EINTR(err)),                                   \
+             0)
 #endif
 
 #ifndef WIN32_RETRY_LOOP
@@ -115,7 +126,8 @@
 #define WIN32_RETRY_LOOP(err, expr)                                        \
   RETRY_LOOP(err, expr, (os_err == ERROR_ACCESS_DENIED                     \
                          || os_err == ERROR_SHARING_VIOLATION              \
-                         || os_err == ERROR_DIR_NOT_EMPTY))
+                         || os_err == ERROR_DIR_NOT_EMPTY),                \
+             1)
 #else
 #define WIN32_RETRY_LOOP(err, expr) ((void)0)
 #endif
@@ -1718,7 +1730,7 @@ svn_io_file_lock2(const char *lock_file,
      thread 2: try to get lock in B *** deadlock ***
 
      Retry for a while for the deadlock to clear. */
-  EDEADLK_RETRY_LOOP(apr_err, apr_file_lock(lockfile_handle, locktype));
+  FILE_LOCK_RETRY_LOOP(apr_err, apr_file_lock(lockfile_handle, locktype));
 
   if (apr_err)
     {
@@ -3923,7 +3935,7 @@ svn_io_open_unique_file3(apr_file_t **fi
    * ### This will cause working files having mode 0600 while users might
    * ### expect to see 644 or 664. Ideally, permissions should be tweaked
    * ### by our callers after installing tempfiles in the WC, but until
-   * ### that's done we need to avoid breaking pre-r40264 behaviour.
+   * ### that's done we need to avoid breaking pre-r880338 behaviour.
    * ### So we tweak perms of the tempfile here, but only if the umask
    * ### allows it. */
   SVN_ERR(merge_default_file_perms(tempfile, &perms, scratch_pool));

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/target.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/target.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/target.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/target.c Sun Feb  6 22:19:08 2011
@@ -47,6 +47,8 @@ svn_path_condense_targets(const char **p
   svn_boolean_t *removed;
   apr_array_header_t *abs_targets;
   int basedir_len;
+  const char *first_target;
+  svn_boolean_t first_target_is_url;
 
   /* Early exit when there's no data to work on. */
   if (targets->nelts <= 0)
@@ -58,9 +60,15 @@ svn_path_condense_targets(const char **p
     }
 
   /* Get the absolute path of the first target. */
-  SVN_ERR(svn_path_get_absolute(pcommon,
-                                APR_ARRAY_IDX(targets, 0, const char *),
-                                pool));
+  first_target = APR_ARRAY_IDX(targets, 0, const char *);
+  first_target_is_url = svn_path_is_url(first_target);
+  if (first_target_is_url)
+    {
+      first_target = apr_pstrdup(pool, first_target);
+      *pcommon = first_target;
+    }
+  else
+    SVN_ERR(svn_dirent_get_absolute(pcommon, first_target, pool));
 
   /* Early exit when there's only one path to work on. */
   if (targets->nelts == 1)
@@ -88,9 +96,31 @@ svn_path_condense_targets(const char **p
     {
       const char *rel = APR_ARRAY_IDX(targets, i, const char *);
       const char *absolute;
-      SVN_ERR(svn_path_get_absolute(&absolute, rel, pool));
+      svn_boolean_t is_url = svn_path_is_url(rel);
+
+      if (is_url)
+        absolute = apr_pstrdup(pool, rel); /* ### TODO: avoid pool dup? */
+      else
+        SVN_ERR(svn_dirent_get_absolute(&absolute, rel, pool));
+
       APR_ARRAY_PUSH(abs_targets, const char *) = absolute;
-      *pcommon = svn_path_get_longest_ancestor(*pcommon, absolute, pool);
+
+      /* If we've not already determined that there's no common
+         parent, then continue trying to do so. */
+      if (*pcommon && **pcommon)
+        {
+          /* If the is-url-ness of this target doesn't match that of
+             the first target, our search for a common ancestor can
+             end right here.  Otherwise, use the appropriate
+             get-longest-ancestor function per the path type. */
+          if (is_url != first_target_is_url)
+            *pcommon = "";
+          else if (first_target_is_url)
+            *pcommon = svn_uri_get_longest_ancestor(*pcommon, absolute, pool);
+          else
+            *pcommon = svn_dirent_get_longest_ancestor(*pcommon, absolute,
+                                                       pool);
+        }
     }
 
   if (pcondensed_targets != NULL)
@@ -113,6 +143,7 @@ svn_path_condense_targets(const char **p
                 {
                   const char *abs_targets_i;
                   const char *abs_targets_j;
+                  svn_boolean_t i_is_url, j_is_url;
                   const char *ancestor;
 
                   if (removed[j])
@@ -120,9 +151,20 @@ svn_path_condense_targets(const char **p
 
                   abs_targets_i = APR_ARRAY_IDX(abs_targets, i, const char *);
                   abs_targets_j = APR_ARRAY_IDX(abs_targets, j, const char *);
+                  i_is_url = svn_path_is_url(abs_targets_i);
+                  j_is_url = svn_path_is_url(abs_targets_j);
 
-                  ancestor = svn_path_get_longest_ancestor
-                    (abs_targets_i, abs_targets_j, pool);
+                  if (i_is_url != j_is_url)
+                    continue;
+                  
+                  if (i_is_url)
+                    ancestor = svn_uri_get_longest_ancestor(abs_targets_i,
+                                                            abs_targets_j,
+                                                            pool);
+                  else
+                    ancestor = svn_dirent_get_longest_ancestor(abs_targets_i,
+                                                               abs_targets_j,
+                                                               pool);
 
                   if (*ancestor == '\0')
                     continue;
@@ -237,10 +279,14 @@ svn_path_remove_redundancies(apr_array_h
       const char *rel_path = APR_ARRAY_IDX(targets, i, const char *);
       const char *abs_path;
       int j;
-      svn_boolean_t keep_me;
+      svn_boolean_t is_url, keep_me;
 
       /* Get the absolute path for this target. */
-      SVN_ERR(svn_path_get_absolute(&abs_path, rel_path, temp_pool));
+      is_url = svn_path_is_url(rel_path);
+      if (is_url)
+        abs_path = rel_path;
+      else
+        SVN_ERR(svn_dirent_get_absolute(&abs_path, rel_path, temp_pool));
 
       /* For each keeper in ABS_TARGETS, see if this target is the
          same as or a child of that keeper. */
@@ -248,6 +294,14 @@ svn_path_remove_redundancies(apr_array_h
       for (j = 0; j < abs_targets->nelts; j++)
         {
           const char *keeper = APR_ARRAY_IDX(abs_targets, j, const char *);
+          svn_boolean_t keeper_is_url = svn_path_is_url(keeper);
+          const char *child_relpath;
+
+          /* If KEEPER hasn't the same is-url-ness as ABS_PATH, we
+             know they aren't equal and that one isn't the child of
+             the other. */
+          if (is_url != keeper_is_url)
+            continue;
 
           /* Quit here if we find this path already in the keepers. */
           if (strcmp(keeper, abs_path) == 0)
@@ -257,7 +311,11 @@ svn_path_remove_redundancies(apr_array_h
             }
 
           /* Quit here if this path is a child of one of the keepers. */
-          if (svn_path_is_child(keeper, abs_path, temp_pool))
+          if (is_url)
+            child_relpath = svn_uri_is_child(keeper, abs_path, temp_pool);
+          else
+            child_relpath = svn_dirent_is_child(keeper, abs_path, temp_pool);
+          if (child_relpath)
             {
               keep_me = FALSE;
               break;

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/adm_ops.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/adm_ops.c Sun Feb  6 22:19:08 2011
@@ -129,7 +129,6 @@ process_committed_leaf(svn_wc__db_t *db,
   svn_wc__db_kind_t kind;
   const svn_checksum_t *copied_checksum;
   const char *adm_abspath;
-  const char *tmp_text_base_abspath;
   svn_revnum_t new_changed_rev = new_revnum;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -211,12 +210,8 @@ process_committed_leaf(svn_wc__db_t *db,
          ### value, like how we handle files. */
     }
 
-  /* Set TMP_TEXT_BASE_ABSPATH to NULL.  The new text base will be found in
-     the pristine store by its checksum. */
-  /* ### TODO: Remove this parameter. */
-  tmp_text_base_abspath = NULL;
-
-  SVN_ERR(svn_wc__wq_add_postcommit(db, local_abspath, tmp_text_base_abspath,
+  /* The new text base will be found in the pristine store by its checksum. */
+  SVN_ERR(svn_wc__wq_add_postcommit(db, local_abspath, 
                                     new_revnum,
                                     new_changed_rev, new_changed_date,
                                     new_changed_author, checksum,

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/diff.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/diff.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/diff.c Sun Feb  6 22:19:08 2011
@@ -486,7 +486,7 @@ get_empty_file(struct edit_baton *b,
                const char **empty_file)
 {
   /* Create the file if it does not exist */
-  /* Note that we tried to use /dev/null in r17220, but
+  /* Note that we tried to use /dev/null in r857294, but
      that won't work on Windows: it's impossible to stat NUL */
   if (!b->empty_file)
     {

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/props.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/props.c Sun Feb  6 22:19:08 2011
@@ -1668,6 +1668,106 @@ svn_wc_prop_list2(apr_hash_t **props,
                                                    scratch_pool));
 }
 
+/* Baton for read_dir_props. */
+struct read_dir_props_baton
+{
+  /* Working copy db handle. */
+  svn_wc__db_t *db;
+
+  /* The absolute path to the root of the tree being walked. */
+  const char *root_abspath;
+
+  /* The proplist receiver function and baton. */
+  svn_wc__proplist_receiver_t receiver_func;
+  void *receiver_baton;
+};
+
+/* An implementation of svn_wc__node_found_func_t. */
+static svn_error_t *
+read_dir_props(const char *local_abspath,
+               svn_node_kind_t kind,
+               void *baton,
+               apr_pool_t *scratch_pool)
+{
+  struct read_dir_props_baton *b = (struct read_dir_props_baton *)baton;
+
+  /* We only handle directories. */
+  if (kind != svn_node_dir)
+    return SVN_NO_ERROR;
+
+  /* Special case for root node of the tree. */
+  if (strcmp(local_abspath, b->root_abspath) == 0)
+    {
+      apr_hash_t *props;
+
+      SVN_ERR(svn_wc__db_read_props(&props, b->db, local_abspath,
+                                    scratch_pool, scratch_pool));
+      if (b->receiver_func && props && apr_hash_count(props) > 0)
+        SVN_ERR((*b->receiver_func)(b->receiver_baton, local_abspath,
+                                    props, scratch_pool));
+    }
+
+  /* All nodes within the tree are listed recursively as immediates. */
+  SVN_ERR(svn_wc__db_read_props_of_immediates(b->db, local_abspath,
+                                              b->receiver_func,
+                                              b->receiver_baton,
+                                              scratch_pool));
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__prop_list_recursive(svn_wc_context_t *wc_ctx,
+                            const char *local_abspath,
+                            svn_depth_t depth,
+                            svn_wc__proplist_receiver_t receiver_func,
+                            void *receiver_baton,
+                            svn_cancel_func_t cancel_func,
+                            void *cancel_baton,
+                            apr_pool_t *scratch_pool)
+{
+  struct read_dir_props_baton read_dir_baton;
+
+  if (depth <= svn_depth_immediates)
+    {
+      apr_hash_t *props;
+
+      SVN_ERR(svn_wc__db_read_props(&props, wc_ctx->db, local_abspath,
+                                    scratch_pool, scratch_pool));
+      if (receiver_func && props && apr_hash_count(props) > 0)
+        SVN_ERR((*receiver_func)(receiver_baton, local_abspath, props,
+                                 scratch_pool));
+      if (depth == svn_depth_empty)
+        return SVN_NO_ERROR;
+    }
+
+  if (depth == svn_depth_files)
+    {
+      SVN_ERR(svn_wc__db_read_props_of_files(wc_ctx->db, local_abspath,
+                                             receiver_func, receiver_baton,
+                                             scratch_pool));
+      return SVN_NO_ERROR;
+    }
+
+  if (depth == svn_depth_immediates)
+    {
+      SVN_ERR(svn_wc__db_read_props_of_immediates(wc_ctx->db, local_abspath,
+                                                  receiver_func,
+                                                  receiver_baton,
+                                                  scratch_pool));
+      return SVN_NO_ERROR;
+    }
+
+  read_dir_baton.db = wc_ctx->db;
+  read_dir_baton.root_abspath = local_abspath;
+  read_dir_baton.receiver_func = receiver_func;
+  read_dir_baton.receiver_baton = receiver_baton;
+
+  SVN_ERR(svn_wc__internal_walk_children(wc_ctx->db, local_abspath, FALSE,
+                                         read_dir_props, &read_dir_baton,
+                                         depth, cancel_func, cancel_baton,
+                                         scratch_pool));
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
 svn_wc__get_pristine_props(apr_hash_t **props,

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/update_editor.c?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/update_editor.c Sun Feb  6 22:19:08 2011
@@ -1314,11 +1314,12 @@ modcheck_found_node(const char *local_ab
 
   if (status != svn_wc__db_status_normal)
     modified = TRUE;
-  /* No need to check if we already have at least one non-delete
-     modification */
-  else if (!baton->found_mod || baton->all_edits_are_deletes)
+  /* No need to check if we already have at least one modification */
+  else if (!baton->found_mod)
     SVN_ERR(entry_has_local_mods(&modified, baton->db, local_abspath,
                                  db_kind, scratch_pool));
+  else
+    modified = FALSE;
 
   if (modified)
     {
@@ -2240,15 +2241,14 @@ add_directory(const char *path,
 
       svn_boolean_t local_is_dir;
       svn_boolean_t local_is_non_dir;
-      const char *local_is_copy = NULL;
+      svn_wc__db_status_t add_status = svn_wc__db_status_normal;
 
       /* Is the local add a copy? */
       if (status == svn_wc__db_status_added)
-        SVN_ERR(svn_wc__node_get_copyfrom_info(&local_is_copy,
-                                               NULL, NULL, NULL, NULL,
-                                               eb->wc_ctx,
-                                               db->local_abspath,
-                                               pool, pool));
+        SVN_ERR(svn_wc__db_scan_addition(&add_status, NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL, NULL,
+                                         eb->db, db->local_abspath,
+                                         pool, pool));
 
 
       /* Is there something that is a file? */
@@ -2337,7 +2337,8 @@ add_directory(const char *path,
       if (! pb->in_deleted_and_tree_conflicted_subtree
           && (eb->switch_relpath != NULL
               || local_is_non_dir
-              || local_is_copy
+              || add_status == svn_wc__db_status_copied
+              || add_status == svn_wc__db_status_moved_here
              )
          )
         {

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-queries.sql?rev=1067787&r1=1067786&r2=1067787&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/wc-queries.sql Sun Feb  6 22:19:08 2011
@@ -158,10 +158,19 @@ SELECT properties, presence FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2
 ORDER BY op_depth DESC;
 
+-- STMT_SELECT_NODE_PROPS_OF_CHILDREN
+SELECT properties, presence, local_relpath, kind FROM nodes
+WHERE wc_id = ?1 AND parent_relpath = ?2
+ORDER BY local_relpath, op_depth DESC;
+
 -- STMT_SELECT_ACTUAL_PROPS
 SELECT properties FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2;
 
+-- STMT_SELECT_ACTUAL_PROPS_OF_CHILDREN
+SELECT properties, local_relpath FROM actual_node
+WHERE wc_id = ?1 AND parent_relpath = ?2;
+
 -- STMT_UPDATE_NODE_BASE_PROPS
 UPDATE nodes SET properties = ?3
 WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0;



Mime
View raw message