You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/11/23 02:12:45 UTC

svn commit: r1412731 [3/10] - in /subversion/branches/ev2-export: ./ build/ build/ac-macros/ contrib/client-side/svnmerge/ contrib/server-side/svncutter/ notes/ subversion/ subversion/bindings/javahl/native/ subversion/bindings/swig/perl/native/ subver...

Modified: subversion/branches/ev2-export/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/svn_wc.h?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/svn_wc.h (original)
+++ subversion/branches/ev2-export/subversion/include/svn_wc.h Fri Nov 23 01:12:18 2012
@@ -795,7 +795,8 @@ typedef struct svn_wc_external_item2_t
       field will often be redundant.) */
   const char *target_dir;
 
-  /** Where to check out from. */
+  /** Where to check out from. This is possibly a relative external URL, as
+   * allowed in externals definitions, but without the peg revision. */
   const char *url;
 
   /** What revision to check out.  The only valid kinds for this are
@@ -899,8 +900,8 @@ svn_wc_external_item_dup(const svn_wc_ex
  * of those objects.  If the @a url member refers to an absolute URL,
  * it will be canonicalized as URL consistent with the way URLs are
  * canonicalized throughout the Subversion API.  If, however, the
- * @a url member makes use of the recognized (and proprietary)
- * relative URL syntax, "canonicalization" is a less easily-defined
+ * @a url member makes use of the recognized (SVN-specific) relative
+ * URL syntax for svn:externals, "canonicalization" is an ill-defined
  * concept which may even result in munging the relative URL syntax
  * beyond recognition.  You've been warned.
  *
@@ -4774,7 +4775,8 @@ svn_wc_add_repos_file(const char *dst_pa
 
 
 /** Remove @a local_abspath from revision control.  @a wc_ctx must
- * hold a write lock.
+ * hold a write lock on the parent of @a local_abspath, or if that is a
+ * WC root then on @a local_abspath itself.
  *
  * If @a local_abspath is a file, all its info will be removed from the
  * administrative area.  If @a local_abspath is a directory, then the

Modified: subversion/branches/ev2-export/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/add.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/add.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/add.c Fri Nov 23 01:12:18 2012
@@ -201,16 +201,19 @@ svn_client__get_paths_auto_props(apr_has
   *properties = apr_hash_make(result_pool);
   *mimetype = NULL;
 
-  for (hi = apr_hash_first(scratch_pool, autoprops);
-       hi != NULL;
-       hi = apr_hash_next(hi))
-    {
-      const char *pattern = svn__apr_hash_index_key(hi);
-      apr_hash_t *propvals = svn__apr_hash_index_val(hi);
-
-      get_auto_props_for_pattern(*properties, mimetype, &have_executable,
-                                 svn_dirent_basename(path, scratch_pool),
-                                 pattern, propvals, scratch_pool);
+  if (autoprops)
+    {
+      for (hi = apr_hash_first(scratch_pool, autoprops);
+           hi != NULL;
+           hi = apr_hash_next(hi))
+        {
+          const char *pattern = svn__apr_hash_index_key(hi);
+          apr_hash_t *propvals = svn__apr_hash_index_val(hi);
+
+          get_auto_props_for_pattern(*properties, mimetype, &have_executable,
+                                     svn_dirent_basename(path, scratch_pool),
+                                     pattern, propvals, scratch_pool);
+        }
     }
 
   /* if mimetype has not been set check the file */
