You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/12/04 16:35:57 UTC

svn commit: r1416996 [3/13] - in /subversion/branches/wc-collate-path: ./ build/ build/ac-macros/ build/generator/ contrib/client-side/svnmerge/ contrib/server-side/svncutter/ notes/ subversion/bindings/cxxhl/ subversion/bindings/javahl/native/ subvers...

Modified: subversion/branches/wc-collate-path/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_error_codes.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_error_codes.h Tue Dec  4 15:35:13 2012
@@ -545,6 +545,11 @@ SVN_ERROR_START
              SVN_ERR_WC_CATEGORY_START + 40,
              "Mixed-revision working copy was found but not expected")
 
+  /** @since New in 1.8 */
+  SVN_ERRDEF(SVN_ERR_WC_DUPLICATE_EXTERNALS_TARGET,
+             SVN_ERR_WC_CATEGORY_START + 41,
+             "Duplicate targets in svn:externals property")
+
   /* fs errors */
 
   SVN_ERRDEF(SVN_ERR_FS_GENERAL,
@@ -1244,7 +1249,7 @@ SVN_ERROR_START
              SVN_ERR_CLIENT_CATEGORY_START + 22,
              "Can't perform this operation without a valid lock token")
 
-/** @since New in 1.7. */
+  /** @since New in 1.7. */
   SVN_ERRDEF(SVN_ERR_CLIENT_FORBIDDEN_BY_SERVER,
              SVN_ERR_CLIENT_CATEGORY_START + 23,
              "The operation is forbidden by the server")