@@ -267,10 +270,11 @@ static svn_error_t *
 add_file(const char *local_abspath,
          svn_magic__cookie_t *magic_cookie,
          apr_hash_t *autoprops,
+         svn_boolean_t no_autoprops,
          svn_client_ctx_t *ctx,
          apr_pool_t *pool)
 {
-  apr_hash_t* properties;
+  apr_hash_t* properties = NULL;
   apr_hash_index_t *hi;
   const char *mimetype;
   svn_node_kind_t kind;
@@ -289,18 +293,21 @@ add_file(const char *local_abspath,
     }
   else
     {
-      apr_hash_t *file_autoprops;
+      apr_hash_t *file_autoprops = NULL;
 
       /* Get automatic properties */
-      /* Grab the inherited svn:inheritable-auto-props and config file
-         auto-props for this file if we haven't already got them
+      /* If we are setting autoprops grab the inherited svn:auto-props and
+         config file auto-props for this file if we haven't already got them
          when iterating over the file's unversioned parents. */
-      if (autoprops == NULL)
-        SVN_ERR(svn_client__get_all_auto_props(
-          &file_autoprops, svn_dirent_dirname(local_abspath,pool),
-          ctx, pool, pool));
-      else
-        file_autoprops = autoprops;
+      if (!no_autoprops)
+        {
+          if (autoprops == NULL)
+            SVN_ERR(svn_client__get_all_auto_props(
+              &file_autoprops, svn_dirent_dirname(local_abspath,pool),
+              ctx, pool, pool));
+          else
+            file_autoprops = autoprops;
+        }
 
       /* This may fail on write-only files:
          we open them to estimate file type.
@@ -341,14 +348,15 @@ add_file(const char *local_abspath,
             {
               /* Don't leave the job half-done. If we fail to set a property,
                * (try to) un-add the file. */
-              svn_error_clear(svn_wc_revert4(ctx->wc_ctx,
+              return svn_error_compose_create(
+                              err,
+                              svn_wc_revert4(ctx->wc_ctx,
                                              local_abspath,
                                              svn_depth_empty,
                                              FALSE /* use_commit_times */,
                                              NULL /* changelists */,
                                              NULL, NULL, NULL, NULL,
                                              pool));
-              return svn_error_trace(err);
             }
         }
     }
@@ -380,12 +388,12 @@ add_file(const char *local_abspath,
  * if necessary.
  *
  * If not NULL, *CONFIG_AUTOPROPS is a hash representing the config file and
- * svn:inheritable-auto-props autoprops which apply to DIR_ABSPATH.  It maps
+ * svn:auto-props autoprops which apply to DIR_ABSPATH.  It maps
  * const char * file patterns to another hash which maps const char *
  * property names to const char *property values.  If *CONFIG_AUTOPROPS is
  * NULL and DIR_ABSPATH is unversioned, then this function will populate
  * *CONFIG_AUTOPROPS (allocated in RESULT_POOL) using DIR_ABSPATH's nearest
- * versioned parent to determine the svn:inheritable-auto-props which DIR_ABSPATH
+ * versioned parent to determine the svn:auto-props which DIR_ABSPATH
  * will inherit once added.
  *
  * If IGNORES is not NULL, then it is an array of const char * ignore patterns
@@ -406,6 +414,7 @@ add_dir_recursive(const char *dir_abspat
                   svn_depth_t depth,
                   svn_boolean_t force,
                   svn_boolean_t no_ignore,
+                  svn_boolean_t no_autoprops,
                   svn_magic__cookie_t *magic_cookie,
                   apr_hash_t **config_autoprops,
                   svn_boolean_t refresh_ignores,
@@ -452,9 +461,9 @@ add_dir_recursive(const char *dir_abspat
   /* For the root of any unversioned subtree, get some or all of the
      following:
 
-       1) Explicit and inherited svn:inheritable-auto-props properties on
+       1) Explicit and inherited svn:auto-props properties on
           DIR_ABSPATH
-       2) Explicit and inherited svn:inheritabled-ignores properties on
+       2) Explicit and inherited svn:global-ignores properties on
           DIR_ABSPATH
        3) auto-props from the CTX->CONFIG hash */
   if (!entry_exists && *config_autoprops == NULL)
@@ -509,15 +518,16 @@ add_dir_recursive(const char *dir_abspat
             refresh_ignores = FALSE;
 
           SVN_ERR(add_dir_recursive(abspath, depth_below_here,
-                                    force, no_ignore, magic_cookie,
-                                    config_autoprops, refresh_ignores,
-                                    ignores, ctx, iterpool, iterpool));
+                                    force, no_ignore, no_autoprops,
+                                    magic_cookie, config_autoprops,
+                                    refresh_ignores, ignores, ctx,
+                                    iterpool, iterpool));
         }
       else if ((dirent->kind == svn_node_file || dirent->special)
                && depth >= svn_depth_files)
         {
-          err = add_file(abspath, magic_cookie, *config_autoprops, ctx,
-                         iterpool);
+          err = add_file(abspath, magic_cookie, *config_autoprops,
+                         no_autoprops, ctx, iterpool);
           if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)
             svn_error_clear(err);
           else
@@ -537,7 +547,7 @@ add_dir_recursive(const char *dir_abspat
 }
 
 /* This structure is used as baton for collecting the config entries
-   in the auto-props section and any inherited svn:inheritable-auto-props
+   in the auto-props section and any inherited svn:auto-props
    properties.
 */
 typedef struct collect_auto_props_baton_t
@@ -692,6 +702,7 @@ svn_client__get_all_auto_props(apr_hash_
   svn_boolean_t use_autoprops;
   collect_auto_props_baton_t autoprops_baton;
   svn_error_t *err = NULL;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_boolean_t target_is_url = svn_path_is_url(path_or_url);
   svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
                                                  SVN_CONFIG_CATEGORY_CONFIG,
@@ -699,10 +710,11 @@ svn_client__get_all_auto_props(apr_hash_
   *autoprops = apr_hash_make(result_pool);
   autoprops_baton.result_pool = result_pool;
   autoprops_baton.autoprops = *autoprops;
+  
 
   /* Are "traditional" auto-props enabled?  If so grab them from the
     config.  This is our starting set auto-props, which may be overriden
-    by svn:inheritable-auto-props. */
+    by svn:auto-props. */
   SVN_ERR(svn_config_get_bool(cfg, &use_autoprops,
                               SVN_CONFIG_SECTION_MISCELLANY,
                               SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS, FALSE));
@@ -720,12 +732,12 @@ svn_client__get_all_auto_props(apr_hash_
 
   /* If PATH_OR_URL is a WC path, then it might be unversioned, in which case
      we find it's nearest versioned parent. */
-  while (err == NULL)
+  do
     {
       err = svn_client_propget5(&props, &inherited_config_auto_props,
                                 SVN_PROP_INHERITABLE_AUTO_PROPS, path_or_url,
                                 &rev, &rev, NULL, svn_depth_empty, NULL, ctx,
-                                scratch_pool, scratch_pool);
+                                scratch_pool, iterpool);
       if (err)
         {
           if (target_is_url || err->apr_err != SVN_ERR_UNVERSIONED_RESOURCE)
@@ -734,13 +746,14 @@ svn_client__get_all_auto_props(apr_hash_
           svn_error_clear(err);
           err = NULL;
           SVN_ERR(find_existing_parent(&path_or_url, ctx, path_or_url,
-                                       scratch_pool, scratch_pool));
+                                       scratch_pool, iterpool));
         }
       else
         {
           break;
         }
     }
+  while (err == NULL);
 
   /* Stash any explicit PROPS for PARENT_PATH into the inherited props array,
      since these are actually inherited props for LOCAL_ABSPATH. */
@@ -765,7 +778,6 @@ svn_client__get_all_auto_props(apr_hash_
       apr_hash_index_t *hi;
       svn_prop_inherited_item_t *elt = APR_ARRAY_IDX(
         inherited_config_auto_props, i, svn_prop_inherited_item_t *);
-      apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
       for (hi = apr_hash_first(scratch_pool, elt->prop_hash);
            hi;
@@ -781,7 +793,7 @@ svn_client__get_all_auto_props(apr_hash_
           config_auto_prop_pattern = svn_stringbuf_create_empty(iterpool);
           config_auto_prop_val = svn_stringbuf_create_empty(iterpool);
 
-          /* Parse svn:inheritable-auto-props value. */
+          /* Parse svn:auto-props value. */
           while (*ch != '\0')
             {
               svn_stringbuf_setempty(config_auto_prop_pattern);
@@ -819,9 +831,11 @@ svn_client__get_all_auto_props(apr_hash_
               if (*ch == '\n')
                 ch++;
             }
-          svn_pool_destroy(iterpool);
         }
     }
+
+  svn_pool_destroy(iterpool);
+
   return SVN_NO_ERROR;
 }
 
@@ -963,7 +977,7 @@ svn_error_t *svn_client__get_all_ignores
   return SVN_NO_ERROR;
 }
 
-/* The main logic of the public svn_client_add4.
+/* The main logic of the public svn_client_add5.
  *
  * EXISTING_PARENT_ABSPATH is the absolute path to the first existing
  * parent directory of local_abspath. If not NULL, all missing parents
@@ -973,6 +987,7 @@ add(const char *local_abspath,
     svn_depth_t depth,
     svn_boolean_t force,
     svn_boolean_t no_ignore,
+    svn_boolean_t no_autoprops,
     const char *existing_parent_abspath,
     svn_client_ctx_t *ctx,
     apr_pool_t *scratch_pool)
@@ -1032,12 +1047,12 @@ add(const char *local_abspath,
          and pass depth along no matter what it is, so that the
          target's depth will be set correctly. */
       err = add_dir_recursive(local_abspath, depth, force, no_ignore,
-                              magic_cookie, &config_autoprops, TRUE, ignores,
-                              ctx, scratch_pool, scratch_pool);
+                              no_autoprops, magic_cookie, &config_autoprops,
+                              TRUE, ignores, ctx, scratch_pool, scratch_pool);
     }
   else if (kind == svn_node_file)
-    err = add_file(local_abspath, magic_cookie, config_autoprops, ctx,
-                   scratch_pool);
+    err = add_file(local_abspath, magic_cookie, config_autoprops,
+                   no_autoprops, ctx, scratch_pool);
   else if (kind == svn_node_none)
     {
       svn_boolean_t tree_conflicted;
@@ -1080,13 +1095,14 @@ add(const char *local_abspath,
 
 
 svn_error_t *
-svn_client_add4(const char *path,
+svn_client_add5(const char *path,
                 svn_depth_t depth,
                 svn_boolean_t force,
                 svn_boolean_t no_ignore,
+                svn_boolean_t no_autoprops,
                 svn_boolean_t add_parents,
                 svn_client_ctx_t *ctx,
-                apr_pool_t *pool)
+                apr_pool_t *scratch_pool)
 {
   const char *parent_abspath;
   const char *local_abspath;
@@ -1098,14 +1114,14 @@ svn_client_add4(const char *path,
     return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
                              _("'%s' is not a local path"), path);
 
-  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
 
   /* See if we're being asked to add a wc-root.  That's typically not
      okay, unless we're in "force" mode.  svn_wc__strictly_is_wc_root()
      will return TRUE even if LOCAL_ABSPATH is a *symlink* to a working
      copy root, which is a scenario we want to treat differently.  */
   err = svn_wc__strictly_is_wc_root(&is_wc_root, ctx->wc_ctx,
-                                    local_abspath, pool);
+                                    local_abspath, scratch_pool);
   if (err)
     {
       if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
@@ -1125,7 +1141,7 @@ svn_client_add4(const char *path,
       svn_boolean_t is_special;
 
       SVN_ERR(svn_io_check_special_path(local_abspath, &disk_kind, &is_special,
-                                        pool));
+                                        scratch_pool));
 
       /* A symlink can be an unversioned target and a wcroot. Lets try to add
          the symlink, which can't be a wcroot. */
@@ -1138,14 +1154,15 @@ svn_client_add4(const char *path,
             return svn_error_createf(
                                  SVN_ERR_ENTRY_EXISTS, NULL,
                                  _("'%s' is already under version control"),
-                                 svn_dirent_local_style(local_abspath, pool));
+                                 svn_dirent_local_style(local_abspath,
+                                                        scratch_pool));
         }
     }
 
   if (is_wc_root)
     parent_abspath = local_abspath; /* We will only add children */
   else
-    parent_abspath = svn_dirent_dirname(local_abspath, pool);
+    parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
   existing_parent_abspath = NULL;
   if (add_parents && !is_wc_root)
@@ -1153,20 +1170,20 @@ svn_client_add4(const char *path,
       apr_pool_t *subpool;
       const char *existing_parent_abspath2;
 
-      subpool = svn_pool_create(pool);
+      subpool = svn_pool_create(scratch_pool);
       SVN_ERR(find_existing_parent(&existing_parent_abspath2, ctx,
-                                   parent_abspath, pool, subpool));
+                                   parent_abspath, scratch_pool, subpool));
       if (strcmp(existing_parent_abspath2, parent_abspath) != 0)
         existing_parent_abspath = existing_parent_abspath2;
       svn_pool_destroy(subpool);
     }
 
   SVN_WC__CALL_WITH_WRITE_LOCK(
-    add(local_abspath, depth, force, no_ignore, existing_parent_abspath,
-        ctx, pool),
+    add(local_abspath, depth, force, no_ignore, no_autoprops,
+        existing_parent_abspath, ctx, scratch_pool),
     ctx->wc_ctx, (existing_parent_abspath ? existing_parent_abspath 
                                           : parent_abspath),
-    FALSE /* lock_anchor */, pool);
+    FALSE /* lock_anchor */, scratch_pool);
   return SVN_NO_ERROR;
 }
 
@@ -1443,7 +1460,7 @@ svn_client__make_local_parents(const cha
      itself is added, since it not only constraints the operation depth, but
      also defines the depth of the target directory now. Moreover, the new
      directory will have no children at all.*/
-  err = svn_client_add4(path, svn_depth_infinity, FALSE, FALSE,
+  err = svn_client_add5(path, svn_depth_infinity, FALSE, FALSE, FALSE,
                         make_parents, ctx, pool);
 
   /* If we created a new directory, but couldn't add it to version

Modified: subversion/branches/ev2-export/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/client.h?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/client.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/client.h Fri Nov 23 01:12:18 2012
@@ -326,17 +326,18 @@ svn_client__ra_make_cb_baton(svn_wc_cont
 
 /*** Add/delete ***/
 
-/* Read automatic properties matching PATH from AUTOPROPS.  AUTOPROPS
-   is is a hash as per svn_client__get_all_auto_props.
-
-   Set *PROPERTIES to a hash containing propname/value pairs
-   (const char * keys mapping to svn_string_t * values).  *PROPERTIES
-   may be an empty hash, but will not be NULL.
-
-   Set *MIMETYPE to the mimetype, if any, or to NULL.
-
-   If MAGIC_COOKIE is not NULL and no mime-type can be determined
-   via CTX->config try to detect the mime-type with libmagic.
+/* If AUTOPROPS is not null: Then read automatic properties matching PATH
+   from AUTOPROPS.  AUTOPROPS is is a hash as per
+   svn_client__get_all_auto_props.  Set *PROPERTIES to a hash containing
+   propname/value pairs (const char * keys mapping to svn_string_t * values).
+
+   If AUTOPROPS is null then set *PROPERTIES to an empty hash.
+
+   If *MIMETYPE is null or "application/octet-stream" then check AUTOPROPS
+   for a matching svn:mime-type.  If AUTOPROPS is null or no match is found
+   and MAGIC_COOKIE is not NULL, then then try to detect the mime-type with
+   libmagic.  If a mimetype is found then add it to *PROPERTIES and set
+   *MIMETYPE to the mimetype value or NULL otherwise.
 
    Allocate the *PROPERTIES and its contents as well as *MIMETYPE, in
    RESULT_POOL.  Use SCRATCH_POOL for temporary allocations. */
@@ -351,11 +352,11 @@ svn_error_t *svn_client__get_paths_auto_
   apr_pool_t *scratch_pool);
 
 /* Gather all auto-props from CTX->config (or none if auto-props are
-   disabled) and all svn:inheritable-auto-props explicitly set on or inherited
+   disabled) and all svn:auto-props explicitly set on or inherited
    by PATH_OR_URL.
 
    If PATH_OR_URL is an unversioned WC path then gather the
-   svn:inheritable-auto-props inherited by PATH_OR_URL's nearest versioned
+   svn:auto-props inherited by PATH_OR_URL's nearest versioned
    parent.
 
    If PATH_OR_URL is a URL ask for the properties @HEAD, if it is a WC
@@ -366,10 +367,10 @@ svn_error_t *svn_client__get_paths_auto_
    names to const char *property values.
 
    If a given property name exists for the same pattern in both the config
-   file and in an a svn:inheritable-auto-props property, the latter overrides the
+   file and in an a svn:auto-props property, the latter overrides the
    former.  If a given property name exists for the same pattern in two
-   different inherited svn:inheritable-auto-props, then the closer path-wise
-   property overrides the more distant. svn:inheritable-auto-props explicitly set
+   different inherited svn:auto-props, then the closer path-wise
+   property overrides the more distant. svn:auto-props explicitly set
    on PATH_OR_URL have the highest precedence and override inherited props
    and config file settings.
 
@@ -383,7 +384,7 @@ svn_error_t *svn_client__get_all_auto_pr
 
 /* Get a combined list of ignore patterns from CTX->CONFIG, local ignore
    patterns on LOCAL_ABSPATH (per the svn:ignore property), and from any
-   svn:inheritable-ignores properties set on, or inherited by, LOCAL_ABSPATH.
+   svn:global-ignores properties set on, or inherited by, LOCAL_ABSPATH.
    If LOCAL_ABSPATH is unversioned but is located within a valid working copy,
    then find its nearest versioned parent path, if any, and return the ignore
    patterns for that parent.  Return an SVN_ERR_WC_NOT_WORKING_COPY error if
@@ -398,7 +399,7 @@ svn_error_t *svn_client__get_all_ignores
                                          apr_pool_t *result_pool,
                                          apr_pool_t *scratch_pool);
 
-/* Get a list of ignore patterns defined by the svn:inheritable-ignores
+/* Get a list of ignore patterns defined by the svn:global-ignores
    properties set on, or inherited by, PATH_OR_URL.  Store the collected
    patterns as const char * elements in the array *IGNORES.  Allocate
    *IGNORES and its contents in RESULT_POOL.  Use  SCRATCH_POOL for
@@ -628,17 +629,16 @@ svn_client__get_inheritable_props(apr_ha
 /* Create an editor for a pure repository comparison, i.e. comparing one
    repository version against the other.
 
-   DIFF_CMD/DIFF_CMD_BATON represent the callback and callback argument that
-   implement the file comparison function
+   DIFF_CALLBACKS/DIFF_CMD_BATON represent the callback that implements
+   the comparison.
 
    DEPTH is the depth to recurse.
 
    RA_SESSION is an RA session through which this editor may fetch
    properties, file contents and directory listings of the 'old' side of the
    diff. It is a separate RA session from the one through which this editor
-   is being driven.
-
-   REVISION is the start revision in the comparison.
+   is being driven. REVISION is the revision number of the 'old' side of
+   the diff.
 
    For each deleted directory, if WALK_DELETED_DIRS is true then just call
    the 'dir_deleted' callback once, otherwise call the 'file_deleted' or
@@ -901,6 +901,17 @@ svn_client__condense_commit_items(const 
                                   apr_pool_t *pool);
 
 
+/* Like svn_ra_stat() on the ra session root, but with a compatibility
+   hack for pre-1.2 svnserve that don't support this api. */
+svn_error_t *
+svn_client__ra_stat_compatible(svn_ra_session_t *ra_session,
+                               svn_revnum_t rev,
+                               svn_dirent_t **dirent_p,
+                               apr_uint32_t dirent_fields,
+                               svn_client_ctx_t *ctx,
+                               apr_pool_t *result_pool);
+
+
 /* Commit the items in the COMMIT_ITEMS array using EDITOR/EDIT_BATON
    to describe the committed local mods.  Prior to this call,
    COMMIT_ITEMS should have been run through (and BASE_URL generated

Modified: subversion/branches/ev2-export/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/commit.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/commit.c Fri Nov 23 01:12:18 2012
@@ -78,10 +78,11 @@ typedef struct import_ctx_t
   svn_magic__cookie_t *magic_cookie;
 
   /* Collection of all possible configuration file dictated auto-props and
-     svn:inheritable-auto-props.  A hash mapping const char * file patterns to a
+     svn:auto-props.  A hash mapping const char * file patterns to a
      second hash which maps const char * property names to const char *
-     property values.  Properties which don't have a value, e.g. svn:executable,
-     simply map the property name to an empty string. */
+     property values.  Properties which don't have a value, e.g.
+     svn:executable, simply map the property name to an empty string.
+     May be NULL if autoprops are disabled. */
   apr_hash_t *autoprops;
 } import_ctx_t;
 