Modified: subversion/branches/wc-collate-path/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_fs.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_fs.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_fs.h Tue Dec  4 15:35:13 2012
@@ -320,6 +320,10 @@ svn_fs_path(svn_fs_t *fs,
 /**
  * Delete the filesystem at @a path.
  *
+ * @note: Deleting a filesystem that has an open svn_fs_t is not
+ * supported.  Clear/destroy all pools used to create/open @a path.
+ * See issue 4264.
+ *
  * @since New in 1.1.
  */
 svn_error_t *

Modified: subversion/branches/wc-collate-path/subversion/include/svn_props.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_props.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_props.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_props.h Tue Dec  4 15:35:13 2012
@@ -187,14 +187,17 @@ svn_property_kind(int *prefix_len,
 
 
 /** Return @c TRUE iff @a prop_name represents the name of a Subversion
- * property.
+ * property.  That is, any property name in Subversion's name space for
+ * versioned or unversioned properties, regardless whether the particular
+ * property name is recognized.
  */
 svn_boolean_t
 svn_prop_is_svn_prop(const char *prop_name);
 
 
 /** Return @c TRUE iff @a props has at least one property whose name
- * represents the name of a Subversion property.
+ * represents the name of a Subversion property, in the sense of
+ * svn_prop_is_svn_prop().
  *
  * @since New in 1.5.
  */
@@ -210,6 +213,57 @@ svn_prop_has_svn_prop(const apr_hash_t *
 svn_boolean_t
 svn_prop_is_boolean(const char *prop_name);
 
+/** Return @c TRUE iff @a prop_name is in the "svn:" name space and is a
+ * known revision property.  For example, svn:log or svn:date.
+ *
+ * This will return FALSE for any property name that is not known by this
+ * version of the library, even though the name may be known to other (for
+ * example, later) Subversion software.
+ *
+ * @since New in 1.8
+ */
+svn_boolean_t
+svn_prop_is_known_svn_rev_prop(const char *prop_name);
+
+/** Return @c TRUE iff @a prop_name is in the "svn:" name space and is a
+ * known versioned property that is allowed on a file and/or on a directory.
+ * For example, svn:eol-style or svn:ignore or svn:mergeinfo.
+ *
+ * This will return FALSE for any property name that is not known by this
+ * version of the library, even though the name may be known to other (for
+ * example, later) Subversion software.
+ *
+ * @since New in 1.8
+ */
+svn_boolean_t
+svn_prop_is_known_svn_node_prop(const char *prop_name);
+
+/** Return @c TRUE iff @a prop_name is in the "svn:" name space and is a
+ * known versioned property that is allowed on a file.  For example,
+ * svn:eol-style or svn:mergeinfo.
+ *
+ * This will return FALSE for any property name that is not known by this
+ * version of the library, even though the name may be known to other (for
+ * example, later) Subversion software.
+ *
+ * @since New in 1.8
+ */
+svn_boolean_t
+svn_prop_is_known_svn_file_prop(const char *prop_name);
+
+/** Return @c TRUE iff @a prop_name represents the name of a Subversion
+ * known versioned property that is allowed on a directory.  For example,
+ * svn:ignore or svn:mergeinfo.
+ *
+ * This will return FALSE for any property name that is not known by this
+ * version of the library, even though the name may be known to other (for
+ * example, later) Subversion software.
+ *
+ * @since New in 1.8
+ */
+svn_boolean_t
+svn_prop_is_known_svn_dir_prop(const char *prop_name);
+
 /** If @a prop_name requires that its value be stored as UTF8/LF in the
  * repository, then return @c TRUE.  Else return @c FALSE.  This is for
  * users of libsvn_client or libsvn_fs, since it their responsibility
@@ -357,19 +411,21 @@ svn_prop_name_is_valid(const char *prop_
 
 /** Describes external items to check out into this directory.
  *
- * The format is a series of lines, such as:
- *
- * <pre reason="Should use 'verbatim' instead, but Doxygen v1.6.1 & v1.7.1
- *              then doesn't recognize the #define; presumably a bug.">
-     localdir1           http://url.for.external.source/etc/
-     localdir1/foo       http://url.for.external.source/foo
-     localdir1/bar       http://blah.blah.blah/repositories/theirproj
-     localdir1/bar/baz   http://blorg.blorg.blorg/basement/code
-     localdir2           http://another.url/blah/blah/blah
-     localdir3           http://and.so.on/and/so/forth </pre>
- *
- * The subdir names on the left side are relative to the directory on
- * which this property is set.
+ * The format is a series of lines, each in the following format:
+ *   [-r REV] URL[@PEG] LOCALPATH
+ * LOCALPATH is relative to the directory having this property.
+ * REV pins the external to revision REV.
+ * URL may be a full URL or a relative URL starting with one of:
+ *   ../  to the parent directory of the extracted external
+ *   ^/   to the repository root
+ *   /    to the server root
+ *   //   to the URL scheme
+ * The following format is supported for interoperability with
+ * Subversion 1.4 and earlier clients:
+ *   LOCALPATH [-r PEG] URL
+ * The ambiguous format 'relative_path relative_path' is taken as
+ * 'relative_url relative_path' with peg revision support.
+ * Lines starting with a '#' character are ignored.
  */
 #define SVN_PROP_EXTERNALS  SVN_PROP_PREFIX "externals"
 
@@ -429,6 +485,27 @@ svn_prop_name_is_valid(const char *prop_
 
 /** @} */ /* Meta-data properties */
 
+/**
+ * This is a list of all user-vixible and -settable versioned node properties.
+ *
+ * @since New in 1.8
+ */
+#define SVN_PROP_NODE_ALL_PROPS SVN_PROP_MIME_TYPE, \
+                                SVN_PROP_IGNORE, \
+                                SVN_PROP_EOL_STYLE, \
+                                SVN_PROP_KEYWORDS, \
+                                SVN_PROP_EXECUTABLE, \
+                                SVN_PROP_NEEDS_LOCK, \
+                                SVN_PROP_SPECIAL, \
+                                SVN_PROP_EXTERNALS, \
+                                SVN_PROP_MERGEINFO, \
+                                SVN_PROP_INHERITABLE_AUTO_PROPS, \
+                                SVN_PROP_INHERITABLE_IGNORES, \
+                                \
+                                SVN_PROP_TEXT_TIME, \
+                                SVN_PROP_OWNER, \
+                                SVN_PROP_GROUP, \
+                                SVN_PROP_UNIX_MODE,
 
 /** @} */
 
@@ -524,25 +601,37 @@ svn_prop_name_is_valid(const char *prop_
 /* More reserved revision props in the 'svn:' namespace, used by the
    svnsync tool:   */
 
-/** Prefix for all svnsync custom properties. */
+/** Prefix for all svnsync custom properties.
+ * @since New in 1.4.
+ */
 #define SVNSYNC_PROP_PREFIX             SVN_PROP_PREFIX "sync-"
 
 /* The following revision properties are set on revision 0 of
  * destination repositories by svnsync:
  */
 
-/** Used to enforce mutually exclusive destination repository access. */
+/** Used to enforce mutually exclusive destination repository access.
+ * @since New in 1.4.
+ */
 #define SVNSYNC_PROP_LOCK               SVNSYNC_PROP_PREFIX "lock"
 
-/** Identifies the repository's source URL. */
+/** Identifies the repository's source URL.
+ * @since New in 1.4.
+ */
 #define SVNSYNC_PROP_FROM_URL           SVNSYNC_PROP_PREFIX "from-url"
-/** Identifies the repository's source UUID. */
+/** Identifies the repository's source UUID.
+ * @since New in 1.4.
+ */
 #define SVNSYNC_PROP_FROM_UUID          SVNSYNC_PROP_PREFIX "from-uuid"
 
-/** Identifies the last completely mirrored revision. */
+/** Identifies the last completely mirrored revision.
+ * @since New in 1.4.
+ */
 #define SVNSYNC_PROP_LAST_MERGED_REV    SVNSYNC_PROP_PREFIX "last-merged-rev"
 
-/** Identifies the revision currently being copied. */
+/** Identifies the revision currently being copied.
+ * @since New in 1.4.
+ */
 #define SVNSYNC_PROP_CURRENTLY_COPYING  SVNSYNC_PROP_PREFIX "currently-copying"
 
 

Modified: subversion/branches/wc-collate-path/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_repos.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_repos.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_repos.h Tue Dec  4 15:35:13 2012
@@ -3282,6 +3282,9 @@ svn_repos_check_revision_access(svn_repo
  * inherited by @a path in @a root.  If no properties are inherited,
  * then set @a *inherited_values to an empty array.
  *
+ * if @a propname is NULL then retrieve all explicit and/or inherited
+ * properties.  Otherwise retrieve only the properties named @a propname.
+ *
  * If optional @a authz_read_func is non-NULL, then use this function
  * (along with optional @a authz_read_baton) to check the readability
  * of each parent path from which properties are inherited. Silently omit
@@ -3296,6 +3299,7 @@ svn_error_t *
 svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props,
                                  svn_fs_root_t *root,
                                  const char *path,
+                                 const char *propname,
                                  svn_repos_authz_func_t authz_read_func,
                                  void *authz_read_baton,
                                  apr_pool_t *result_pool,

Modified: subversion/branches/wc-collate-path/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_string.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_string.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_string.h Tue Dec  4 15:35:13 2012
@@ -54,13 +54,13 @@
  *
  *      Note that an @c svn_string(buf)_t may contain binary data,
  *      which means that strlen(s->data) does not have to equal @c
- *      s->len. The NULL terminator is provided to make it easier to
+ *      s->len. The null terminator is provided to make it easier to
  *      pass @c s->data to C string interfaces.
  *
  *
  *   2. Non-NULL input:
  *
- *      All the functions assume their input data is non-NULL,
+ *      All the functions assume their input data pointer is non-NULL,
  *      unless otherwise documented, and may seg fault if passed
  *      NULL.  The input data may *contain* null bytes, of course, just
  *      the data pointer itself must not be NULL.
@@ -125,40 +125,46 @@ typedef struct svn_stringbuf_t
  * @{
  */
 
-/** Create a new bytestring containing a C string (NULL-terminated). */
+/** Create a new string copied from the null-terminated C string @a cstring.
+ */
 svn_string_t *
 svn_string_create(const char *cstring, apr_pool_t *pool);
 
-/** Create a truely empty string object (length is 0)
+/** Create a new, empty string.
+ *
  * @since New in 1.8.
  */
 svn_string_t *
 svn_string_create_empty(apr_pool_t *pool);
 
-/** Create a new bytestring containing a generic string of bytes
- * (NOT NULL-terminated) */
+/** Create a new string copied from a generic string of bytes, @a bytes, of
+ * length @a size bytes.  @a bytes is NOT assumed to be null-terminated, but
+ * the new string will be.
+ */
 svn_string_t *
 svn_string_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool);
 
-/** Create a new string with the contents of the given stringbuf */
+/** Create a new string copied from the stringbuf @a strbuf.
+ */
 svn_string_t *
 svn_string_create_from_buf(const svn_stringbuf_t *strbuf, apr_pool_t *pool);
 
-/** Create a new bytestring by formatting @a cstring (NULL-terminated)
- * from varargs, which are as appropriate for apr_psprintf().
+/** Create a new string by printf-style formatting using @a fmt and the
+ * variable arguments, which are as appropriate for apr_psprintf().
  */
 svn_string_t *
 svn_string_createf(apr_pool_t *pool, const char *fmt, ...)
   __attribute__((format(printf, 2, 3)));
 
-/** Create a new bytestring by formatting @a cstring (NULL-terminated)
- * from a @c va_list (see svn_stringbuf_createf()).
+/** Create a new string by printf-style formatting using @c fmt and @a ap.
+ * This is the same as svn_string_createf() except for the different
+ * way of passing the variable arguments.
  */
 svn_string_t *
 svn_string_createv(apr_pool_t *pool, const char *fmt, va_list ap)
   __attribute__((format(printf, 2, 0)));
 
-/** Return TRUE if a bytestring is empty (has length zero). */
+/** Return TRUE if @a str is empty (has length zero). */
 svn_boolean_t
 svn_string_isempty(const svn_string_t *str);
 
@@ -190,23 +196,27 @@ svn_string_find_char_backward(const svn_
  * @{
  */
 
-/** Create a new bytestring containing a C string (NULL-terminated). */
+/** Create a new stringbuf copied from the null-terminated C string
+ * @a cstring.
+ */
 svn_stringbuf_t *
 svn_stringbuf_create(const char *cstring, apr_pool_t *pool);
 
-/** Create a new bytestring containing a generic string of bytes
- * (NON-NULL-terminated)
+/** Create a new stringbuf copied from the generic string of bytes, @a bytes,
+ * of length @a size bytes.  @a bytes is NOT assumed to be null-terminated,
+ * but the new stringbuf will be.
  */
 svn_stringbuf_t *
 svn_stringbuf_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool);
 
-/** Create a new, empty bytestring.
+/** Create a new, empty stringbuf.
+ *
  * @since New in 1.8.
  */
 svn_stringbuf_t *
 svn_stringbuf_create_empty(apr_pool_t *pool);
 
-/** Create a new empty bytestring with at least @a minimum_size bytes of
+/** Create a new, empty stringbuf with at least @a minimum_size bytes of
  * space available in the memory block.
  *
  * The allocated string buffer will be at least one byte larger than
@@ -217,25 +227,27 @@ svn_stringbuf_create_empty(apr_pool_t *p
 svn_stringbuf_t *
 svn_stringbuf_create_ensure(apr_size_t minimum_size, apr_pool_t *pool);
 
-/** Create a new stringbuf with the contents of the given string */
+/** Create a new stringbuf copied from the string @a str.
+ */
 svn_stringbuf_t *
 svn_stringbuf_create_from_string(const svn_string_t *str, apr_pool_t *pool);
 
-/** Create a new bytestring by formatting @a cstring (NULL-terminated)
- * from varargs, which are as appropriate for apr_psprintf().
+/** Create a new stringbuf by printf-style formatting using @a fmt and the
+ * variable arguments, which are as appropriate for apr_psprintf().
  */
 svn_stringbuf_t *
 svn_stringbuf_createf(apr_pool_t *pool, const char *fmt, ...)
   __attribute__((format(printf, 2, 3)));
 
-/** Create a new bytestring by formatting @a cstring (NULL-terminated)
- * from a @c va_list (see svn_stringbuf_createf()).
+/** Create a new stringbuf by printf-style formatting using @c fmt and @a ap.
+ * This is the same as svn_stringbuf_createf() except for the different
+ * way of passing the variable arguments.
  */
 svn_stringbuf_t *
 svn_stringbuf_createv(apr_pool_t *pool, const char *fmt, va_list ap)
   __attribute__((format(printf, 2, 0)));
 
-/** Make sure that the stringbuf @a str has at least @a minimum_size
+/** Make sure that @a str has at least @a minimum_size
  * bytes of space available in the memory block.
  *
  * The allocated string buffer will be at least one byte larger than
@@ -249,15 +261,15 @@ svn_stringbuf_createv(apr_pool_t *pool, 
 void
 svn_stringbuf_ensure(svn_stringbuf_t *str, apr_size_t minimum_size);
 
-/** Set a bytestring @a str to @a value */
+/** Set @a str to a copy of the null-terminated C string @a value. */
 void
 svn_stringbuf_set(svn_stringbuf_t *str, const char *value);
 
-/** Set a bytestring @a str to empty (0 length). */
+/** Set @a str to empty (zero length). */
 void
 svn_stringbuf_setempty(svn_stringbuf_t *str);
 
-/** Return @c TRUE if a bytestring is empty (has length zero). */
+/** Return @c TRUE if @a str is empty (has length zero). */
 svn_boolean_t
 svn_stringbuf_isempty(const svn_stringbuf_t *str);
 
@@ -265,11 +277,12 @@ svn_stringbuf_isempty(const svn_stringbu
 void
 svn_stringbuf_chop(svn_stringbuf_t *str, apr_size_t nbytes);
 
-/** Fill bytestring @a str with character @a c. */
+/** Fill @a str with character @a c. */
 void
 svn_stringbuf_fillchar(svn_stringbuf_t *str, unsigned char c);
 
-/** Append a single character @a byte onto @a targetstr.
+/** Append the single character @a byte onto @a targetstr.
+ *
  * This is an optimized version of svn_stringbuf_appendbytes()
  * that is much faster to call and execute. Gains vary with the ABI.
  * The advantages extend beyond the actual call because the reduced
@@ -291,7 +304,7 @@ svn_stringbuf_appendbytes(svn_stringbuf_
                           const char *bytes,
                           apr_size_t count);
 
-/** Append an @c svn_stringbuf_t onto @a targetstr.
+/** Append the stringbuf @c appendstr onto @a targetstr.
  *
  * reallocs if necessary. @a targetstr is affected, nothing else is.
  */
@@ -299,7 +312,7 @@ void
 svn_stringbuf_appendstr(svn_stringbuf_t *targetstr,
                         const svn_stringbuf_t *appendstr);
 
-/** Append a C string onto @a targetstr.
+/** Append the C string @a cstr onto @a targetstr.
  *
  * reallocs if necessary. @a targetstr is affected, nothing else is.
  */

Modified: subversion/branches/wc-collate-path/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/include/svn_wc.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/include/svn_wc.h (original)
+++ subversion/branches/wc-collate-path/subversion/include/svn_wc.h Tue Dec  4 15:35:13 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
@@ -5401,25 +5403,53 @@ svn_wc_crawl_revisions(const char *path,
  * @{
  */
 
+/** If @a is_wcroot is not @c NULL, set @a *is_wcroot to @c TRUE if @a
+ * local_abspath is the root of the working, otherwise to @c FALSE.
+ *
+ * If @a is_switched is not @c NULL, set @a *is_switched to @c TRUE if @a
+ * local_abspath is not the root of the working, and switched against its
+ * parent.
+ *
+ * If @a kind is not @c NULL, set @a *kind to the node kind of @a
+ * local_abspath.
+ *
+ * Use @a scratch_pool for any temporary allocations.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc_check_root(svn_boolean_t *is_wcroot,
+                  svn_boolean_t *is_switched,
+                  svn_kind_t *kind,
+                  svn_wc_context_t *wc_ctx,
+                  const char *local_abspath,
+                  apr_pool_t *scratch_pool);
+
 /** Set @a *wc_root to @c TRUE if @a local_abspath represents a "working copy
  * root", @c FALSE otherwise. Here, @a local_abspath is a "working copy root"
- * if its parent directory is not a WC or if its parent directory's repository
- * URL is not the parent of its own repository URL. Thus, a switched subtree is
- * considered to be a working copy root. Also, a deleted tree-conflict
- * victim is considered a "working copy root" because it has no URL.
+ * if its parent directory is not a WC or if it is switched. Also, a deleted
+ * tree-conflict victim is considered a "working copy root" because it has no
+ * URL.
  *
  * If @a local_abspath is not found, return the error #SVN_ERR_ENTRY_NOT_FOUND.
  *
  * Use @a scratch_pool for any temporary allocations.
  *
+ * @note For legacy reasons only a directory can be a wc-root. However, this
+ * function will also set wc_root to @c TRUE for a switched file.
+ *
  * @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.7 API. Consider
+ * using svn_wc_check_root() instead.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_wc_is_wc_root2(svn_boolean_t *wc_root,
                    svn_wc_context_t *wc_ctx,
                    const char *local_abspath,
                    apr_pool_t *scratch_pool);
 
+
 /**
  * Similar to svn_wc_is_wc_root2(), but with an access baton and relative
  * path.
@@ -6131,6 +6161,8 @@ svn_wc_is_entry_prop(const char *name);
  * (Currently, this is used if you are attempting to set the
  * #SVN_PROP_EOL_STYLE property, to make sure that the value matches
  * the mime type and contents.)
+ *
+ * @since New in 1.5.
  */
 typedef svn_error_t *(*svn_wc_canonicalize_svn_prop_get_file_t)(
   const svn_string_t **mime_type,
@@ -6144,8 +6176,14 @@ typedef svn_error_t *(*svn_wc_canonicali
  *
  * If the property is not appropriate for a node of kind @a kind, or
  * is otherwise invalid, throw an error.  Otherwise, set @a *propval_p
- * to a canonicalized version of the property value.  If @a
- * skip_some_checks is TRUE, only some validity checks are taken.
+ * to a canonicalized version of the property value.
+ *
+ * If @a skip_some_checks is TRUE, some validity checks and
+ * canonicalizations are skipped. Presently, these are:
+ *   - For svn:eol-style: strip white space; check value is recognized;
+ *       check file content matches value.
+ *   - For svn:mime-type: strip white space; check value has reasonable
+ *       syntax.
  *
  * Some validity checks require access to the contents and MIME type
  * of the target if it is a file; they will call @a prop_getter with @a
@@ -6156,7 +6194,9 @@ typedef svn_error_t *(*svn_wc_canonicali
  * for error messages.
  *
  * ### This is not actually related to the WC, but it does need to call
- * ### svn_wc_parse_externals_description2.
+ * ### svn_wc_parse_externals_description3.
+ *
+ * @since New in 1.5.
  */
 svn_error_t *
 svn_wc_canonicalize_svn_prop(const svn_string_t **propval_p,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/add.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/add.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/add.c Tue Dec  4 15:35:13 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: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);
             }
         }
     }
@@ -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,
@@ -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
@@ -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,6 +710,7 @@ 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
@@ -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;
@@ -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;
 }
 
@@ -908,7 +922,9 @@ svn_error_t *svn_client__get_all_ignores
                                 scratch_pool, scratch_pool);
       if (err)
         {
-          if (err->apr_err != SVN_ERR_UNVERSIONED_RESOURCE)
+          /* Unversioned and deleted nodes don't have properties */
+          if (err->apr_err != SVN_ERR_UNVERSIONED_RESOURCE
+              && err->apr_err != SVN_ERR_WC_PATH_UNEXPECTED_STATUS)
             return svn_error_trace(err);
 
           svn_error_clear(err);
@@ -963,7 +979,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 +989,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 +1049,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 +1097,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 +1116,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 +1143,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 +1156,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 +1172,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;
 }
 
@@ -1367,11 +1386,13 @@ mkdir_urls(const apr_array_header_t *url
   /* Call the path-based editor driver. */
   err = svn_delta_path_driver2(editor, edit_baton, targets, TRUE,
                                path_driver_cb_func, (void *)editor, pool);
+
   if (err)
     {
       /* At least try to abort the edit (and fs txn) before throwing err. */
-      svn_error_clear(editor->abort_edit(edit_baton, pool));
-      return svn_error_trace(err);
+      return svn_error_compose_create(
+                err,
+                editor->abort_edit(edit_baton, pool));
     }
 
   /* Close the edit. */
@@ -1398,7 +1419,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/wc-collate-path/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/client.h?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/client.h (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/client.h Tue Dec  4 15:35:13 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. */
@@ -595,6 +596,58 @@ svn_client__switch_internal(svn_revnum_t
 
 /* ---------------------------------------------------------------- */
 
+/*** List ***/
+
+/* List the file/directory entries for PATH_OR_URL at REVISION.
+   The actual node revision selected is determined by the path as 
+   it exists in PEG_REVISION.  
+   
+   If DEPTH is svn_depth_infinity, then list all file and directory entries 
+   recursively.  Else if DEPTH is svn_depth_files, list all files under 
+   PATH_OR_URL (if any), but not subdirectories.  Else if DEPTH is
+   svn_depth_immediates, list all files and include immediate
+   subdirectories (at svn_depth_empty).  Else if DEPTH is
+   svn_depth_empty, just list PATH_OR_URL with none of its entries.
+ 
+   DIRENT_FIELDS controls which fields in the svn_dirent_t's are
+   filled in.  To have them totally filled in use SVN_DIRENT_ALL,
+   otherwise simply bitwise OR together the combination of SVN_DIRENT_*
+   fields you care about.
+ 
+   If FETCH_LOCKS is TRUE, include locks when reporting directory entries.
+ 
+   If INCLUDE_EXTERNALS is TRUE, also list all external items 
+   reached by recursion.  DEPTH value passed to the original list target
+   applies for the externals also.  EXTERNAL_PARENT_URL is url of the 
+   directory which has the externals definitions.  EXTERNAL_TARGET is the
+   target subdirectory of externals definitions.
+
+   Report directory entries by invoking LIST_FUNC/BATON. 
+   Pass EXTERNAL_PARENT_URL and EXTERNAL_TARGET to LIST_FUNC when external
+   items are listed, otherwise both are set to NULL.
+ 
+   Use authentication baton cached in CTX to authenticate against the
+   repository.
+ 
+   Use POOL for all allocations.
+*/
+svn_error_t *
+svn_client__list_internal(const char *path_or_url,
+                          const svn_opt_revision_t *peg_revision,
+                          const svn_opt_revision_t *revision,
+                          svn_depth_t depth,
+                          apr_uint32_t dirent_fields,
+                          svn_boolean_t fetch_locks,
+                          svn_boolean_t include_externals,
+                          const char *external_parent_url,
+                          const char *external_target,
+                          svn_client_list_func2_t list_func,
+                          void *baton,
+                          svn_client_ctx_t *ctx,
+                          apr_pool_t *pool);
+
+/* ---------------------------------------------------------------- */
+
 /*** Inheritable Properties ***/
 
 /* Fetch the inherited properties for the base of LOCAL_ABSPATH as well
@@ -628,17 +681,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 +953,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
@@ -1024,6 +1087,22 @@ svn_client__do_external_status(svn_clien
                                void *status_baton,
                                apr_pool_t *pool);
 
+
+/* List external items defined on each external in EXTERNALS, a const char *
+   externals_parent_url(url of the directory which has the externals
+   definitions) of all externals mapping to the svn_string_t * externals_desc
+   (externals description text). All other options are the same as those 
+   passed to svn_client_list(). */
+svn_error_t * 
+svn_client__list_externals(apr_hash_t *externals, 
+                           svn_depth_t depth,
+                           apr_uint32_t dirent_fields,
+                           svn_boolean_t fetch_locks,
+                           svn_client_list_func2_t list_func,
+                           void *baton,
+                           svn_client_ctx_t *ctx,
+                           apr_pool_t *scratch_pool);
+
 /* Baton for svn_client__dirent_fetcher */
 struct svn_client__dirent_fetcher_baton_t
 {

Modified: subversion/branches/wc-collate-path/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/commit.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/commit.c Tue Dec  4 15:35:13 2012
@@ -79,8 +79,9 @@ typedef struct import_ctx_t
   /* Collection of all possible configuration file dictated auto-props and
      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;
 
@@ -287,7 +288,7 @@ import_file(const svn_delta_editor_t *ed
 
 /* 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.
@@ -298,7 +299,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,
@@ -359,7 +360,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;
@@ -392,8 +394,9 @@ import_dir(const svn_delta_editor_t *edi
            const char *edit_path,
            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,
@@ -412,8 +415,9 @@ import_children(const char *dir_abspath,
                 void *dir_baton,
                 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,
@@ -455,7 +459,7 @@ import_children(const char *dir_abspath,
 
           SVN_ERR(import_dir(editor, dir_baton, this_abspath,
                              this_edit_path, depth_below_here, excludes,
-                             mandatory_ignores, no_ignore,
+                             global_ignores, no_ignore, no_autoprops,
                              ignore_unknown_node_types, filter_callback,
                              filter_baton, import_ctx, ctx, iterpool));
         }
@@ -508,7 +512,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
@@ -528,8 +532,9 @@ import_dir(const svn_delta_editor_t *edi
            const char *edit_path,
            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,
@@ -538,16 +543,11 @@ import_dir(const svn_delta_editor_t *edi
            apr_pool_t *pool)
 {
   apr_hash_t *dirents;
-  apr_array_header_t *ignores = NULL;
   void *this_dir_baton;
 
   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. */
@@ -578,8 +578,8 @@ import_dir(const svn_delta_editor_t *edi
 
   /* Now import the children recursively. */
   SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
-                          this_dir_baton, depth, excludes, mandatory_ignores,
-                          no_ignore, ignore_unknown_node_types,
+                          this_dir_baton, depth, excludes, global_ignores,
+                          no_ignore, no_autoprops, ignore_unknown_node_types,
                           filter_callback, filter_baton,
                           import_ctx, ctx, pool));
 
@@ -621,7 +621,7 @@ import_dir(const svn_delta_editor_t *edi
  * 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
+ * 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.
  *
@@ -647,8 +647,9 @@ 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,
@@ -656,7 +657,6 @@ import(const char *local_abspath,
        apr_pool_t *pool)
 {
   void *root_baton;
-  apr_array_header_t *ignores = NULL;
   apr_array_header_t *batons = NULL;
   const char *edit_path = "";
   import_ctx_t *import_ctx = apr_pcalloc(pool, sizeof(*import_ctx));
@@ -724,12 +724,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, root_baton, local_abspath, edit_path,
                             dirent, import_ctx, ctx, pool));
@@ -738,38 +736,21 @@ 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, edit_path, dirents, editor,
-                              root_baton, depth, excludes, mandatory_ignores,
-                              no_ignore, ignore_unknown_node_types,
-                              filter_callback, filter_baton,
-                              import_ctx, ctx, pool));
+                              root_baton, depth, excludes, global_ignores,
+                              no_ignore, no_autoprops,
+                              ignore_unknown_node_types, filter_callback,
+                              filter_baton, import_ctx, ctx, pool));
 
     }
   else if (dirent->kind == svn_node_none
@@ -890,6 +871,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,
@@ -913,9 +895,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;
 
@@ -1031,24 +1012,41 @@ svn_client_import5(const char *path,
 
   /* 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);
+            }
         }
     }
 
@@ -1056,11 +1054,13 @@ svn_client_import5(const char *path,
      the error.  We don't even care if the abort itself fails.  */
   if ((err = import(local_abspath, new_entries, editor, edit_baton,
                     depth, excludes, autoprops, local_ignores_arr,
-                    mandatory_ignores, no_ignore, ignore_unknown_node_types,
-                    filter_callback, filter_baton, ctx, iterpool)))
-    {
-      svn_error_clear(editor->abort_edit(edit_baton, iterpool));
-      return svn_error_trace(err);
+                    global_ignores, no_ignore, no_autoprops,
+                    ignore_unknown_node_types, filter_callback,
+                    filter_baton, ctx, iterpool)))
+    {
+      return svn_error_compose_create(
+                    err,
+                    editor->abort_edit(edit_baton, iterpool));
     }
 
   svn_pool_destroy(iterpool);

Modified: subversion/branches/wc-collate-path/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/copy.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/copy.c Tue Dec  4 15:35:13 2012
@@ -1152,8 +1152,9 @@ repos_to_repos_copy(const apr_array_head
   if (err)
     {
       /* At least try to abort the edit (and fs txn) before throwing err. */
-      svn_error_clear(editor->abort_edit(edit_baton, pool));
-      return svn_error_trace(err);
+      return svn_error_compose_create(
+                    err,
+                    editor->abort_edit(edit_baton, pool));
     }
 
   /* Close the edit. */

Modified: subversion/branches/wc-collate-path/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/deprecated.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/deprecated.c Tue Dec  4 15:35:13 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,
@@ -1269,6 +1282,77 @@ svn_client_export(svn_revnum_t *result_r
 }
 
 /*** From list.c ***/
+
+/* Baton for use with wrap_list_func */
+struct list_func_wrapper_baton {
+    void *list_func1_baton;
+    svn_client_list_func_t list_func1;
+};
+
+/* This implements svn_client_list_func2_t */
+static svn_error_t *
+list_func_wrapper(void *baton,
+                  const char *path,
+                  const svn_dirent_t *dirent,
+                  const svn_lock_t *lock,
+                  const char *abs_path,
+                  const char *external_parent_url,
+                  const char *external_target,
+                  apr_pool_t *scratch_pool)
+{
+  struct list_func_wrapper_baton *lfwb = baton;
+
+  if (lfwb->list_func1)
+    return lfwb->list_func1(lfwb->list_func1_baton, path, dirent, 
+                           lock, abs_path, scratch_pool);
+
+  return SVN_NO_ERROR;
+}
+
+/* Helper function for svn_client_list2().  It wraps old format baton
+   and callback function in list_func_wrapper_baton and
+   returns new baton and callback to use with svn_client_list3(). */
+static void
+wrap_list_func(svn_client_list_func2_t *list_func2,
+               void **list_func2_baton,
+               svn_client_list_func_t list_func,
+               void *baton,
+               apr_pool_t *result_pool)
+{
+  struct list_func_wrapper_baton *lfwb = apr_palloc(result_pool, 
+                                                    sizeof(*lfwb));
+
+  /* Set the user provided old format callback in the baton. */
+  lfwb->list_func1_baton = baton;
+  lfwb->list_func1 = list_func;
+
+  *list_func2_baton = lfwb;
+  *list_func2 = list_func_wrapper;
+}
+
+svn_error_t *
+svn_client_list2(const char *path_or_url,
+                 const svn_opt_revision_t *peg_revision,
+                 const svn_opt_revision_t *revision,
+                 svn_depth_t depth,
+                 apr_uint32_t dirent_fields,
+                 svn_boolean_t fetch_locks,
+                 svn_client_list_func_t list_func,
+                 void *baton,
+                 svn_client_ctx_t *ctx,
+                 apr_pool_t *pool)
+{
+  svn_client_list_func2_t list_func2;
+  void *list_func2_baton;
+
+  wrap_list_func(&list_func2, &list_func2_baton, list_func, baton, pool);
+
+  return svn_client_list3(path_or_url, peg_revision, revision, depth, 
+                          dirent_fields, fetch_locks, 
+                          FALSE /* include externals */,
+                          list_func2, list_func2_baton, ctx, pool);
+}
+
 svn_error_t *
 svn_client_list(const char *path_or_url,
                 const svn_opt_revision_t *peg_revision,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/diff.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/diff.c Tue Dec  4 15:35:13 2012
@@ -52,134 +52,19 @@
 #include "client.h"
 
 #include "private/svn_wc_private.h"
+#include "private/svn_diff_private.h"
 
 #include "svn_private_config.h"
 
 
-/*
- * Constant separator strings
- */
-static const char equal_string[] =
-  "===================================================================";
-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 +433,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)
     {
@@ -588,8 +471,8 @@ display_prop_diffs(const apr_array_heade
 
       SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
                                           "Index: %s" APR_EOL_STR
-                                          "%s" APR_EOL_STR,
-                                          path, equal_string));
+                                          SVN_DIFF__EQUAL_STRING APR_EOL_STR,
+                                          path));
 
       if (use_git_diff_format)
         SVN_ERR(print_git_diff_header(outstream, &label1, &label2,
@@ -598,11 +481,10 @@ display_prop_diffs(const apr_array_heade
                                       SVN_INVALID_REVNUM,
                                       encoding, pool));
 
-      SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
-                                          "--- %s" APR_EOL_STR
-                                          "+++ %s" APR_EOL_STR,
-                                          label1,
-                                          label2));
+      /* --- label1
+       * +++ label2 */
+      SVN_ERR(svn_diff__unidiff_write_header(
+        outstream, encoding, label1, label2, pool));
     }
 
   SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
@@ -612,107 +494,11 @@ display_prop_diffs(const apr_array_heade
                                       APR_EOL_STR));
 
   SVN_ERR(svn_stream_printf_from_utf8(outstream, encoding, pool,
-                                      "%s" APR_EOL_STR, under_string));
+                                      SVN_DIFF__UNDER_STRING APR_EOL_STR));
 