@@ -163,7 +164,7 @@ import_file(svn_editor_t *editor,
 
 /* Return in CHILDREN a mapping of basenames to dirents for the importable
  * children of DIR_ABSPATH.  EXCLUDES is a hash of absolute paths to filter
- * out.  IGNORES and MANDATORY_IGNORES, if non-NULL, are lists of basename
+ * out.  IGNORES and GLOBAL_IGNORES, if non-NULL, are lists of basename
  * patterns to filter out.
  * FILTER_CALLBACK and FILTER_BATON will be called for each absolute path,
  * allowing users to further filter the list of returned entries.
@@ -174,7 +175,7 @@ get_filtered_children(apr_hash_t **child
                       const char *dir_abspath,
                       apr_hash_t *excludes,
                       apr_array_header_t *ignores,
-                      apr_array_header_t *mandatory_ignores,
+                      apr_array_header_t *global_ignores,
                       svn_client_import_filter_func_t filter_callback,
                       void *filter_baton,
                       svn_client_ctx_t *ctx,
@@ -235,7 +236,8 @@ get_filtered_children(apr_hash_t **child
           continue;
         }
 
-      if (svn_wc_match_ignore_list(base_name, mandatory_ignores, iterpool))
+      if (global_ignores &&
+          svn_wc_match_ignore_list(base_name, global_ignores, iterpool))
         {
           apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
           continue;
@@ -267,8 +269,9 @@ import_dir(svn_editor_t *editor,
            const char *relpath,
            svn_depth_t depth,
            apr_hash_t *excludes,
-           apr_array_header_t *mandatory_ignores,
+           apr_array_header_t *global_ignores,
            svn_boolean_t no_ignore,
+           svn_boolean_t no_autoprops,
            svn_boolean_t ignore_unknown_node_types,
            svn_client_import_filter_func_t filter_callback,
            void *filter_baton,
@@ -286,8 +289,9 @@ import_children(const char *dir_abspath,
                 svn_editor_t *editor,
                 svn_depth_t depth,
                 apr_hash_t *excludes,
-                apr_array_header_t *mandatory_ignores,
+                apr_array_header_t *global_ignores,
                 svn_boolean_t no_ignore,
+                svn_boolean_t no_autoprops,
                 svn_boolean_t ignore_unknown_node_types,
                 svn_client_import_filter_func_t filter_callback,
                 void *filter_baton,
@@ -329,8 +333,9 @@ import_children(const char *dir_abspath,
             depth_below_here = svn_depth_empty;
 
           SVN_ERR(import_dir(editor, local_abspath, relpath,
-                             depth_below_here, excludes, mandatory_ignores,
-                             no_ignore, ignore_unknown_node_types,
+                             depth_below_here, excludes, global_ignores,
+                             no_ignore, no_autoprops,
+                             ignore_unknown_node_types,
                              filter_callback, filter_baton,
                              import_ctx, ctx, iterpool));
         }
@@ -382,7 +387,7 @@ import_children(const char *dir_abspath,
  * EXCLUDES is a hash whose keys are absolute paths to exclude from
  * the import (values are unused).
  *
- * MANDATORY_IGNORES is an array of const char * ignore patterns.  Any child
+ * GLOBAL_IGNORES is an array of const char * ignore patterns.  Any child
  * of LOCAL_ABSPATH which matches one or more of the patterns is not imported.
  *
  * If NO_IGNORE is FALSE, don't import files or directories that match
@@ -401,8 +406,9 @@ import_dir(svn_editor_t *editor,
            const char *relpath,
            svn_depth_t depth,
            apr_hash_t *excludes,
-           apr_array_header_t *mandatory_ignores,
+           apr_array_header_t *global_ignores,
            svn_boolean_t no_ignore,
+           svn_boolean_t no_autoprops,
            svn_boolean_t ignore_unknown_node_types,
            svn_client_import_filter_func_t filter_callback,
            void *filter_baton,
@@ -411,17 +417,12 @@ import_dir(svn_editor_t *editor,
            apr_pool_t *pool)
 {
   apr_hash_t *dirents;
-  apr_array_header_t *ignores = NULL;
   apr_array_header_t *children;
   apr_hash_t *props = apr_hash_make(pool);
 
   SVN_ERR(svn_path_check_valid(local_abspath, pool));
-
-  if (!no_ignore)
-    SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
-
-  SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, ignores,
-                                mandatory_ignores, filter_callback,
+  SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, NULL,
+                                global_ignores, filter_callback,
                                 filter_baton, ctx, pool, pool));
 
   /* Import this directory, but not yet its children. */
@@ -450,7 +451,7 @@ import_dir(svn_editor_t *editor,
 
   /* Now import the children recursively. */
   SVN_ERR(import_children(local_abspath, relpath, dirents, editor, depth,
-                          excludes, mandatory_ignores, no_ignore,
+                          excludes, global_ignores, no_ignore, no_autoprops,
                           ignore_unknown_node_types,
                           filter_callback, filter_baton,
                           import_ctx, ctx, pool));
@@ -482,7 +483,7 @@ import_dir(svn_editor_t *editor,
  * the import (values are unused).
  *
  * AUTOPROPS is hash of all config file autoprops and
- * svn:inheritable-auto-props inherited by the import target, see the
+ * svn:auto-props inherited by the import target, see the
  * IMPORT_CTX member of the same name.
  *
  * LOCAL_IGNORES is an array of const char * ignore patterns which
@@ -490,8 +491,8 @@ import_dir(svn_editor_t *editor,
  * repository target and thus dictates which immediate children of that
  * target should be ignored and not imported.
  *
- * MANDATORY_IGNORES is an array of const char * ignore patterns which
- * correspond to the svn:inheritable-ignores properties (if any) set on
+ * GLOBAL_IGNORES is an array of const char * ignore patterns which
+ * correspond to the svn:global-ignores properties (if any) set on
  * the root of the repository target or inherited by it.
  *
  * If NO_IGNORE is FALSE, don't import files or directories that match
@@ -515,15 +516,15 @@ import(const char *local_abspath,
        apr_hash_t *excludes,
        apr_hash_t *autoprops,
        apr_array_header_t *local_ignores,
-       apr_array_header_t *mandatory_ignores,
+       apr_array_header_t *global_ignores,
        svn_boolean_t no_ignore,
+       svn_boolean_t no_autoprops,
        svn_boolean_t ignore_unknown_node_types,
        svn_client_import_filter_func_t filter_callback,
        void *filter_baton,
        svn_client_ctx_t *ctx,
        apr_pool_t *pool)
 {
-  apr_array_header_t *ignores = NULL;
   const char *relpath = "";
   import_ctx_t *import_ctx = apr_pcalloc(pool, sizeof(*import_ctx));
   const svn_io_dirent2_t *dirent;
@@ -535,9 +536,6 @@ import(const char *local_abspath,
   /* Import a file or a directory tree. */
   SVN_ERR(svn_io_stat_dirent(&dirent, local_abspath, FALSE, pool, pool));
 
-  if (!no_ignore)
-      SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
-
   /* Make the intermediate directory components necessary for properly
      rooting our import source tree.  */
   if (new_entries->nelts)
@@ -545,10 +543,15 @@ import(const char *local_abspath,
       int i;
       apr_hash_t *dirents;
 
+      /* If we are creating a new repository directory path to import to,
+         then we disregard any svn:ignore property. */
+      if (!no_ignore && new_entries->nelts)
+        local_ignores = NULL;
+
       if (dirent->kind == svn_node_dir)
         {
           SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes,
-                                        ignores, mandatory_ignores,
+                                        local_ignores, global_ignores,
                                         filter_callback, filter_baton,
                                         ctx, pool, pool));
         }
@@ -604,12 +607,10 @@ import(const char *local_abspath,
       svn_boolean_t ignores_match = FALSE;
 
       if (!no_ignore)
-        {
-          SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
-          ignores_match =
-            (svn_wc_match_ignore_list(local_abspath, ignores, pool)
-             || svn_wc_match_ignore_list(local_abspath, local_ignores, pool));
-        }
+        ignores_match =
+          (svn_wc_match_ignore_list(local_abspath, global_ignores, pool)
+           || svn_wc_match_ignore_list(local_abspath, local_ignores, pool));
+
       if (!ignores_match)
         SVN_ERR(import_file(editor, local_abspath, relpath,
                             dirent, import_ctx, ctx, pool));
@@ -618,36 +619,19 @@ import(const char *local_abspath,
     {
       apr_hash_t *dirents;
 
-      if (!no_ignore)
-        {
-          int i;
-
-          SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
-
-          /* If we are not creating new repository paths, then we are creating
-             importing new paths to an existing directory.  If that directory
-             has the svn:ignore property set on it, then we want to ignore
-             immediate children that match the pattern(s) defined by that
-             property. */
-          if (!new_entries->nelts)
-            {
-              for (i = 0; i < local_ignores->nelts; i++)
-                {
-                  const char *ignore = APR_ARRAY_IDX(local_ignores, i,
-                                                     const char *);
-                  APR_ARRAY_PUSH(ignores, const char *) = ignore;
-                }          
-            }
-        }
+      /* If we are creating a new repository directory path to import to,
+         then we disregard any svn:ignore property. */
+      if (!no_ignore && new_entries->nelts)
+        local_ignores = NULL;
 
       SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes,
-                                    ignores, mandatory_ignores,
+                                    local_ignores, global_ignores,
                                     filter_callback, filter_baton, ctx,
                                     pool, pool));
 
       SVN_ERR(import_children(local_abspath, relpath, dirents, editor,
-                              depth, excludes, mandatory_ignores, no_ignore,
-                              ignore_unknown_node_types,
+                              depth, excludes, global_ignores, no_ignore,
+                              no_autoprops, ignore_unknown_node_types,
                               filter_callback, filter_baton,
                               import_ctx, ctx, pool));
 
@@ -760,6 +744,7 @@ svn_client_import5(const char *path,
                    const char *url,
                    svn_depth_t depth,
                    svn_boolean_t no_ignore,
+                   svn_boolean_t no_autoprops,
                    svn_boolean_t ignore_unknown_node_types,
                    const apr_hash_t *revprop_table,
                    svn_client_import_filter_func_t filter_callback,
@@ -782,9 +767,8 @@ svn_client_import5(const char *path,
   const char *dir;
   apr_hash_t *commit_revprops;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-  apr_hash_t *autoprops;
-  apr_array_header_t *mandatory_ignores;
-  svn_opt_revision_t rev;
+  apr_hash_t *autoprops = NULL;
+  apr_array_header_t *global_ignores;
   apr_hash_t *local_ignores_hash;
   apr_array_header_t *local_ignores_arr;
 
@@ -896,34 +880,51 @@ svn_client_import5(const char *path,
                                  NULL, NULL, NULL, NULL,
                                  scratch_pool, scratch_pool));
 
-  /* Get inherited svn:inheritable-auto-props, svn:inheritable-ignores, and
+  /* Get inherited svn:auto-props, svn:global-ignores, and
      svn:ignores for the location we are importing to. */
-  SVN_ERR(svn_client__get_all_auto_props(&autoprops, url, ctx,
-                                         scratch_pool, iterpool));
-  SVN_ERR(svn_client__get_inherited_ignores(&mandatory_ignores, url,
-                                            ctx, scratch_pool, iterpool));
-  rev.kind = svn_opt_revision_head;
-  SVN_ERR(svn_client_propget5(&local_ignores_hash, NULL, SVN_PROP_IGNORE, url,
-                              &rev, &rev, NULL, svn_depth_empty, NULL, ctx,
-                              scratch_pool, scratch_pool));
-  local_ignores_arr = apr_array_make(scratch_pool, 1, sizeof(const char *));
-
-  if (apr_hash_count(local_ignores_hash))
-    {
-      svn_string_t *propval = apr_hash_get(local_ignores_hash, url,
-                                           APR_HASH_KEY_STRING);
-      if (propval)
-        {
-          svn_cstring_split_append(local_ignores_arr, propval->data,
-                                   "\n\r\t\v ", FALSE, scratch_pool);
+  if (!no_autoprops)
+    SVN_ERR(svn_client__get_all_auto_props(&autoprops, url, ctx,
+                                           scratch_pool, iterpool));
+  if (no_ignore)
+    {
+      global_ignores = NULL;
+      local_ignores_arr = NULL;
+    }
+  else
+    {
+      svn_opt_revision_t rev;
+      apr_array_header_t *config_ignores;
+
+      SVN_ERR(svn_client__get_inherited_ignores(&global_ignores, url, ctx,
+                                                scratch_pool, iterpool));
+      SVN_ERR(svn_wc_get_default_ignores(&config_ignores, ctx->config,
+                                         scratch_pool));
+      global_ignores = apr_array_append(scratch_pool, global_ignores,
+                                        config_ignores);
+
+      rev.kind = svn_opt_revision_head;
+      SVN_ERR(svn_client_propget5(&local_ignores_hash, NULL, SVN_PROP_IGNORE, url,
+                                  &rev, &rev, NULL, svn_depth_empty, NULL, ctx,
+                                  scratch_pool, scratch_pool));
+      local_ignores_arr = apr_array_make(scratch_pool, 1, sizeof(const char *));
+
+      if (apr_hash_count(local_ignores_hash))
+        {
+          svn_string_t *propval = apr_hash_get(local_ignores_hash, url,
+                                               APR_HASH_KEY_STRING);
+          if (propval)
+            {
+              svn_cstring_split_append(local_ignores_arr, propval->data,
+                                       "\n\r\t\v ", FALSE, scratch_pool);
+            }
         }
     }
 
   /* If an error occurred during the commit, abort the edit and return
      the error.  We don't even care if the abort itself fails.  */
   if ((err = import(local_abspath, new_entries, editor, depth, excludes,
-                    autoprops, local_ignores_arr, mandatory_ignores,
-                    no_ignore, ignore_unknown_node_types,
+                    autoprops, local_ignores_arr, global_ignores,
+                    no_ignore, no_autoprops, ignore_unknown_node_types,
                     filter_callback, filter_baton, ctx, iterpool)))
     {
       svn_error_clear(svn_editor_abort(editor));
@@ -1295,14 +1296,14 @@ append_externals_as_explicit_targets(apr
 
   /* Easy part of applying DEPTH to externals. */
   if (depth == svn_depth_empty)
-     {
-       /* Don't recurse. */
-       return SVN_NO_ERROR;
-     }
-   else if (depth != svn_depth_infinity)
-     {
-       include_dir_externals = FALSE;
-       /* We slip in dir externals as explicit targets. When we do that,
+    {
+      /* Don't recurse. */
+      return SVN_NO_ERROR;
+    }
+  else if (depth != svn_depth_infinity)
+    {
+      include_dir_externals = FALSE;
+      /* We slip in dir externals as explicit targets. When we do that,
        * depth_immediates should become depth_empty for dir externals targets.
        * But adding the dir external to the list of targets makes it get
        * handled with depth_immediates itself, and thus will also include the
@@ -1317,7 +1318,7 @@ append_externals_as_explicit_targets(apr
        * ### --depth=immediates --include-externals', commit dir externals
        * ### (only immediate children of a target) with depth_empty instead of
        * ### not at all. No other effect. So not doing that for now. */
-     }
+    }
 
   /* Iterate *and* grow REL_TARGETS at the same time. */
   rel_targets_nelts_fixed = rel_targets->nelts;

Modified: subversion/branches/ev2-export/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/deprecated.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/deprecated.c Fri Nov 23 01:12:18 2012
@@ -78,6 +78,19 @@ capture_commit_info(const svn_commit_inf
 
 /*** From add.c ***/
 svn_error_t *
+svn_client_add4(const char *path,
+                svn_depth_t depth,
+                svn_boolean_t force,
+                svn_boolean_t no_ignore,
+                svn_boolean_t add_parents,
+                svn_client_ctx_t *ctx,
+                apr_pool_t *pool)
+{
+  return svn_client_add5(path, depth, force, no_ignore, FALSE, add_parents,
+                         ctx, pool);
+}
+
+svn_error_t *
 svn_client_add3(const char *path,
                 svn_boolean_t recursive,
                 svn_boolean_t force,
@@ -398,7 +411,7 @@ svn_client_import4(const char *path,
                    apr_pool_t *pool)
 {
   return svn_error_trace(svn_client_import5(path, url, depth, no_ignore,
-                                            ignore_unknown_node_types,
+                                            FALSE, ignore_unknown_node_types,
                                             revprop_table,
                                             NULL, NULL,
                                             commit_callback, commit_baton,
@@ -2385,7 +2398,7 @@ info_from_info2(svn_info_t **new_info,
   info->size64              = info2->size;
   if (info2->size == SVN_INVALID_FILESIZE)
     info->size               = SVN_INFO_SIZE_UNKNOWN;
-  else if (((apr_size_t)info->size64) == info->size64)
+  else if (((svn_filesize_t)(apr_size_t)info->size64) == info->size64)
     info->size               = (apr_size_t)info->size64;
   else /* >= 4GB */
     info->size               = SVN_INFO_SIZE_UNKNOWN;
@@ -2411,7 +2424,7 @@ info_from_info2(svn_info_t **new_info,
         info->depth = svn_depth_infinity;
 
       info->working_size64      = info2->wc_info->recorded_size;
-      if (((apr_size_t)info->working_size64) == info->working_size64)
+      if (((svn_filesize_t)(apr_size_t)info->working_size64) == info->working_size64)
         info->working_size       = (apr_size_t)info->working_size64;
       else /* >= 4GB */
         info->working_size       = SVN_INFO_SIZE_UNKNOWN;

Modified: subversion/branches/ev2-export/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/diff.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/diff.c Fri Nov 23 01:12:18 2012
@@ -52,6 +52,7 @@
 #include "client.h"
 
 #include "private/svn_wc_private.h"
+#include "private/svn_diff_private.h"
 
 #include "svn_private_config.h"
 
@@ -70,116 +71,11 @@ static const char under_string[] =
 /* Utilities */
 
 
-/* A helper function for display_prop_diffs.  Output the differences between
-   the mergeinfo stored in ORIG_MERGEINFO_VAL and NEW_MERGEINFO_VAL in a
-   human-readable form to OUTSTREAM, using ENCODING.  Use POOL for temporary
-   allocations. */
-static svn_error_t *
-display_mergeinfo_diff(const char *old_mergeinfo_val,
-                       const char *new_mergeinfo_val,
-                       const char *encoding,
-                       svn_stream_t *outstream,
-                       apr_pool_t *pool)
-{
-  apr_hash_t *old_mergeinfo_hash, *new_mergeinfo_hash, *added, *deleted;
-  apr_pool_t *iterpool = svn_pool_create(pool);
-  apr_hash_index_t *hi;
-
-  if (old_mergeinfo_val)
-    SVN_ERR(svn_mergeinfo_parse(&old_mergeinfo_hash, old_mergeinfo_val, pool));
-  else
-    old_mergeinfo_hash = NULL;
-
-  if (new_mergeinfo_val)
-    SVN_ERR(svn_mergeinfo_parse(&new_mergeinfo_hash, new_mergeinfo_val, pool));
-  else
-    new_mergeinfo_hash = NULL;
-
-  SVN_ERR(svn_mergeinfo_diff2(&deleted, &added, old_mergeinfo_hash,
-                              new_mergeinfo_hash,
-                              TRUE, pool, pool));
-
-  for (hi = apr_hash_first(pool, deleted);
-       hi; hi = apr_hash_next(hi))
-    {
-      const char *from_path = svn__apr_hash_index_key(hi);
-      svn_rangelist_t *merge_revarray = svn__apr_hash_index_val(hi);
-      svn_string_t *merge_revstr;
-
-      svn_pool_clear(iterpool);
-      SVN_ERR(svn_rangelist_to_string(&merge_revstr, merge_revarray,
-                                      iterpool));
-
-      SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, iterpool,
-                                          _("   Reverse-merged %s:r%s%s"),
-                                          from_path, merge_revstr->data,
-                                          APR_EOL_STR));
-    }
-
-  for (hi = apr_hash_first(pool, added);
-       hi; hi = apr_hash_next(hi))
-    {
-      const char *from_path = svn__apr_hash_index_key(hi);
-      svn_rangelist_t *merge_revarray = svn__apr_hash_index_val(hi);
-      svn_string_t *merge_revstr;
-
-      svn_pool_clear(iterpool);
-      SVN_ERR(svn_rangelist_to_string(&merge_revstr, merge_revarray,
-                                      iterpool));
-
-      SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, iterpool,
-                                          _("   Merged %s:r%s%s"),
-                                          from_path, merge_revstr->data,
-                                          APR_EOL_STR));
-    }
-
-  svn_pool_destroy(iterpool);
-  return SVN_NO_ERROR;
-}
-
 #define MAKE_ERR_BAD_RELATIVE_PATH(path, relative_to_dir) \
         svn_error_createf(SVN_ERR_BAD_RELATIVE_PATH, NULL, \
                           _("Path '%s' must be an immediate child of " \
                             "the directory '%s'"), path, relative_to_dir)
 
-/* A helper function used by display_prop_diffs.
-   TOKEN is a string holding a property value.
-   If TOKEN is empty, or is already terminated by an EOL marker,
-   return TOKEN unmodified. Else, return a new string consisting
-   of the concatenation of TOKEN and the system's default EOL marker.
-   The new string is allocated from POOL.
-   If HAD_EOL is not NULL, indicate in *HAD_EOL if the token had a EOL. */
-static const svn_string_t *
-maybe_append_eol(const svn_string_t *token, svn_boolean_t *had_eol,
-                 apr_pool_t *pool)
-{
-  const char *curp;
-
-  if (had_eol)
-    *had_eol = FALSE;
-
-  if (token->len == 0)
-    return token;
-
-  curp = token->data + token->len - 1;
-  if (*curp == '\r')
-    {
-      if (had_eol)
-        *had_eol = TRUE;
-      return token;
-    }
-  else if (*curp != '\n')
-    {
-      return svn_string_createf(pool, "%s%s", token->data, APR_EOL_STR);
-    }
-  else
-    {
-      if (had_eol)
-        *had_eol = TRUE;
-      return token;
-    }
-}
-
 /* Adjust PATH to be relative to the repository root beneath ORIG_TARGET,
  * using RA_SESSION and WC_CTX, and return the result in *ADJUSTED_PATH.
  * ORIG_TARGET is one of the original targets passed to the diff command,
@@ -548,10 +444,8 @@ display_prop_diffs(const apr_array_heade
                    const char *wc_root_abspath,
                    apr_pool_t *pool)
 {
-  int i;
   const char *path1 = orig_path1;
   const char *path2 = orig_path2;
-  apr_pool_t *iterpool;
 
   if (use_git_diff_format)
     {
@@ -614,105 +508,9 @@ display_prop_diffs(const apr_array_heade
   SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
                                       "%s" APR_EOL_STR, under_string));
 
-  iterpool = svn_pool_create(pool);
-  for (i = 0; i < propchanges->nelts; i++)
-    {
-      const char *action;
-      const svn_string_t *original_value;
-      const svn_prop_t *propchange =
-        &APR_ARRAY_IDX(propchanges, i, svn_prop_t);
-
-      if (original_props)
-        original_value = apr_hash_get(original_props,
-                                      propchange->name, APR_HASH_KEY_STRING);
-      else
-        original_value = NULL;
-
-      /* If the property doesn't exist on either side, or if it exists
-         with the same value, skip it.  */
-      if ((! (original_value || propchange->value))
-          || (original_value && propchange->value
-              && svn_string_compare(original_value, propchange->value)))
-        continue;
-
-      svn_pool_clear(iterpool);
-
-      if (! original_value)
-        action = "Added";
-      else if (! propchange->value)
-        action = "Deleted";
-      else
-        action = "Modified";
-      SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, iterpool,
-                                          "%s: %s%s", action,
-                                          propchange->name, APR_EOL_STR));
-
-      if (strcmp(propchange->name, SVN_PROP_MERGEINFO) == 0)
-        {
-          const char *orig = original_value ? original_value->data : NULL;
-          const char *val = propchange->value ? propchange->value->data : NULL;
-          svn_error_t *err = display_mergeinfo_diff(orig, val, encoding,
-                                                    outstream, iterpool);
-
-          /* Issue #3896: If we can't pretty-print mergeinfo differences
-             because invalid mergeinfo is present, then don't let the diff
-             fail, just print the diff as any other property. */
-          if (err && err->apr_err == SVN_ERR_MERGEINFO_PARSE_ERROR)
-            {
-              svn_error_clear(err);
-            }
-          else
-            {
-              SVN_ERR(err);
-              continue;
-            }
-        }
-
-      {
-        svn_diff_t *diff;
-        svn_diff_file_options_t options = { 0 };
-        const svn_string_t *tmp;
-        const svn_string_t *orig;
-        const svn_string_t *val;
-        svn_boolean_t val_has_eol;
-
-        /* The last character in a property is often not a newline.
-           An eol character is appended to prevent the diff API to add a
-           ' \ No newline at end of file' line. We add
-           ' \ No newline at end of property' manually if needed. */
-        tmp = original_value ? original_value
-                             : svn_string_create_empty(iterpool);
-        orig = maybe_append_eol(tmp, NULL, iterpool);
-
-        tmp = propchange->value ? propchange->value :
-                                  svn_string_create_empty(iterpool);
-        val = maybe_append_eol(tmp, &val_has_eol, iterpool);
-
-        SVN_ERR(svn_diff_mem_string_diff(&diff, orig, val, &options,
-                                         iterpool));
-
-        /* UNIX patch will try to apply a diff even if the diff header
-         * is missing. It tries to be helpful by asking the user for a
-         * target filename when it can't determine the target filename
-         * from the diff header. But there usually are no files which
-         * UNIX patch could apply the property diff to, so we use "##"
-         * instead of "@@" as the default hunk delimiter for property diffs.
-         * We also supress the diff header. */
-        SVN_ERR(svn_diff_mem_string_output_unified2(outstream, diff, FALSE,
-                                                    "##",
-                                           svn_dirent_local_style(path,
-                                                                  iterpool),
-                                           svn_dirent_local_style(path,
-                                                                  iterpool),
-                                           encoding, orig, val, iterpool));
-        if (!val_has_eol)
-          {
-            const char *s = "\\ No newline at end of property" APR_EOL_STR;
-            SVN_ERR(svn_stream_puts(outstream, s));
-          }
-      }
-    }
-  svn_pool_destroy(iterpool);
+  SVN_ERR(svn_diff__display_prop_diffs(
+            outstream, encoding, propchanges, original_props,
+            TRUE /* pretty_print_mergeinfo */, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/info.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/info.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/info.c Fri Nov 23 01:12:18 2012
@@ -248,75 +248,6 @@ wc_info_receiver(void *baton,
                                  abspath_or_url, &client_info, scratch_pool);
 }
 
-/* Like svn_ra_stat() but with a compatibility hack for pre-1.2 svnserve. */
-static svn_error_t *
-ra_stat_compatible(svn_ra_session_t *ra_session,
-                   svn_revnum_t rev,
-                   svn_dirent_t **dirent_p,
-                   apr_uint32_t dirent_fields,
-                   svn_client_ctx_t *ctx,
-                   apr_pool_t *pool)
-{
-  const char *repos_root_URL, *url;
-  svn_error_t *err;
-  svn_dirent_t *the_ent;
-
-  SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_URL, pool));
-  SVN_ERR(svn_ra_get_session_url(ra_session, &url, pool));
-
-  err = svn_ra_stat(ra_session, "", rev, &the_ent, pool);
-
-  /* svn_ra_stat() will work against old versions of mod_dav_svn, but
-     not old versions of svnserve.  In the case of a pre-1.2 svnserve,
-     catch the specific error it throws:*/
-  if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
-    {
-      /* Fall back to pre-1.2 strategy for fetching dirent's URL. */
-      svn_node_kind_t url_kind;
-      svn_ra_session_t *parent_ra_session;
-      apr_hash_t *parent_ents;
-      const char *parent_url, *base_name;
-
-      if (strcmp(url, repos_root_URL) == 0)
-        {
-          /* In this universe, there's simply no way to fetch
-             information about the repository's root directory! */
-          return err;
-        }
-
-      svn_error_clear(err);
-
-      SVN_ERR(svn_ra_check_path(ra_session, "", rev, &url_kind, pool));
-      if (url_kind == svn_node_none)
-        return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
-                                 _("URL '%s' non-existent in revision %ld"),
-                                 url, rev);
-
-      /* Open a new RA session to the item's parent. */
-      svn_uri_split(&parent_url, &base_name, url, pool);
-      SVN_ERR(svn_client__open_ra_session_internal(&parent_ra_session, NULL,
-                                                   parent_url, NULL,
-                                                   NULL, FALSE, TRUE,
-                                                   ctx, pool));
-
-      /* Get all parent's entries, and find the item's dirent in the hash. */
-      SVN_ERR(svn_ra_get_dir2(parent_ra_session, &parent_ents, NULL, NULL,
-                              "", rev, dirent_fields, pool));
-      the_ent = apr_hash_get(parent_ents, base_name, APR_HASH_KEY_STRING);
-      if (the_ent == NULL)
-        return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
-                                 _("URL '%s' non-existent in revision %ld"),
-                                 url, rev);
-    }
-  else if (err)
-    {
-      return svn_error_trace(err);
-    }
-
-  *dirent_p = the_ent;
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_client_info3(const char *abspath_or_url,
                  const svn_opt_revision_t *peg_revision,
@@ -371,28 +302,8 @@ svn_client_info3(const char *abspath_or_
   svn_uri_split(NULL, &base_name, pathrev->url, pool);
 
   /* Get the dirent for the URL itself. */
-  err = ra_stat_compatible(ra_session, pathrev->rev, &the_ent, DIRENT_FIELDS,
-                           ctx, pool);
-  if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
-    {
-      svn_error_clear(err);
-
-      /* If we're recursing, degrade gracefully: rather than
-         throw an error, return no information about the
-         repos root. */
-      if (depth > svn_depth_empty)
-        goto pre_1_2_recurse;
-
-      /* Otherwise, we really are stuck.  Better tell the user
-         what's going on. */
-      return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
-                               _("Server does not support retrieving "
-                                 "information about the repository root"));
-    }
-  else if (err)
-    {
-      return svn_error_trace(err);
-    }
+  SVN_ERR(svn_client__ra_stat_compatible(ra_session, pathrev->rev, &the_ent,
+                                         DIRENT_FIELDS, ctx, pool));
 
   if (! the_ent)
     return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
@@ -436,7 +347,6 @@ svn_client_info3(const char *abspath_or_
     {
       apr_hash_t *locks;
 
-pre_1_2_recurse:
       if (peg_revision->kind == svn_opt_revision_head)
         {
           err = svn_ra_get_locks2(ra_session, &locks, "", depth,

Modified: subversion/branches/ev2-export/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/list.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/list.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/list.c Fri Nov 23 01:12:18 2012
@@ -123,57 +123,67 @@ get_dir_contents(apr_uint32_t dirent_fie
 }
 
 /* Like svn_ra_stat() but with a compatibility hack for pre-1.2 svnserve. */
-static svn_error_t *
-ra_stat_compatible(svn_ra_session_t *ra_session,
-                   svn_revnum_t rev,
-                   svn_dirent_t **dirent_p,
-                   apr_uint32_t dirent_fields,
-                   svn_client_ctx_t *ctx,
-                   apr_pool_t *pool)
+/* ### Maybe we should move this behavior into the svn_ra_stat wrapper? */
+svn_error_t *
+svn_client__ra_stat_compatible(svn_ra_session_t *ra_session,
+                               svn_revnum_t rev,
+                               svn_dirent_t **dirent_p,
+                               apr_uint32_t dirent_fields,
+                               svn_client_ctx_t *ctx,
+                               apr_pool_t *pool)
 {
-  const char *repos_root, *url;
   svn_error_t *err;
-  svn_dirent_t *dirent;
 
-  SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root, pool));
-  SVN_ERR(svn_ra_get_session_url(ra_session, &url, pool));
-
-  err = svn_ra_stat(ra_session, "", rev, &dirent, pool);
+  err = svn_ra_stat(ra_session, "", rev, dirent_p, pool);
 
   /* svnserve before 1.2 doesn't support the above, so fall back on
      a less efficient method. */
   if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
     {
+      const char *repos_root_url;
+      const char *session_url;
       svn_node_kind_t kind;
+      svn_dirent_t *dirent;
 
       svn_error_clear(err);
 
+      SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url, pool));
+      SVN_ERR(svn_ra_get_session_url(ra_session, &session_url, pool));
+
       SVN_ERR(svn_ra_check_path(ra_session, "", rev, &kind, pool));
 
       if (kind != svn_node_none)
         {
-          if (strcmp(url, repos_root) != 0)
+          if (strcmp(session_url, repos_root_url) != 0)
             {
               svn_ra_session_t *parent_session;
               apr_hash_t *parent_ents;
               const char *parent_url, *base_name;
+              apr_pool_t *subpool = svn_pool_create(pool);
 
               /* Open another session to the path's parent.  This server
                  doesn't support svn_ra_reparent anyway, so don't try it. */
-              svn_uri_split(&parent_url, &base_name, url, pool);
+              svn_uri_split(&parent_url, &base_name, session_url, subpool);
 
               SVN_ERR(svn_client__open_ra_session_internal(&parent_session,
                                                            NULL, parent_url,
                                                            NULL, NULL, FALSE,
-                                                           TRUE, ctx, pool));
+                                                           TRUE, ctx, subpool));
 
               /* Get all parent's entries, no props. */
               SVN_ERR(svn_ra_get_dir2(parent_session, &parent_ents, NULL,
-                                      NULL, "", rev, dirent_fields, pool));
+                                      NULL, "", rev, dirent_fields, subpool));
 
               /* Get the relevant entry. */
               dirent = apr_hash_get(parent_ents, base_name,
                                     APR_HASH_KEY_STRING);
+
+              if (dirent)
+                *dirent_p = svn_dirent_dup(dirent, pool);
+              else
+                *dirent_p = NULL;
+
+              svn_pool_destroy(subpool); /* Close RA session */
             }
           else
             {
@@ -183,7 +193,7 @@ ra_stat_compatible(svn_ra_session_t *ra_
                  be rev. */
               dirent = apr_palloc(pool, sizeof(*dirent));
               dirent->kind = kind;
-              dirent->size = 0;
+              dirent->size = SVN_INVALID_FILESIZE;
               if (dirent_fields & SVN_DIRENT_HAS_PROPS)
                 {
                   apr_hash_t *props;
@@ -212,15 +222,16 @@ ra_stat_compatible(svn_ra_session_t *ra_
                                      APR_HASH_KEY_STRING);
                   dirent->last_author = val ? val->data : NULL;
                 }
+
+              *dirent_p = dirent;
             }
         }
       else
-        dirent = NULL;
+        *dirent_p = NULL;
     }
-  else if (err)
-    return svn_error_trace(err);
+  else
+    SVN_ERR(err);
 
-  *dirent_p = dirent;
   return SVN_NO_ERROR;
 }
 
@@ -255,8 +266,8 @@ svn_client_list2(const char *path_or_url
 
   fs_path = svn_client__pathrev_fspath(loc, pool);
 
-  SVN_ERR(ra_stat_compatible(ra_session, loc->rev, &dirent, dirent_fields,
-                             ctx, pool));
+  SVN_ERR(svn_client__ra_stat_compatible(ra_session, loc->rev, &dirent,
+                                         dirent_fields, ctx, pool));
   if (! dirent)
     return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
                              _("URL '%s' non-existent in revision %ld"),

Modified: subversion/branches/ev2-export/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/merge.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/merge.c Fri Nov 23 01:12:18 2012
@@ -11788,21 +11788,37 @@ svn_client_automatic_merge_is_reintegrat
 }
 
 svn_error_t *
-svn_client__automatic_merge_get_locations(
-                                svn_client__pathrev_t **yca,
-                                svn_client__pathrev_t **base,
-                                svn_client__pathrev_t **right,
-                                svn_client__pathrev_t **target,
+svn_client_automatic_merge_get_locations(
+                                const char **yca_url,
+                                svn_revnum_t *yca_rev,
+                                const char **base_url,
+                                svn_revnum_t *base_rev,
+                                const char **right_url,
+                                svn_revnum_t *right_rev,
+                                const char **target_url,
+                                svn_revnum_t *target_rev,
+                                const char **repos_root_url,
                                 const svn_client_automatic_merge_t *merge,
                                 apr_pool_t *result_pool)
 {
-  if (yca)
-    *yca = svn_client__pathrev_dup(merge->yca, result_pool);
-  if (base)
-    *base = svn_client__pathrev_dup(merge->base, result_pool);
-  if (right)
-    *right = svn_client__pathrev_dup(merge->right, result_pool);
-  if (target)
-    *target = svn_client__pathrev_dup(merge->target, result_pool);
+  if (yca_url)
+    *yca_url = apr_pstrdup(result_pool, merge->yca->url);
+  if (yca_rev)
+    *yca_rev = merge->yca->rev;
+  if (base_url)
+    *base_url = apr_pstrdup(result_pool, merge->base->url);
+  if (base_rev)
+    *base_rev = merge->base->rev;
+  if (right_url)
+    *right_url = apr_pstrdup(result_pool, merge->right->url);
+  if (right_rev)
+    *right_rev = merge->right->rev;
+  if (target_url)
+    *target_url = apr_pstrdup(result_pool, merge->target->url);
+  if (target_rev)
+    *target_rev = merge->target->rev;
+  if (repos_root_url)
+    *repos_root_url = apr_pstrdup(result_pool, merge->yca->repos_root_url);
+
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/ev2-export/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/patch.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/patch.c Fri Nov 23 01:12:18 2012
@@ -542,7 +542,7 @@ readline_prop(void *baton, svn_stringbuf
 
   str = svn_stringbuf_create_ensure(80, result_pool);
 
-  if (b->offset >= b->value->len)
+  if ((apr_uint64_t)b->offset >= (apr_uint64_t)b->value->len)
     {
       *eol_str = NULL;
       *eof = TRUE;

Modified: subversion/branches/ev2-export/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/prop_commands.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/prop_commands.c Fri Nov 23 01:12:18 2012
@@ -896,12 +896,12 @@ svn_client_propget5(apr_hash_t **props,
       if (inherited_props && local_iprops)
         SVN_ERR(svn_wc__get_iprops(inherited_props, ctx->wc_ctx,
                                    target, propname,
-                                   scratch_pool, scratch_pool));
+                                   result_pool, scratch_pool));
 
       SVN_ERR(get_prop_from_wc(props, propname, target,
                                pristine, kind,
-                               depth, changelists, ctx, scratch_pool,
-                               result_pool));
+                               depth, changelists, ctx, result_pool,
+                               scratch_pool));
     }
 
   if ((inherited_props && !local_iprops)

Modified: subversion/branches/ev2-export/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/ra.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/ra.c Fri Nov 23 01:12:18 2012
@@ -1033,9 +1033,9 @@ svn_client__ra_provide_base(svn_stream_t
     {
       /* The pristine contents refer to the BASE, or to the pristine of
          a copy/move to this location. Fetch the correct revision.  */
-      SVN_ERR(svn_wc__node_get_commit_base(revision, NULL, NULL, NULL,
-                                           reb->wc_ctx, local_abspath,
-                                           scratch_pool, scratch_pool));
+      SVN_ERR(svn_wc__node_get_origin(NULL, revision, NULL, NULL, NULL, NULL,
+                                      reb->wc_ctx, local_abspath, FALSE,
+                                      scratch_pool, scratch_pool));
     }
 
   return SVN_NO_ERROR;
@@ -1078,9 +1078,9 @@ svn_client__ra_provide_props(apr_hash_t 
     {
       /* The pristine props refer to the BASE, or to the pristine props of
          a copy/move to this location. Fetch the correct revision.  */
-      SVN_ERR(svn_wc__node_get_commit_base(revision, NULL, NULL, NULL,
-                                           reb->wc_ctx, local_abspath,
-                                           scratch_pool, scratch_pool));
+      SVN_ERR(svn_wc__node_get_origin(NULL, revision, NULL, NULL, NULL, NULL,
+                                      reb->wc_ctx, local_abspath, FALSE,
+                                      scratch_pool, scratch_pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/ev2-export/subversion/libsvn_client/revisions.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/revisions.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/revisions.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/revisions.c Fri Nov 23 01:12:18 2012
@@ -91,9 +91,9 @@ svn_client__get_revision_number(svn_revn
         if (svn_path_is_url(local_abspath))
           goto invalid_rev_arg;
 
-        err = svn_wc__node_get_commit_base(revnum, NULL, NULL, NULL,
-                                           wc_ctx, local_abspath,
-                                           scratch_pool, scratch_pool);
+        err = svn_wc__node_get_origin(NULL, revnum, NULL, NULL, NULL, NULL,
+                                      wc_ctx, local_abspath, TRUE,
+                                      scratch_pool, scratch_pool);
 
         /* Return the same error as older code did (before and at r935091).
            At least svn_client_proplist4 promises SVN_ERR_ENTRY_NOT_FOUND. */

Modified: subversion/branches/ev2-export/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_delta/compat.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_delta/compat.c Fri Nov 23 01:12:18 2012
@@ -911,7 +911,7 @@ ev2_abort_edit(void *edit_baton,
 }
 
 /* Return a svn_delta_editor_t * in DEDITOR, with an accompanying baton in
- * DEDITOR_BATON, which will be driven by EDITOR.  These will both be
+ * DEDITOR_BATON, which will drive EDITOR.  These will both be
  * allocated in RESULT_POOL, which may become large and long-lived;
  * SCRATCH_POOL is used for temporary allocations.
  *
@@ -1832,7 +1832,7 @@ do_unlock(void *baton,
   return SVN_NO_ERROR;
 }
 
-/* Return an svn_editor_t * in EDITOR_P which will be driven by
+/* Return an svn_editor_t * in EDITOR_P which will drive
  * DEDITOR/DEDIT_BATON.  EDITOR_P is allocated in RESULT_POOL, which may
  * become large and long-lived; SCRATCH_POOL is used for temporary
  * allocations.

Modified: subversion/branches/ev2-export/subversion/libsvn_delta/debug_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_delta/debug_editor.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_delta/debug_editor.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_delta/debug_editor.c Fri Nov 23 01:12:18 2012
@@ -52,6 +52,8 @@ write_indent(struct edit_baton *eb, apr_
 {
   int i;
 
+  /* This is DBG_FLAG from ../libsvn_subr/debug.c */
+  SVN_ERR(svn_stream_puts(eb->out, "DBG:"));
   for (i = 0; i < eb->indent_level; ++i)
     SVN_ERR(svn_stream_puts(eb->out, " "));
 

Modified: subversion/branches/ev2-export/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_delta/svndiff.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_delta/svndiff.c Fri Nov 23 01:12:18 2012
@@ -181,6 +181,7 @@ zlib_encode(const char *data,
           return SVN_NO_ERROR;
         }
       out->len = endlen + intlen;
+      out->data[out->len] = 0;
     }
   return SVN_NO_ERROR;
 }
@@ -569,6 +570,7 @@ zlib_decode(const unsigned char *in, apr
                                 NULL,
                                 _("Size of uncompressed data "
                                   "does not match stored original length"));
+      out->data[zlen] = 0;
       out->len = zlen;
     }
   return SVN_NO_ERROR;
@@ -852,7 +854,7 @@ write_handler(void *baton,
       /* Check for integer overflow.  */
       if (sview_offset < 0 || inslen + newlen < inslen
           || sview_len + tview_len < sview_len
-          || sview_offset + sview_len < sview_offset)
+          || (apr_size_t)sview_offset + sview_len < (apr_size_t)sview_offset)
         return svn_error_create(SVN_ERR_SVNDIFF_CORRUPT_WINDOW, NULL,
                                 _("Svndiff contains corrupt window header"));
 
@@ -1016,7 +1018,7 @@ read_window_header(svn_stream_t *stream,
   /* Check for integer overflow.  */
   if (*sview_offset < 0 || *inslen + *newlen < *inslen
       || *sview_len + *tview_len < *sview_len
-      || *sview_offset + *sview_len < *sview_offset)
+      || (apr_size_t)*sview_offset + *sview_len < (apr_size_t)*sview_offset)
     return svn_error_create(SVN_ERR_SVNDIFF_CORRUPT_WINDOW, NULL,
                             _("Svndiff contains corrupt window header"));
 

Modified: subversion/branches/ev2-export/subversion/libsvn_delta/text_delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_delta/text_delta.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_delta/text_delta.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_delta/text_delta.c Fri Nov 23 01:12:18 2012
@@ -709,6 +709,7 @@ svn_txdelta_apply_instructions(svn_txdel
         {
         case svn_txdelta_source:
           /* Copy from source area.  */
+          assert(sbuf);
           assert(op->offset + op->length <= window->sview_len);
           fast_memcpy(tbuf + tpos, sbuf + op->offset, buf_len);
           break;
@@ -801,7 +802,8 @@ apply_window(svn_txdelta_window_t *windo
 
       /* If the existing view overlaps with the new view, copy the
        * overlap to the beginning of the new buffer.  */
-      if (ab->sbuf_offset + ab->sbuf_len > window->sview_offset)
+      if (  (apr_size_t)ab->sbuf_offset + ab->sbuf_len
+          > (apr_size_t)window->sview_offset)
         {
           apr_size_t start =
             (apr_size_t)(window->sview_offset - ab->sbuf_offset);

Modified: subversion/branches/ev2-export/subversion/libsvn_diff/diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_diff/diff.h?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_diff/diff.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_diff/diff.h Fri Nov 23 01:12:18 2012
@@ -184,5 +184,48 @@ svn_diff__normalize_buffer(char **tgt,
                            const char *buf,
                            const svn_diff_file_options_t *opts);
 
+/* Set *OUT_STR to a newline followed by a "\ No newline at end of file" line.
+ *
+ * The text will be encoded into HEADER_ENCODING.
+ */
+svn_error_t *
+svn_diff__unified_append_no_newline_msg(svn_stringbuf_t *stringbuf,
+                                        const char *header_encoding,
+                                        apr_pool_t *scratch_pool);
+
+/* Write a unidiff hunk header to OUTPUT_STREAM.
+ *
+ * The header will use HUNK_DELIMITER (which should usually be "@@") before
+ * and after the line-number ranges which are formed from OLD_START,
+ * OLD_LENGTH, NEW_START and NEW_LENGTH.  If HUNK_EXTRA_CONTEXT is not NULL,
+ * it will be written after the final delimiter, with an intervening space.
+ *
+ * The text will be encoded into HEADER_ENCODING.
+ */
+svn_error_t *
+svn_diff__unified_write_hunk_header(svn_stream_t *output_stream,
+                                    const char *header_encoding,
+                                    const char *hunk_delimiter,
+                                    apr_off_t old_start,
+                                    apr_off_t old_length,
+                                    apr_off_t new_start,
+                                    apr_off_t new_length,
+                                    const char *hunk_extra_context,
+                                    apr_pool_t *scratch_pool);
+
+/* Write a unidiff "---" and "+++" header to OUTPUT_STREAM.
+ *
+ * Write "---" followed by a space and OLD_HEADER and a newline,
+ * then "+++" followed by a space and NEW_HEADER and a newline.
+ *
+ * The text will be encoded into HEADER_ENCODING.
+ */
+svn_error_t *
+svn_diff__unidiff_write_header(svn_stream_t *output_stream,
+                               const char *header_encoding,
+                               const char *old_header,
+                               const char *new_header,
+                               apr_pool_t *scratch_pool);
+
 
 #endif /* DIFF_H */

Modified: subversion/branches/ev2-export/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_diff/diff_file.c?rev=1412731&r1=1412730&r2=1412731&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_diff/diff_file.c Fri Nov 23 01:12:18 2012
@@ -1491,14 +1491,8 @@ output_unified_line(svn_diff__file_outpu
       if (bytes_processed && (type != svn_diff__file_output_unified_skip)
           && ! had_cr)
         {
-          const char *out_str;
-          SVN_ERR(svn_utf_cstring_from_utf8_ex2
-                  (&out_str,
-                   apr_psprintf(baton->pool,
-                                APR_EOL_STR "\\ %s" APR_EOL_STR,
-                                _("No newline at end of file")),
-                   baton->header_encoding, baton->pool));
-          svn_stringbuf_appendcstr(baton->hunk, out_str);
+          SVN_ERR(svn_diff__unified_append_no_newline_msg(
+                    baton->hunk, baton->header_encoding, baton->pool));
         }
 
       baton->length[idx] = 0;
@@ -1538,41 +1532,13 @@ output_unified_flush_hunk(svn_diff__file
         baton->hunk_start[i]++;
     }
 
-  /* Output the hunk header.  If the hunk length is 1, the file is a one line
-     file.  In this case, surpress the number of lines in the hunk (it is
-     1 implicitly)
-   */
-  SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                      baton->header_encoding,
-                                      baton->pool,
-                                      "@@ -%" APR_OFF_T_FMT,
-                                      baton->hunk_start[0]));
-  if (baton->hunk_length[0] != 1)
-    {
-      SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                          baton->header_encoding,
-                                          baton->pool, ",%" APR_OFF_T_FMT,
-                                          baton->hunk_length[0]));
-    }
-
-  SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                      baton->header_encoding,
-                                      baton->pool, " +%" APR_OFF_T_FMT,
-                                      baton->hunk_start[1]));
-  if (baton->hunk_length[1] != 1)
-    {
-      SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                          baton->header_encoding,
-                                          baton->pool, ",%" APR_OFF_T_FMT,
-                                          baton->hunk_length[1]));
-    }
-
-  SVN_ERR(svn_stream_printf_from_utf8(baton->output_stream,
-                                      baton->header_encoding,
-                                      baton->pool, " @@%s%s" APR_EOL_STR,
-                                      baton->hunk_extra_context[0]
-                                      ? " " : "",
-                                      baton->hunk_extra_context));
+  /* Write the hunk header */
+  SVN_ERR(svn_diff__unified_write_hunk_header(
+            baton->output_stream, baton->header_encoding, "@@",
+            baton->hunk_start[0], baton->hunk_length[0],
+            baton->hunk_start[1], baton->hunk_length[1],
+            baton->hunk_extra_context,
+            baton->pool));
 
   /* Output the hunk content */
   hunk_len = baton->hunk->len;
@@ -1733,10 +1699,9 @@ svn_diff_file_output_unified3(svn_stream
                               svn_boolean_t show_c_function,
                               apr_pool_t *pool)
 {
-  svn_diff__file_output_baton_t baton;
-
   if (svn_diff_contains_diffs(diff))
     {
+      svn_diff__file_output_baton_t baton;
       const char **c;
       int i;
 
@@ -1822,10 +1787,9 @@ svn_diff_file_output_unified3(svn_stream
                   (&modified_header, modified_path, pool));
         }
 
-      SVN_ERR(svn_stream_printf_from_utf8(output_stream, header_encoding, pool,
-                                          "--- %s" APR_EOL_STR
-                                          "+++ %s" APR_EOL_STR,
-                                          original_header, modified_header));
+      SVN_ERR(svn_diff__unidiff_write_header(
+                output_stream, header_encoding,
+                original_header, modified_header, pool));
 
       SVN_ERR(svn_diff_output(diff, &baton,
                               &svn_diff__file_output_unified_vtable));
@@ -2238,7 +2202,6 @@ svn_diff_file_output_merge2(svn_stream_t
 {
   svn_diff3__file_output_baton_t baton;
   apr_file_t *file[3];
-  apr_off_t size;
   int idx;
 #if APR_HAS_MMAP
   apr_mmap_t *mm[3] = { 0 };
@@ -2282,6 +2245,8 @@ svn_diff_file_output_merge2(svn_stream_t
 
   for (idx = 0; idx < 3; idx++)
     {
+      apr_off_t size;
+
       SVN_ERR(map_or_read_file(&file[idx],
                                MMAP_T_ARG(mm[idx])
                                &baton.buffer[idx], &size,