-  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;
 }
@@ -959,7 +745,9 @@ diff_content_changed(const char *path,
       /* Print out the diff header. */
       SVN_ERR(svn_stream_printf_from_utf8(outstream,
                diff_cmd_baton->header_encoding, subpool,
-               "Index: %s" APR_EOL_STR "%s" APR_EOL_STR, path, equal_string));
+               "Index: %s" APR_EOL_STR
+               SVN_DIFF__EQUAL_STRING APR_EOL_STR,
+               path));
 
       /* ### Print git diff headers. */
 
@@ -1007,7 +795,9 @@ diff_content_changed(const char *path,
       /* Print out the diff header. */
       SVN_ERR(svn_stream_printf_from_utf8(outstream,
                diff_cmd_baton->header_encoding, subpool,
-               "Index: %s" APR_EOL_STR "%s" APR_EOL_STR, path, equal_string));
+               "Index: %s" APR_EOL_STR
+               SVN_DIFF__EQUAL_STRING APR_EOL_STR,
+               path));
 
       /* ### Do we want to add git diff headers here too? I'd say no. The
        * ### 'Index' and '===' line is something subversion has added. The rest
@@ -1062,8 +852,9 @@ diff_content_changed(const char *path,
           /* Print out the diff header. */
           SVN_ERR(svn_stream_printf_from_utf8(outstream,
                    diff_cmd_baton->header_encoding, subpool,
-                   "Index: %s" APR_EOL_STR "%s" APR_EOL_STR,
-                   path, equal_string));
+                   "Index: %s" APR_EOL_STR
+                   SVN_DIFF__EQUAL_STRING APR_EOL_STR,
+                   path));
 
           if (diff_cmd_baton->use_git_diff_format)
             {
@@ -1270,8 +1061,9 @@ diff_file_deleted(svn_wc_notify_state_t 
     {
       SVN_ERR(svn_stream_printf_from_utf8(diff_cmd_baton->outstream,
                 diff_cmd_baton->header_encoding, scratch_pool,
-                "Index: %s (deleted)" APR_EOL_STR "%s" APR_EOL_STR,
-                path, equal_string));
+                "Index: %s (deleted)" APR_EOL_STR
+                SVN_DIFF__EQUAL_STRING APR_EOL_STR,
+                path));
     }
   else
     {

Modified: subversion/branches/wc-collate-path/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/export.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/export.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/export.c Tue Dec  4 15:35:13 2012
@@ -677,7 +677,9 @@ window_handler(svn_txdelta_window_t *win
   if (err)
     {
       /* We failed to apply the patch; clean up the temporary file.  */
-      svn_error_clear(svn_io_remove_file2(hb->tmppath, TRUE, hb->pool));
+      err = svn_error_compose_create(
+                    err,
+                    svn_io_remove_file2(hb->tmppath, TRUE, hb->pool));
     }
 
   return svn_error_trace(err);
@@ -905,6 +907,47 @@ fetch_base_func(const char **filename,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+get_editor(const svn_delta_editor_t **export_editor,
+           void **edit_baton,
+           struct edit_baton *eb,
+           svn_client_ctx_t *ctx,
+           apr_pool_t *result_pool,
+           apr_pool_t *scratch_pool)
+{
+  svn_delta_editor_t *editor = svn_delta_default_editor(result_pool);
+  svn_delta_shim_callbacks_t *shim_callbacks =
+                            svn_delta_shim_callbacks_default(result_pool);
+  
+  editor->set_target_revision = set_target_revision;
+  editor->open_root = open_root;
+  editor->add_directory = add_directory;
+  editor->add_file = add_file;
+  editor->apply_textdelta = apply_textdelta;
+  editor->close_file = close_file;
+  editor->change_file_prop = change_file_prop;
+  editor->change_dir_prop = change_dir_prop;
+
+  SVN_ERR(svn_delta_get_cancellation_editor(ctx->cancel_func,
+                                            ctx->cancel_baton,
+                                            editor,
+                                            eb,
+                                            export_editor,
+                                            edit_baton,
+                                            result_pool));
+
+  shim_callbacks->fetch_kind_func = fetch_kind_func;
+  shim_callbacks->fetch_props_func = fetch_props_func;
+  shim_callbacks->fetch_base_func = fetch_base_func;
+  shim_callbacks->fetch_baton = eb;
+
+  SVN_ERR(svn_editor__insert_shims(export_editor, edit_baton,
+                                   *export_editor, *edit_baton,
+                                   NULL, NULL, shim_callbacks,
+                                   result_pool, scratch_pool));
+
+   return SVN_NO_ERROR;
+}
 
 
 /*** Public Interfaces ***/
@@ -1042,37 +1085,10 @@ svn_client_export5(svn_revnum_t *result_
           const svn_delta_editor_t *export_editor;
           const svn_ra_reporter3_t *reporter;
           void *report_baton;
-          svn_delta_editor_t *editor = svn_delta_default_editor(pool);
           svn_boolean_t use_sleep = FALSE;
-          svn_delta_shim_callbacks_t *shim_callbacks =
-                                    svn_delta_shim_callbacks_default(pool);
 
-          editor->set_target_revision = set_target_revision;
-          editor->open_root = open_root;
-          editor->add_directory = add_directory;
-          editor->add_file = add_file;
-          editor->apply_textdelta = apply_textdelta;
-          editor->close_file = close_file;
-          editor->change_file_prop = change_file_prop;
-          editor->change_dir_prop = change_dir_prop;
-
-          SVN_ERR(svn_delta_get_cancellation_editor(ctx->cancel_func,
-                                                    ctx->cancel_baton,
-                                                    editor,
-                                                    eb,
-                                                    &export_editor,
-                                                    &edit_baton,
-                                                    pool));
-
-          shim_callbacks->fetch_kind_func = fetch_kind_func;
-          shim_callbacks->fetch_props_func = fetch_props_func;
-          shim_callbacks->fetch_base_func = fetch_base_func;
-          shim_callbacks->fetch_baton = eb;
-
-          SVN_ERR(svn_editor__insert_shims(&export_editor, &edit_baton,
-                                           export_editor, edit_baton,
-                                           NULL, NULL, shim_callbacks,
-                                           pool, pool));
+          SVN_ERR(get_editor(&export_editor, &edit_baton, eb, ctx,
+                             pool, pool));
 
           /* Manufacture a basic 'report' to the update reporter. */
           SVN_ERR(svn_ra_do_update2(ra_session,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_client/externals.c?rev=1416996&r1=1416995&r2=1416996&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_client/externals.c Tue Dec  4 15:35:13 2012
@@ -1180,3 +1180,105 @@ svn_client__do_external_status(svn_clien
   return SVN_NO_ERROR;
 }
 
+/* Walk through all the external items and list them. */
+static svn_error_t *
+list_external_items(apr_array_header_t *external_items,
+                    const char *externals_parent_url,
+                    svn_depth_t depth,
+                    apr_uint32_t dirent_fields,
+                    svn_boolean_t fetch_locks,
+                    svn_client_list_func2_t list_func,
+                    void *baton,
+                    svn_client_ctx_t *ctx,
+                    apr_pool_t *scratch_pool)
+{
+  const char *externals_parent_repos_root_url;
+  apr_pool_t *iterpool;
+  int i;
+
+  SVN_ERR(svn_client_get_repos_root(&externals_parent_repos_root_url, 
+                                    NULL /* uuid */,
+                                    externals_parent_url, ctx, 
+                                    scratch_pool, scratch_pool));
+
+  iterpool = svn_pool_create(scratch_pool);
+
+  for (i = 0; i < external_items->nelts; i++)
+    {
+      const char *resolved_url;
+
+      svn_wc_external_item2_t *item = 
+          APR_ARRAY_IDX(external_items, i, svn_wc_external_item2_t *);
+
+      svn_pool_clear(iterpool);
+
+      SVN_ERR(svn_wc__resolve_relative_external_url(
+                  &resolved_url, 
+                  item,
+                  externals_parent_repos_root_url,
+                  externals_parent_url,
+                  iterpool, iterpool));
+
+      /* List the external */
+      SVN_ERR(wrap_external_error(ctx, item->target_dir,
+                                  svn_client__list_internal(
+                                                resolved_url,
+                                                &item->peg_revision,
+                                                &item->revision,
+                                                depth, dirent_fields, 
+                                                fetch_locks,
+                                                TRUE,
+                                                externals_parent_url,
+                                                item->target_dir,
+                                                list_func, baton, ctx,
+                                                iterpool),
+                                  iterpool));
+    
+    }
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+      
+    
+svn_error_t * 
+svn_client__list_externals(apr_hash_t *externals, 
+                           svn_depth_t depth,
+                           apr_uint32_t dirent_fields,
+                           svn_boolean_t fetch_locks,
+                           svn_client_list_func2_t list_func,
+                           void *baton,
+                           svn_client_ctx_t *ctx,
+                           apr_pool_t *scratch_pool)
+{
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_hash_index_t *hi;
+
+  for (hi = apr_hash_first(scratch_pool, externals);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+      const char *externals_parent_url = svn__apr_hash_index_key(hi);
+      svn_string_t *externals_desc = svn__apr_hash_index_val(hi);
+      apr_array_header_t *external_items;
+
+      svn_pool_clear(iterpool);
+
+      SVN_ERR(svn_wc_parse_externals_description3(&external_items, 
+                                                  externals_parent_url,
+                                                  externals_desc->data, 
+                                                  FALSE, iterpool));
+
+      if (! external_items->nelts)
+        continue;
+
+      SVN_ERR(list_external_items(external_items, externals_parent_url, depth,
+                                  dirent_fields, fetch_locks, list_func,
+                                  baton, ctx, iterpool));
+
+    }
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+