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 2010/11/04 21:48:30 UTC

svn commit: r1031230 [3/21] - in /subversion/branches/py-tests-as-modules: ./ build/ build/ac-macros/ build/win32/ contrib/client-side/ notes/ notes/http-and-webdav/ notes/wc-ng/ subversion/bindings/ctypes-python/csvn/ subversion/bindings/javahl/native...

Modified: subversion/branches/py-tests-as-modules/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/include/svn_repos.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/include/svn_repos.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/include/svn_repos.h Thu Nov  4 20:48:21 2010
@@ -1994,28 +1994,55 @@ svn_repos_fs_get_locks(apr_hash_t **lock
 /** @} */
 
 /**
- * Like svn_fs_change_rev_prop(), but validate the name and value of the
+ * Like svn_fs_change_rev_prop2(), but validate the name and value of the
  * property and invoke the @a repos's pre- and post-revprop-change hooks
  * around the change as specified by @a use_pre_revprop_change_hook and
  * @a use_post_revprop_change_hook (respectively).
  *
  * @a rev is the revision whose property to change, @a name is the
  * name of the property, and @a new_value is the new value of the
- * property.   @a author is the authenticated username of the person
+ * property.   If @a old_value_p is not @c NULL, then @a *old_value_p
+ * is the expected current (preexisting) value of the property (or @c NULL
+ * for "unset").  @a author is the authenticated username of the person
  * changing the property value, or NULL if not available.
  *
  * If @a authz_read_func is non-NULL, then use it (with @a
  * authz_read_baton) to validate the changed-paths associated with @a
  * rev.  If the revision contains any unreadable changed paths, then
- * return SVN_ERR_AUTHZ_UNREADABLE.
+ * return #SVN_ERR_AUTHZ_UNREADABLE.
  *
  * Validate @a name and @a new_value like the same way
  * svn_repos_fs_change_node_prop() does.
  *
  * Use @a pool for temporary allocations.
  *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_repos_fs_change_rev_prop4(svn_repos_t *repos,
+                              svn_revnum_t rev,
+                              const char *author,
+                              const char *name,
+                              const svn_string_t *const *old_value_p,
+                              const svn_string_t *new_value,
+                              svn_boolean_t
+                              use_pre_revprop_change_hook,
+                              svn_boolean_t
+                              use_post_revprop_change_hook,
+                              svn_repos_authz_func_t
+                              authz_read_func,
+                              void *authz_read_baton,
+                              apr_pool_t *pool);
+
+/**
+ * Similar to svn_repos_fs_change_rev_prop4(), but with @a old_value_p always
+ * set to @c NULL.  (In other words, it is similar to
+ * svn_fs_change_rev_prop().)
+ *
+ * @deprecated Provided for backward compatibility with the 1.6 API.
  * @since New in 1.5.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_repos_fs_change_rev_prop3(svn_repos_t *repos,
                               svn_revnum_t rev,
@@ -2529,7 +2556,7 @@ svn_repos_load_fs2(svn_repos_t *repos,
  * Similar to svn_repos_load_fs2(), but with @a use_pre_commit_hook and
  * @a use_post_commit_hook always @c FALSE.
  *
- * @deprecated Provided for backward compatibility with the 1.0 API.
+ * @deprecated Provided for backward compatibility with the 1.1 API.
  */
 SVN_DEPRECATED
 svn_error_t *

Modified: subversion/branches/py-tests-as-modules/subversion/include/svn_string.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/include/svn_string.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/include/svn_string.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/include/svn_string.h Thu Nov  4 20:48:21 2010
@@ -199,7 +199,7 @@ svn_stringbuf_ncreate(const char *bytes,
 /** Create a new empty bytestring with at least @a minimum_size bytes of
  * space available in the memory block.
  *
- * The allocated string buffer will be one byte larger then @a minimum_size
+ * The allocated string buffer will be one byte larger than @a minimum_size
  * to account for a final '\\0'.
  *
  * @since New in 1.6.
@@ -254,6 +254,10 @@ void
 svn_stringbuf_fillchar(svn_stringbuf_t *str, unsigned char c);
 
 /** Append a single character @a byte onto @a targetstr.
+ * This is an optimized version of @ref 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
+ * register pressure allows for more optimization within the caller.
  *
  * reallocs if necessary. @a targetstr is affected, nothing else is.
  * @since New in 1.7.

Modified: subversion/branches/py-tests-as-modules/subversion/include/svn_subst.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/include/svn_subst.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/include/svn_subst.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/include/svn_subst.h Thu Nov  4 20:48:21 2010
@@ -209,23 +209,12 @@ svn_subst_keywords_differ(const svn_subs
  * @c TRUE, convert any line ending in @a src_stream to @a eol_str in
  * @a dst_stream.  Recognized line endings are: "\n", "\r", and "\r\n".
  *
- * Expand and contract keywords using the contents of @a keywords as the
- * new values.  If @a expand is @c TRUE, expand contracted keywords and
- * re-expand expanded keywords.  If @a expand is @c FALSE, contract expanded
- * keywords and ignore contracted ones.  Keywords not found in the hash are
- * ignored (not contracted or expanded).  If the @a keywords hash
- * itself is @c NULL, keyword substitution will be altogether ignored.
- *
- * Detect only keywords that are no longer than @c SVN_KEYWORD_MAX_LEN
- * bytes, including the delimiters and the keyword itself.
+ * See svn_subst_stream_translated() for details of the keyword substitution
+ * which is controlled by the @a expand and @a keywords parameters.
  *
  * Note that a translation request is *required*:  one of @a eol_str or
  * @a keywords must be non-@c NULL.
  *
- * Recommendation: if @a expand is FALSE, then you don't care about the
- * keyword values, so use empty strings as non-NULL signifiers when you
- * build the keywords hash.
- *
  * Notes:
  *
  * See svn_wc__get_keywords() and svn_wc__get_eol_style() for a
@@ -301,6 +290,20 @@ svn_subst_translate_stream(svn_stream_t 
  * if @a repair is @c TRUE, convert any line ending to @a eol_str.
  * Recognized line endings are: "\n", "\r", and "\r\n".
  *
+ * Expand and contract keywords using the contents of @a keywords as the
+ * new values.  If @a expand is @c TRUE, expand contracted keywords and
+ * re-expand expanded keywords.  If @a expand is @c FALSE, contract expanded
+ * keywords and ignore contracted ones.  Keywords not found in the hash are
+ * ignored (not contracted or expanded).  If the @a keywords hash
+ * itself is @c NULL, keyword substitution will be altogether ignored.
+ *
+ * Detect only keywords that are no longer than @c SVN_KEYWORD_MAX_LEN
+ * bytes, including the delimiters and the keyword itself.
+ *
+ * Recommendation: if @a expand is FALSE, then you don't care about the
+ * keyword values, so use empty strings as non-NULL signifiers when you
+ * build the keywords hash.
+ *
  * The stream returned is allocated in @a result_pool.
  *
  * If the inner stream implements resetting via svn_stream_reset(),
@@ -318,8 +321,8 @@ svn_subst_stream_translated(svn_stream_t
                             apr_pool_t *result_pool);
 
 
-/** Return a stream which performs eol translation and keyword
- * expansion when read from or written to.  The stream @a stream
+/** Set @a *stream to a stream which performs eol translation and keyword
+ * expansion when read from or written to.  The stream @a source
  * is used to read and write all data.  Make sure you call
  * svn_stream_close() on @a stream to make sure all data are flushed
  * and cleaned up.
@@ -345,7 +348,7 @@ svn_subst_stream_translated_to_normal_fo
                                            apr_pool_t *pool);
 
 
-/** Returns a readable stream in @a *stream containing the "normal form"
+/** Set @a *stream to a readable stream containing the "normal form"
  * of the special file located at @a path. The stream will be allocated
  * in @a result_pool, and any temporary allocations will be made in
  * @a scratch_pool.
@@ -359,7 +362,7 @@ svn_subst_read_specialfile(svn_stream_t 
                            apr_pool_t *scratch_pool);
 
 
-/** Returns a writeable stream in @a *stream that accepts content in
+/** Set @a *stream to a writeable stream that accepts content in
  * the "normal form" for a special file, to be located at @a path, and
  * will create that file when the stream is closed. The stream will be
  * allocated in @a result_pool, and any temporary allocations will be
@@ -377,8 +380,8 @@ svn_subst_create_specialfile(svn_stream_
                              apr_pool_t *scratch_pool);
 
 
-/** Returns a stream which translates the special file at @a path to
- * the internal representation for special files when read from.  When
+/** Set @a *stream to a stream which translates the special file at @a path
+ * to the internal representation for special files when read from.  When
  * written to, it does the reverse: creating a special file when the
  * stream is closed.
  *
@@ -396,17 +399,16 @@ svn_subst_stream_from_specialfile(svn_st
 
 
 /**
- * Translates the file at path @a src into a file at path @a dst.  The
- * parameters @a *eol_str, @a repair, @a *keywords and @a expand are
+ * Copy the contents of file-path @a src to file-path @a dst atomically,
+ * either creating @a dst or overwriting @a dst if it exists, possibly
+ * performing line ending and keyword translations.
+ *
+ * The parameters @a *eol_str, @a repair, @a *keywords and @a expand are
  * defined the same as in svn_subst_translate_stream3().
  *
  * In addition, it will create a special file from normal form or
  * translate one to normal form if @a special is @c TRUE.
  *
- * Copy the contents of file-path @a src to file-path @a dst atomically,
- * either creating @a dst (or overwriting @a dst if it exists), possibly
- * performing line ending and keyword translations.
- *
  * If anything goes wrong during the copy, attempt to delete @a dst (if
  * it exists).
  *
@@ -486,17 +488,19 @@ svn_subst_copy_and_translate(const char 
 
 
 /**
- * Convenience routine: a variant of svn_subst_translate_stream3() which
- * operates on cstrings.
+ * Set @a *dst to a copy of the string @a src, possibly performing line
+ * ending and keyword translations.
  *
- * @since New in 1.3.
- *
- * Return a new string in @a *dst, allocated in @a pool, by copying the
- * contents of string @a src, possibly performing line ending and keyword
- * translations.
+ * This is a variant of svn_subst_translate_stream3() that operates on
+ * cstrings.  @see svn_subst_stream_translated() for details of the
+ * translation and of @a eol_str, @a repair, @a keywords and @a expand.
  *
  * If @a eol_str and @a keywords are @c NULL, behavior is just a byte-for-byte
  * copy.
+ *
+ * Allocate @a *dst in @a pool.
+ *
+ * @since New in 1.3.
  */
 svn_error_t *
 svn_subst_translate_cstring2(const char *src,
@@ -524,7 +528,7 @@ svn_subst_translate_cstring(const char *
                             apr_pool_t *pool);
 
 /**
- * Translates a file @a src in working copy form to a file @a dst in
+ * Translate the file @a src in working copy form to a file @a dst in
  * normal form.
  *
  * The values specified for @a eol_style, @a *eol_str, @a keywords and
@@ -588,20 +592,26 @@ svn_subst_stream_detranslated(svn_stream
 
 /* EOL conversion and character encodings */
 
-/** Translate the data in @a value (assumed to be in encoded in charset
- * @a encoding) to UTF8 and LF line-endings.  If @a encoding is @c NULL,
- * then assume that @a value is in the system-default language encoding.
- * Return the translated data in @a *new_value, allocated in @a pool.
+/** Translate the string @a value from character encoding @a encoding to
+ * UTF8, and also from its current line-ending style to LF line-endings.  If
+ * @a encoding is @c NULL, translate from the system-default encoding.
+ *
+ * Recognized line endings are LF, CR, CRLF.  If @a value has inconsistent
+ * line endings, return @c SVN_ERR_IO_INCONSISTENT_EOL.
+ *
+ * Set @a *new_value to the translated string, allocated in @a pool.
  */
 svn_error_t *svn_subst_translate_string(svn_string_t **new_value,
                                         const svn_string_t *value,
                                         const char *encoding,
                                         apr_pool_t *pool);
 
-/** Translate the data in @a value from UTF8 and LF line-endings into
- * native locale and native line-endings, or to the output locale if
- * @a for_output is TRUE.  Return the translated data in @a
- * *new_value, allocated in @a pool.
+/** Translate the string @a value from UTF8 and LF line-endings into native
+ * character encoding and native line-endings.  If @a for_output is TRUE,
+ * translate to the character encoding of the output locale, else to that of
+ * the default locale.
+ *
+ * Set @a *new_value to the translated string, allocated in @a pool.
  */
 svn_error_t *svn_subst_detranslate_string(svn_string_t **new_value,
                                           const svn_string_t *value,

Modified: subversion/branches/py-tests-as-modules/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/include/svn_types.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/include/svn_types.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/include/svn_types.h Thu Nov  4 20:48:21 2010
@@ -132,12 +132,15 @@ void *
 svn__apr_hash_index_val(const apr_hash_index_t *hi);
 
 /** On Windows, APR_STATUS_IS_ENOTDIR includes several kinds of
- * invalid-pathname error but not this one, so we include it. */
-/* ### This fix should go into APR. */
+ * invalid-pathname error but not ERROR_INVALID_NAME, so we include it.
+ * We also include ERROR_DIRECTORY as that was not included in apr versions
+ * before 1.4.0 and this fix is not backported */
+/* ### These fixes should go into APR. */
 #ifndef WIN32
 #define SVN__APR_STATUS_IS_ENOTDIR(s)  APR_STATUS_IS_ENOTDIR(s)
 #else
 #define SVN__APR_STATUS_IS_ENOTDIR(s)  (APR_STATUS_IS_ENOTDIR(s) \
+                      || ((s) == APR_OS_START_SYSERR + ERROR_DIRECTORY) \
                       || ((s) == APR_OS_START_SYSERR + ERROR_INVALID_NAME))
 #endif
 
@@ -178,13 +181,16 @@ svn_node_kind_to_word(svn_node_kind_t ki
 svn_node_kind_t
 svn_node_kind_from_word(const char *word);
 
-/** Generic three-state property to represent an unknown value for values that
- * are just like booleans. @since New in 1.7. */
+/** Generic three-state property to represent an unknown value for values
+ * that are just like booleans.  The values have been set deliberately to
+ * make tristates mainly compatible with #svn_boolean_t.
+ *
+ * @since New in 1.7. */
 typedef enum
 {
-  svn_tristate_unknown = 0,
-  svn_tristate_false,
-  svn_tristate_true
+  svn_tristate_false = FALSE,
+  svn_tristate_true = TRUE,
+  svn_tristate_unknown
 } svn_tristate_t;
 
 /** Return a constant string "true", "false" or NULL representing the value of

Modified: subversion/branches/py-tests-as-modules/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/include/svn_wc.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/include/svn_wc.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/include/svn_wc.h Thu Nov  4 20:48:21 2010
@@ -1258,10 +1258,12 @@ typedef struct svn_wc_notify_t {
    * hunk the notification is for. They are line-based
    * offsets and lengths parsed from the unidiff hunk header.
    * @since New in 1.7. */
+  /* @{ */
   svn_linenum_t hunk_original_start;
   svn_linenum_t hunk_original_length;
   svn_linenum_t hunk_modified_start;
   svn_linenum_t hunk_modified_length;
+  /* @} */
 
   /** The line at which a hunk was matched (and applied).
    * @since New in 1.7. */
@@ -1556,199 +1558,6 @@ svn_wc_conflict_version_t *
 svn_wc_conflict_version_dup(const svn_wc_conflict_version_t *version,
                             apr_pool_t *pool);
 
-
-/** An opaque structure that describes a conflict that has occurred on a
- * specific target in a working copy. Passed to the conflict helper
- * functions and to #svn_wc_conflict_resolver_func2_t when performing
- * interactive conflict resolving.
- *
- * @since New in 1.7.
- */
- /* ### We use svn_wc_conflict_t as non constant to allow delayloading
-        values. */
-typedef struct svn_wc_conflict_t svn_wc_conflict_t;
-
-/** Duplicates a @a base conflict, to a @a duplicate conflict, allocated
- * in @a result_pool.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_conflict_dup(svn_wc_conflict_t **duplicate,
-                    const svn_wc_conflict_t *base,
-                    apr_pool_t *result_pool);
-
-/** Read information about @a conflict, as it applies to @a local_abspath
- * in @a wc_ctx.
- *
- * If @a kind is not NULL, retrieves the kind of conflict.
- *
- * If @a property_name is not NULL, retrieves the name of the property
- * where this conflict applies to. @a property_name is NULL, when this
- * information is not available. (This information is not always recorded).
- *
- * If @a action is not NULL, retrieves the action that raised the conflict
- * or #svn_wc_conflict_action_edit if no action was recorded.
- *
- * If @a reason is not NULL, retrieves the reason why the conflict was
- * raised or #svn_wc_conflict_reason_t if no reason was recorded.
- *
- * If @a operation is not NULL, retrieves the operation that was performed
- * when the conflict was raised or #svn_wc_operation_none if no operation
- * was recorded.
- *
- * If @a conflict_resolved is not NULL, conflict type specific checks are
- * performed to see if this conflict is resolved. (E.g. for file and property
- * conflicts the marker and rejection files are tested for availablity).
- * If the conflict is resolved sets @a *conflict_resolved to TRUE, otherwise
- * to FALSE.
- *
- * @since New in 1.7.
- */
-/* ### Separate in more methods like the WC-1.0 api, or add more
-       to remove other apis, like we do in WC-NG? */
-svn_error_t *
-svn_wc_get_conflict_info(svn_wc_conflict_kind_t *kind,
-                         const char **property_name,
-                         svn_wc_conflict_action_t *action,
-                         svn_wc_conflict_reason_t *reason,
-                         svn_wc_operation_t *operation,
-                         svn_boolean_t *conflict_resolved,
-                         svn_wc_context_t *wc_ctx,
-                         const char *local_abspath,
-                         svn_wc_conflict_t *conflict,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool);
-
-/** Retrieves the conflict marker file locations recorded in @a conflict,
- * as it applies to @a local_abspath in @a wc_ctx.
- *
- * For text and property conflicts older is the BASE version, left the MINE
- * version and right the THEIRS version. Depending on the type of conflict,
- * some or all of these values might be NULL.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_get_conflict_marker_files(const char **older_abspath,
-                                 const char **left_abspath,
-                                 const char **right_abspath,
-                                 svn_wc_context_t *wc_ctx,
-                                 const char *local_abspath,
-                                 svn_wc_conflict_t *conflict,
-                                 apr_pool_t *result_pool,
-                                 apr_pool_t *scratch_pool);
-
-/** Retrieves the origin of the conflict recorded in @a conflict, as it
- * applies to @a local_abspath in @a wc_ctx.
- *
- * For text and property conflicts older is the BASE version, left the MINE
- * version and right the THEIRS version. Depending on the type of conflict,
- * some or all of these values might be NULL.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_get_conflict_sources(const svn_wc_conflict_version_t **older_version,
-                            const svn_wc_conflict_version_t **left_version,
-                            const svn_wc_conflict_version_t **right_version,
-                            svn_wc_context_t *wc_ctx,
-                            const char *local_abspath,
-                            svn_wc_conflict_t *conflict,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool);
-
-/** Retrieves the values of the conflicted property recorded in @a
- * conflict, as it applies to @a local_abspath in @a wc_ctx.
- *
- * If @a older_value, @a left_value and/or @a right_value are not NULL,
- * retrieves this property value as recorded in the conflict data. A
- * returned NULL indicates that the property was not available in that
- * version. (If #svn_wc_get_conflict_info doesn't provide a property
- * name, no property data was recorded in the property conflict)
- *
- * For property conflicts older is the BASE version, left the MINE
- * version and right the THEIRS version.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_get_property_conflict_data(const svn_string_t **older_value,
-                                  const svn_string_t **left_value,
-                                  const svn_string_t **right_value,
-                                  svn_wc_context_t *wc_ctx,
-                                  const char *local_abspath,
-                                  svn_wc_conflict_t *conflict,
-                                  apr_pool_t *result_pool,
-                                  apr_pool_t *scratch_pool);
-
-/** Creates a new property conflict, recording the passed values.
- *
- * @a property_name must be set to the conflicted property name or ""
- * if no property name is available. (Older api compatibility)
- *
- * @a older_version, @a left_version and @a right_version can be
- * NULL for compatibility with older apis.
- *
- * Iif @a property_name is not "", @a older_value, @a left_value and
- * @a right_value must be set to the values of property in these versions.
- * (which could be NULL if the property does not exist there).
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_create_property_conflict(svn_wc_conflict_t **conflict,
-                                const char *property_name,
-                                const svn_wc_conflict_version_t *older_version,
-                                const svn_wc_conflict_version_t *left_version,
-                                const svn_wc_conflict_version_t *right_version,
-                                const svn_string_t *older_value,
-                                const svn_string_t *left_value,
-                                const svn_string_t *right_value,
-                                const char *marker_abspath,
-                                svn_wc_operation_t operation,
-                                apr_pool_t *result_pool,
-                                apr_pool_t *scratch_pool);
-
-/** Creates a new text conflict, recording the passed values.
- *
- * @a older_version, @a left_version and @a right_version can be NULL,
- * for compatibility with older apis.
- *
- * @a older_abspath, @a left_abspath and @a right_abspath can be NULL,
- * @a indicating that the file did not exist in that version.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_create_text_conflict(svn_wc_conflict_t **conflict,
-                            const svn_wc_conflict_version_t *older_version,
-                            const svn_wc_conflict_version_t *left_version,
-                            const svn_wc_conflict_version_t *right_version,
-                            const char *older_abspath,
-                            const char *left_abspath,
-                            const char *right_abspath,
-                            svn_wc_operation_t operation,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool);
-
-/** Creates a new tree conflict @a conflict, recording the passed values.
- * All values except @a older_version must be non-NULL. @a older_version
- * can be NULL for backwards compatibility with older apis.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_create_tree_conflict(svn_wc_conflict_t **conflict,
-                            const svn_wc_conflict_version_t *older_version,
-                            const svn_wc_conflict_version_t *left_version,
-                            const svn_wc_conflict_version_t *right_version,
-                            svn_wc_conflict_action_t action,
-                            svn_wc_conflict_reason_t reason,
-                            svn_wc_operation_t operation,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool);
-
 /** A struct that describes a conflict that has occurred in the
  * working copy.
  *
@@ -3297,6 +3106,7 @@ svn_wc_walk_entries3(const char *path,
  * or error handling from @a walk_callbacks, and with @a depth always
  * set to #svn_depth_infinity.
  *
+ * @since New in 1.2.
  * @deprecated Provided for backward compatibility with the 1.4 API.
  */
 SVN_DEPRECATED
@@ -3313,7 +3123,7 @@ svn_wc_walk_entries2(const char *path,
 /**
  * Similar to svn_wc_walk_entries2(), but without cancellation support.
  *
- * @deprecated Provided for backward compatibility with the 1.0 API.
+ * @deprecated Provided for backward compatibility with the 1.1 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -3986,9 +3796,11 @@ typedef void (*svn_wc_status_func_t)(voi
  * If @a cancel_func is non-NULL, call it with @a cancel_baton while walking
  * to determine if the client has cancelled the operation.
  *
- * If @a external_func is non-NULL, call it with @a external_baton if an
- * external definition is found while walking @a local_abspath.
- * ### call it with what other parameters?
+ * If @a external_func is non-NULL and an external definition is found
+ * while walking @a local_abspath, call @a external_func with @a
+ * external_baton, with the local abspath on which the definition was
+ * found, and with the current external definition provided as both
+ * the @a old_val and @a new_val parameters of the callback function.
  *
  * This function uses @a scratch_pool for temporary allocations.
  *
@@ -4124,7 +3936,7 @@ svn_wc_get_status_editor4(const svn_delt
  * instead of #svn_wc_status_func3_t.
  *
  * @since New in 1.5.
- * @deprecated Provided for backward compatibility with the 1.4 API.
+ * @deprecated Provided for backward compatibility with the 1.5 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -4227,13 +4039,13 @@ svn_wc_status_set_repos_locks(void *set_
  * is used for accessing the working copy and must contain a write lock for
  * the parent directory of @a dst_abspath,
  *
- * If metadata_only is TRUE then this a database only operation and
+ * If @a metadata_only is TRUE then this is a database-only operation and
  * the working directories and files are not copied.
  *
  * @a src_abspath must be a file or directory under version control;
  * the parent of @a dst_abspath must be a directory under version control
  * in the same working copy; @a dst_abspath will be the name of the copied
- * item, and it must not exist already if metadata_only is FALSE.  Note that
+ * item, and it must not exist already if @a metadata_only is FALSE.  Note that
  * when @a src points to a versioned file, the working file doesn't
  * necessarily exist in which case its text-base is used instead.
  *
@@ -4241,17 +4053,11 @@ svn_wc_status_set_repos_locks(void *set_
  * various points during the operation.  If it returns an error
  * (typically #SVN_ERR_CANCELLED), return that error immediately.
  *
- * For each file or directory copied, @a notify_func will be called
- * with its path and the @a notify_baton.  @a notify_func may be @c NULL
- * if you are not interested in this information.
+ * If @a notify_func is non-NULL, call it with @a notify_baton and the path
+ * of the root node (only) of the destination.
  *
  * Use @a scratch_pool for temporary allocations.
  *
- * @par Important:
- * This is a variant of svn_wc_add4().  No changes will happen
- * to the repository until a commit occurs.  This scheduling can be
- * removed with svn_client_revert4().
- *
  * @since New in 1.7.
  */
 svn_error_t *
@@ -4299,7 +4105,7 @@ svn_wc_copy(const char *src,
             apr_pool_t *pool);
 
 /**
- * Schedule @a local_abspath for deletion, it will be deleted from the
+ * Schedule @a local_abspath for deletion.  It will be deleted from the
  * repository on the next commit.  If @a local_abspath refers to a
  * directory, then a recursive deletion will occur. @a wc_ctx must hold
  * a write lock for the parent of @a local_abspath, @a local_abspath itself
@@ -4400,12 +4206,36 @@ svn_wc_delete(const char *path,
               apr_pool_t *pool);
 
 /**
+ * Schedule the single node that exists on disk at @a local_abspath for
+ * addition to the working copy.  The added node will have no properties.
+ *
+ * The versioned state of the parent path must be a modifiable directory,
+ * and the versioned state of @a local_abspath must be either nonexistent or
+ * deleted; if deleted, the new node will be a replacement.
+ *
+ * If @a local_abspath does not exist as file, directory or symlink, return
+ * #SVN_ERR_WC_PATH_NOT_FOUND.
+ *
+ * This is a replacement for svn_wc_add4() case 2a.
+ *
+ * ### TODO: Allow the caller to provide the node's properties?
+ *
+ * ### TODO: Split into add_dir, add_file, add_symlink?
+ */
+svn_error_t *
+svn_wc_add_from_disk(svn_wc_context_t *wc_ctx,
+                     const char *local_abspath,
+                     svn_wc_notify_func2_t notify_func,
+                     void *notify_baton,
+                     apr_pool_t *scratch_pool);
+
+/**
  * Put @a local_abspath under version control by registering it as addition
  * or copy in the database containing its parent. The new node is scheduled
  * for addition to the repository below its parent node.
  *
- * 1) If the node already exists, it MUST BE the root of a separate working
- * copy from the same repository as the parent working copy. The new node
+ * 1) If the node is already versioned, it MUST BE the root of a separate
+ * working copy from the same repository as the parent WC. The new node
  * and anything below it will be scheduled for addition inside the parent
  * working copy as a copy of the original location. The separate working
  * copy will be integrated by this step. In this case, which is only used
@@ -4418,7 +4248,7 @@ svn_wc_delete(const char *path,
  * of that location. In this last case the function doesn't set the pristine
  * version (of a file) and/or pristine properties, which callers should
  * handle via different APIs. Usually it is easier to call
- * svn_wc_add_repos_file4() (### or a possible svn_wc_add_repos_dir()) then
+ * svn_wc_add_repos_file4() (### or a possible svn_wc_add_repos_dir()) than
  * using this variant.
  *
  * If @a local_abspath does not exist as file, directory or symlink, return
@@ -4436,6 +4266,9 @@ svn_wc_delete(const char *path,
  * When the @a local_abspath has been added, then @a notify_func will be
  * called (if it is not @c NULL) with the @a notify_baton and the path.
  *
+ * @note Case 1 is deprecated. Consider doing a WC-to-WC copy instead.
+ * @note For case 2a, prefer svn_wc_add_from_disk().
+ *
  * @since New in 1.7.
  */
 svn_error_t *
@@ -4535,8 +4368,6 @@ svn_wc_add(const char *path,
  *
  * Use @a scratch_pool for temporary allocations.
  *
- * ### NOTE: the notification callback/baton is not yet used.
- *
  * ### This function is very redundant with svn_wc_add().  Ideally,
  * we'd merge them, so that svn_wc_add() would just take optional
  * new_props and optional copyfrom information.  That way it could be
@@ -4562,13 +4393,13 @@ svn_wc_add_repos_file4(svn_wc_context_t 
                        svn_revnum_t copyfrom_rev,
                        svn_cancel_func_t cancel_func,
                        void *cancel_baton,
-                       svn_wc_notify_func2_t notify_func,
-                       void *notify_baton,
                        apr_pool_t *scratch_pool);
 
 /** Similar to svn_wc_add_repos_file4, but uses access batons and a
  * relative path instead of a working copy context and absolute path.
  *
+ * ### NOTE: the notification callback/baton is not yet used.
+ *
  * @since New in 1.6.
  * @deprecated Provided for compatibility with the 1.6 API.
  */
@@ -4778,6 +4609,7 @@ svn_wc_resolved_conflict4(const char *pa
  * Similar to svn_wc_resolved_conflict4(), but without tree-conflict
  * resolution support.
  *
+ * @since New in 1.5.
  * @deprecated Provided for backward compatibility with the 1.5 API.
  */
 SVN_DEPRECATED
@@ -4801,6 +4633,7 @@ svn_wc_resolved_conflict3(const char *pa
  * if @a recurse is TRUE, @a depth is #svn_depth_infinity, else it is
  * #svn_depth_files.
  *
+ * @since New in 1.2.
  * @deprecated Provided for backward compatibility with the 1.4 API.
  */
 SVN_DEPRECATED
@@ -4820,7 +4653,7 @@ svn_wc_resolved_conflict2(const char *pa
  * Similar to svn_wc_resolved_conflict2(), but takes an
  * svn_wc_notify_func_t and doesn't have cancellation support.
  *
- * @deprecated Provided for backward compatibility with the 1.0 API.
+ * @deprecated Provided for backward compatibility with the 1.1 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -4992,8 +4825,7 @@ svn_wc_process_committed_queue2(svn_wc_c
 /** @see svn_wc_process_committed_queue2()
  *
  * @since New in 1.5.
- *
- * @deprecated Provided for backwards compatibility with the 1.5 API.
+ * @deprecated Provided for backwards compatibility with the 1.6 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -5093,7 +4925,6 @@ svn_wc_process_committed(const char *pat
  *
  * No locks or logs are created, nor are any animals harmed in the
  * process unless @a restore_files is TRUE.  No cleanup is necessary.
- * The working copy is accessed using @a wc_ctx.
  *
  * After all revisions are reported, @a reporter->finish_report() is
  * called, which immediately causes the RA layer to update the working
@@ -5254,7 +5085,7 @@ svn_wc_crawl_revisions(const char *path,
                        apr_pool_t *pool);
 
 
-/* Updates. */
+/* Working copy roots. */
 
 /** 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"
@@ -5290,6 +5121,21 @@ svn_wc_is_wc_root(svn_boolean_t *wc_root
                   svn_wc_adm_access_t *adm_access,
                   apr_pool_t *pool);
 
+/**
+ * Set @a *wcroot_abspath to the local abspath of the root of the
+ * working copy in which @a local_abspath resides.
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_wc_get_wc_root(const char **wcroot_abspath,
+                   svn_wc_context_t *wc_ctx,
+                   const char *local_abspath,
+                   apr_pool_t *scratch_pool,
+                   apr_pool_t *result_pool);
+
+
+/* Updates. */
 
 /** Conditionally split @a path into an @a anchor and @a target for the
  * purpose of updating and committing.
@@ -5365,10 +5211,6 @@ svn_wc_get_actual_target(const char *pat
  * whenever external changes are encountered, giving the callback a chance
  * to store the external information for processing.
  *
- * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as
- * a fallback for retrieving repository files whenever 'copyfrom' args
- * are sent into editor->add_file().
- *
  * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
  * any merging; otherwise, use the built-in merge code.
  *
@@ -5419,8 +5261,6 @@ svn_wc_get_update_editor4(const svn_delt
                           svn_boolean_t allow_unver_obstructions,
                           const char *diff3_cmd,
                           const apr_array_header_t *preserved_exts,
-                          svn_wc_get_file_t fetch_func,
-                          void *fetch_baton,
                           svn_wc_conflict_resolver_func_t conflict_func,
                           void *conflict_baton,
                           svn_wc_external_update_t external_func,
@@ -5434,7 +5274,8 @@ svn_wc_get_update_editor4(const svn_delt
 
 /** Similar to svn_wc_get_update_editor4, but uses access batons and relative
  * path instead of a working copy context-abspath pair and
- * svn_wc_traversal_info_t instead of an externals callback.
+ * svn_wc_traversal_info_t instead of an externals callback.  Also, 
+ * @a fetch_func and @a fetch_baton are ignored.
  *
  * If @a ti is non-NULL, record traversal info in @a ti, for use by
  * post-traversal accessors such as svn_wc_edited_externals().
@@ -5546,8 +5387,6 @@ svn_wc_get_switch_editor4(const svn_delt
                           svn_boolean_t allow_unver_obstructions,
                           const char *diff3_cmd,
                           const apr_array_header_t *preserved_exts,
-                          svn_wc_get_file_t fetch_func,
-                          void *fetch_baton,
                           svn_wc_conflict_resolver_func_t conflict_func,
                           void *conflict_baton,
                           svn_wc_external_update_t external_func,
@@ -5561,8 +5400,7 @@ svn_wc_get_switch_editor4(const svn_delt
 
 /** Similar to svn_wc_get_switch_editor4, but uses access batons and relative
  * path instead of a working copy context and svn_wc_traversal_info_t instead
- * of an externals callback. This function doesn't support an external file
- * fetcher.
+ * of an externals callback.
  *
  * If @a ti is non-NULL, record traversal info in @a ti, for use by
  * post-traversal accessors such as svn_wc_edited_externals().
@@ -5831,6 +5669,7 @@ svn_wc_prop_set3(const char *name,
  * Like svn_wc_prop_set3(), but without the notification callbacks.
  *
  * @since New in 1.2.
+ * @deprecated Provided for backwards compatibility with the 1.5 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -6186,7 +6025,6 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
  * It also doesn't allow specifying a cancel function.
  *
  * @since New in 1.6.
- *
  * @deprecated Provided for backward compatibility with the 1.6 API.
  */
 SVN_DEPRECATED
@@ -6204,6 +6042,7 @@ svn_wc_diff5(svn_wc_adm_access_t *anchor
  * Similar to svn_wc_diff5(), but with a #svn_wc_diff_callbacks2_t argument
  * instead of #svn_wc_diff_callbacks3_t.
  *
+ * @since New in 1.5.
  * @deprecated Provided for backward compatibility with the 1.5 API.
  */
 SVN_DEPRECATED
@@ -6222,7 +6061,8 @@ svn_wc_diff4(svn_wc_adm_access_t *anchor
  * and @a depth set to #svn_depth_infinity if @a recurse is TRUE, or
  * #svn_depth_files if @a recurse is FALSE.
  *
- * @deprecated Provided for backward compatibility with the 1.2 API.
+ * @since New in 1.2.
+ * @deprecated Provided for backward compatibility with the 1.4 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -6238,6 +6078,7 @@ svn_wc_diff3(svn_wc_adm_access_t *anchor
  * Similar to svn_wc_diff3(), but with a #svn_wc_diff_callbacks_t argument
  * instead of #svn_wc_diff_callbacks2_t.
  *
+ * @since New in 1.1.
  * @deprecated Provided for backward compatibility with the 1.1 API.
  */
 SVN_DEPRECATED
@@ -6555,8 +6396,7 @@ svn_wc_merge_props2(svn_wc_notify_state_
  * Same as svn_wc_merge_props2(), but with a @a conflict_func (and
  * baton) of NULL.
  *
- * @deprecated Provided for backward compatibility with the 1.3 API.
- *
+ * @deprecated Provided for backward compatibility with the 1.4 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -6679,7 +6519,7 @@ svn_wc_cleanup3(svn_wc_context_t *wc_ctx
  * swn_wc_context_t.
  *
  * @since New in 1.2.
- * @deprecated Provided for backward compability with the 1.2 API.
+ * @deprecated Provided for backward compability with the 1.6 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -6797,13 +6637,14 @@ typedef svn_error_t *(*svn_wc_relocation
                                                       const char *uuid,
                                                       const char *url);
 
-/** Change repository references at @a local_abspath and all it's children.
- * The pre-change URL should be @a from, and the post-change URL will be
- * @a to.  @a validator (and its baton, @a validator_baton), will be called
- * for the newly generated base URL and calculated repo root.
+/** Recursively change repository references at @a wcroot_abspath
+ * (which is the root directory of a working copy).  The pre-change
+ * URL should begin with @a from, and the post-change URL will begin
+ * with @a to.  @a validator (and its baton, @a validator_baton), will
+ * be called for the newly generated base URL and calculated repo
+ * root.
  *
- * If @a recurse is @c FALSE, none of the children of @a local_abspath will
- * be changed.  @a wc_ctx is an working copy context.
+ * @a wc_ctx is an working copy context.
  *
  * @a scratch_pool will be used for temporary allocations.
  *
@@ -6811,10 +6652,9 @@ typedef svn_error_t *(*svn_wc_relocation
  */
 svn_error_t *
 svn_wc_relocate4(svn_wc_context_t *wc_ctx,
-                 const char *local_abspath,
+                 const char *wcroot_abspath,
                  const char *from,
                  const char *to,
-                 svn_boolean_t recurse,
                  svn_wc_relocation_validator3_t validator,
                  void *validator_baton,
                  apr_pool_t *scratch_pool);
@@ -6822,8 +6662,12 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
 /** Similar to svn_wc_relocate4(), but with a #svn_wc_adm_access_t /
  * relative path parameter pair.
  *
+ * @note As of the 1.7 API, @a path is required to be a working copy
+ * root directory, and @a recurse is required to be TRUE.
+ *
  * @since New in 1.5.
- * @deprecated Provided for backwards compatibility with the 1.6 API.
+ * @deprecated Provided for limited backwards compatibility with the
+ * 1.6 API.
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -6944,7 +6788,8 @@ svn_wc_revert3(const char *path,
  * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files;
  * revert is deliberately different.
  *
- * @deprecated Provided for backward compatibility with the 1.2 API.
+ * @since New in 1.2.
+ * @deprecated Provided for backward compatibility with the 1.4 API.
  */
 SVN_DEPRECATED
 svn_error_t *

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c Thu Nov  4 20:48:21 2010
@@ -64,11 +64,8 @@ callback_destroy_data_keyring(void *data
   if (data == NULL)
     return;
 
-  if (key_info->keyring_name)
-    {
-      free((void*)key_info->keyring_name);
-      key_info->keyring_name = NULL;
-    }
+  free((void*)key_info->keyring_name);
+  key_info->keyring_name = NULL;
 
   if (key_info->info)
     {
@@ -132,8 +129,7 @@ callback_default_keyring(GnomeKeyringRes
     }
   else
     {
-      if (key_info->keyring_name != NULL)
-        free((void*)key_info->keyring_name);
+      free((void*)key_info->keyring_name);
       key_info->keyring_name = NULL;
     }
 
@@ -296,8 +292,7 @@ password_get_gnome_keyring(const char **
                    "");
     }
 
-  if (default_keyring)
-    free(default_keyring);
+  free(default_keyring);
 
   return ret;
 }
@@ -347,8 +342,7 @@ password_set_gnome_keyring(apr_hash_t *c
                    "");
     }
 
-  if (default_keyring)
-    free(default_keyring);
+  free(default_keyring);
 
   return result == GNOME_KEYRING_RESULT_OK;
 }

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_auth_kwallet/kwallet.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_auth_kwallet/kwallet.cpp?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_auth_kwallet/kwallet.cpp (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_auth_kwallet/kwallet.cpp Thu Nov  4 20:48:21 2010
@@ -47,20 +47,13 @@
 
 #include <dbus/dbus.h>
 #include <QtCore/QCoreApplication>
-#include <QtCore/QList>
-#include <QtCore/QMap>
 #include <QtCore/QString>
-#include <QtGui/QApplication>
-#include <QtGui/QX11Info>
 
 #include <kaboutdata.h>
 #include <kcmdlineargs.h>
 #include <kcomponentdata.h>
 #include <klocalizedstring.h>
 #include <kwallet.h>
-#include <kwindowsystem.h>
-#include <netwm.h>
-#include <netwm_def.h>
 
 
 /*-----------------------------------------------------------------------*/
@@ -68,28 +61,6 @@
 /*-----------------------------------------------------------------------*/
 
 
-#define INITIALIZE_APPLICATION                                            \
-  if (apr_hash_get(parameters,                                            \
-                   "svn:auth:qapplication-safe",                          \
-                   APR_HASH_KEY_STRING))                                  \
-    {                                                                     \
-      QApplication *app;                                                  \
-      if (! qApp)                                                         \
-        {                                                                 \
-          int argc = 1;                                                   \
-          app = new QApplication(argc, (char *[1]) {(char *) "svn"});     \
-        }                                                                 \
-    }                                                                     \
-  else                                                                    \
-    {                                                                     \
-      QCoreApplication *app;                                              \
-      if (! qApp)                                                         \
-        {                                                                 \
-          int argc = 1;                                                   \
-          app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"}); \
-        }                                                                 \
-    }
-
 static const char *
 get_application_name(apr_hash_t *parameters,
                      apr_pool_t *pool)
@@ -139,99 +110,22 @@ get_wallet_name(apr_hash_t *parameters)
     }
 }
 
-static pid_t
-get_parent_pid(pid_t pid,
-               apr_pool_t *pool)
-{
-  pid_t parent_pid = 0;
-
-#ifdef __linux__
-  svn_stream_t *stat_file_stream;
-  svn_string_t *stat_file_string;
-  const char *preceeding_space, *following_space, *parent_pid_string;
-
-  const char *path = apr_psprintf(pool, "/proc/%ld/stat", long(pid));
-  svn_error_t *err = svn_stream_open_readonly(&stat_file_stream, path, pool, pool);
-  if (err == SVN_NO_ERROR)
-    {
-      err = svn_string_from_stream(&stat_file_string, stat_file_stream, pool, pool);
-      if (err == SVN_NO_ERROR)
-        {
-          if ((preceeding_space = strchr(stat_file_string->data, ' ')))
-            {
-              if ((preceeding_space = strchr(preceeding_space + 1, ' ')))
-                {
-                  if ((preceeding_space = strchr(preceeding_space + 1, ' ')))
-                    {
-                      if ((following_space = strchr(preceeding_space + 1, ' ')))
-                        {
-                          parent_pid_string = apr_pstrndup(pool,
-                                                           preceeding_space + 1,
-                                                           following_space - preceeding_space);
-                          parent_pid = atol(parent_pid_string);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-  if (err)
-    {
-      svn_error_clear(err);
-    }
-#endif
-
-  return parent_pid;
-}
-
 static WId
-get_wid(apr_hash_t *parameters,
-        apr_pool_t *pool)
+get_wid(void)
 {
   WId wid = 1;
+  const char *wid_env_string = getenv("WINDOWID");
 
-  if (apr_hash_get(parameters,
-                   "svn:auth:qapplication-safe",
-                   APR_HASH_KEY_STRING))
-    {
-      QMap<pid_t, WId> process_info_list;
-      QList<WId> windows(KWindowSystem::windows());
-      QList<WId>::const_iterator i;
-      for (i = windows.begin(); i != windows.end(); i++)
-        {
-          process_info_list[NETWinInfo(QX11Info::display(),
-                                       *i,
-                                       QX11Info::appRootWindow(),
-                                       NET::WMPid).pid()] = *i;
-        }
-
-      apr_pool_t *iterpool = svn_pool_create(pool);
-      pid_t pid = getpid();
-      while (pid != 0)
-        {
-          svn_pool_clear(iterpool);
-          if (process_info_list.contains(pid))
-            {
-              wid = process_info_list[pid];
-              break;
-            }
-          pid = get_parent_pid(pid, iterpool);
-        }
-      svn_pool_destroy(iterpool);
-    }
-
-  if (wid == 1)
+  if (wid_env_string)
     {
-      const char *wid_env_string = getenv("WINDOWID");
-      if (wid_env_string)
-        {
-          long wid_env = atol(wid_env_string);
-          if (wid_env != 0)
-            {
-              wid = wid_env;
-            }
-        }
+      apr_int64_t wid_env;
+      svn_error_t *err;
+      
+      err = svn_cstring_atoi64(&wid_env, wid_env_string);
+      if (err)
+        svn_error_clear(err);
+      else
+        wid = (WId)wid_env;
     }
 
   return wid;
@@ -239,8 +133,7 @@ get_wid(apr_hash_t *parameters,
 
 static KWallet::Wallet *
 get_wallet(QString wallet_name,
-           apr_hash_t *parameters,
-           apr_pool_t *pool)
+           apr_hash_t *parameters)
 {
   KWallet::Wallet *wallet =
     static_cast<KWallet::Wallet *> (apr_hash_get(parameters,
@@ -250,8 +143,7 @@ get_wallet(QString wallet_name,
                                  "kwallet-opening-failed",
                                  APR_HASH_KEY_STRING))
     {
-      wallet = KWallet::Wallet::openWallet(wallet_name,
-                                           pool ? get_wid(parameters, pool) : 1,
+      wallet = KWallet::Wallet::openWallet(wallet_name, get_wid(),
                                            KWallet::Wallet::Synchronous);
     }
   if (wallet)
@@ -277,7 +169,7 @@ kwallet_terminate(void *data)
   apr_hash_t *parameters = static_cast<apr_hash_t *> (data);
   if (apr_hash_get(parameters, "kwallet-initialized", APR_HASH_KEY_STRING))
     {
-      KWallet::Wallet *wallet = get_wallet(NULL, parameters, NULL);
+      KWallet::Wallet *wallet = get_wallet(NULL, parameters);
       delete wallet;
       apr_hash_set(parameters,
                    "kwallet-initialized",
@@ -308,7 +200,12 @@ kwallet_password_get(const char **passwo
       return FALSE;
     }
 
-  INITIALIZE_APPLICATION
+  QCoreApplication *app;
+  if (! qApp)
+    {
+      int argc = 1;
+      app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+    }
 
   KCmdLineArgs::init(1,
                      (char *[1]) {(char *) "svn"},
@@ -326,7 +223,7 @@ kwallet_password_get(const char **passwo
     QString::fromUtf8(username) + "@" + QString::fromUtf8(realmstring);
   if (! KWallet::Wallet::keyDoesNotExist(wallet_name, folder, key))
     {
-      KWallet::Wallet *wallet = get_wallet(wallet_name, parameters, pool);
+      KWallet::Wallet *wallet = get_wallet(wallet_name, parameters);
       if (wallet)
         {
           apr_hash_set(parameters,
@@ -373,7 +270,12 @@ kwallet_password_set(apr_hash_t *creds,
       return FALSE;
     }
 
-  INITIALIZE_APPLICATION
+  QCoreApplication *app;
+  if (! qApp)
+    {
+      int argc = 1;
+      app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+    }
 
   KCmdLineArgs::init(1,
                      (char *[1]) {(char *) "svn"},
@@ -388,7 +290,7 @@ kwallet_password_set(apr_hash_t *creds,
   QString q_password = QString::fromUtf8(password);
   QString wallet_name = get_wallet_name(parameters);
   QString folder = QString::fromUtf8("Subversion");
-  KWallet::Wallet *wallet = get_wallet(wallet_name, parameters, pool);
+  KWallet::Wallet *wallet = get_wallet(wallet_name, parameters);
   if (wallet)
     {
       apr_hash_set(parameters,
@@ -525,6 +427,7 @@ static const svn_auth_provider_t kwallet
 };
 
 /* Public API */
+extern "C" {
 void
 svn_auth_get_kwallet_ssl_client_cert_pw_provider
     (svn_auth_provider_object_t **provider,
@@ -536,3 +439,4 @@ svn_auth_get_kwallet_ssl_client_cert_pw_
   po->vtable = &kwallet_ssl_client_cert_pw_provider;
   *provider = po;
 }
+}

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/add.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/add.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/add.c Thu Nov  4 20:48:21 2010
@@ -167,7 +167,7 @@ auto_props_enumerator(const char *name,
   apr_array_header_t *props;
 
   /* nothing to do here without a value */
-  if (strlen(value) == 0)
+  if (*value == 0)
     return TRUE;
 
   /* check if filename matches and return if it doesn't */
@@ -273,6 +273,7 @@ svn_client__get_auto_props(apr_hash_t **
   return SVN_NO_ERROR;
 }
 
+/* Only call this if the on-disk node kind is a file. */
 static svn_error_t *
 add_file(const char *local_abspath,
          svn_client_ctx_t *ctx,
@@ -298,9 +299,8 @@ add_file(const char *local_abspath,
                                        ctx, pool));
 
   /* Add the file */
-  SVN_ERR(svn_wc_add4(ctx->wc_ctx, local_abspath, svn_depth_infinity, NULL,
-                      SVN_INVALID_REVNUM, ctx->cancel_func, ctx->cancel_baton,
-                      NULL, NULL, pool));
+  SVN_ERR(svn_wc_add_from_disk(ctx->wc_ctx, local_abspath,
+                               NULL, NULL, pool));
 
   if (is_special)
     /* This must be a special file. */
@@ -385,9 +385,9 @@ add_dir_recursive(const char *dir_abspat
   iterpool = svn_pool_create(scratch_pool);
 
   /* Add this directory to revision control. */
-  err = svn_wc_add4(ctx->wc_ctx, dir_abspath, svn_depth_infinity, NULL,
-                    SVN_INVALID_REVNUM, ctx->cancel_func, ctx->cancel_baton,
-                    ctx->notify_func2, ctx->notify_baton2, iterpool);
+  err = svn_wc_add_from_disk(ctx->wc_ctx, dir_abspath,
+                             ctx->notify_func2, ctx->notify_baton2,
+                             iterpool);
   if (err && err->apr_err == SVN_ERR_ENTRY_EXISTS && force)
     svn_error_clear(err);
   else if (err)
@@ -546,11 +546,12 @@ add_parent_dirs(svn_client_ctx_t *ctx,
     SVN_ERR(svn_wc__acquire_write_lock(NULL, wc_ctx, parent_abspath, FALSE,
                                        scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_wc_add4(wc_ctx, local_abspath, svn_depth_infinity,
-                      NULL, SVN_INVALID_REVNUM,
-                      ctx->cancel_func, ctx->cancel_baton,
-                      ctx->notify_func2, ctx->notify_baton2,
-                      scratch_pool));
+  if (ctx->cancel_func)
+    SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+
+  SVN_ERR(svn_wc_add_from_disk(wc_ctx, local_abspath,
+                               ctx->notify_func2, ctx->notify_baton2,
+                               scratch_pool));
   /* ### New dir gets added with its own per-directory lock which we
      must release.  This code should be redundant when we move to a
      single db. */

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/blame.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/blame.c Thu Nov  4 20:48:21 2010
@@ -490,8 +490,10 @@ file_rev_handler(void *baton, const char
 
   if (revnum < frb->start_rev)
     {
-      /* We shouldn't get more than one revision before start. */
-      SVN_ERR_ASSERT(frb->last_filename == NULL);
+      /* We shouldn't get more than one revision before the starting
+         revision (unless of including merged revisions). */
+      SVN_ERR_ASSERT((frb->last_filename == NULL)
+                     || frb->include_merged_revisions);
 
       /* The file existed before start_rev; generate no blame info for
          lines from this revision (or before). */
@@ -551,35 +553,28 @@ normalize_blames(struct blame_chain *cha
         }
     }
 
-  /* If both next pointers are null, we have an equally long list. */
-  if (walk->next == NULL && walk_merged->next == NULL)
-    return;
-
-  if (walk_merged->next == NULL)
-    {
-      /* Make new walk_merged chunks as needed at the end of the list so that
-         the length matches that of walk. */
-      while (walk->next != NULL)
-        {
-          struct blame *tmp = blame_create(chain_merged, walk_merged->rev,
-                                           walk->next->start);
-          walk_merged->next = tmp;
-          walk_merged = walk_merged->next;
-          walk = walk->next;
-        }
+  /* If both NEXT pointers are null, the lists are equally long, otherwise
+     we need to extend one of them.  If CHAIN is longer, append new chunks
+     to CHAIN_MERGED until its length matches that of CHAIN. */
+  while (walk->next != NULL)
+    {
+      struct blame *tmp = blame_create(chain_merged, walk_merged->rev,
+                                       walk->next->start);
+      walk_merged->next = tmp;
+
+      walk_merged = walk_merged->next;
+      walk = walk->next;
     }
 
-  if (walk->next == NULL)
+  /* Same as above, only extend CHAIN to match CHAIN_MERGED. */
+  while (walk_merged->next != NULL)
     {
-      /* Same as above, only create walk chunks as needed. */
-      while (walk_merged->next != NULL)
-        {
-          struct blame *tmp = blame_create(chain, walk->rev,
-                                           walk_merged->next->start);
-          walk->next = tmp;
-          walk = walk->next;
-          walk_merged = walk_merged->next;
-        }
+      struct blame *tmp = blame_create(chain, walk->rev,
+                                       walk_merged->next->start);
+      walk->next = tmp;
+
+      walk = walk->next;
+      walk_merged = walk_merged->next;
     }
 }
 

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/checkout.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/checkout.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/checkout.c Thu Nov  4 20:48:21 2010
@@ -48,18 +48,12 @@
 /*** Public Interfaces. ***/
 
 static svn_error_t *
-initialize_area(svn_revnum_t *result_rev,
-                const char *local_abspath,
-                const svn_opt_revision_t *revision,
+initialize_area(const char *local_abspath,
                 const char *session_url,
                 const char *repos_root,
                 const char *uuid,
                 svn_revnum_t revnum,
                 svn_depth_t depth,
-                svn_boolean_t *use_sleep,
-                svn_boolean_t ignore_externals,
-                svn_boolean_t allow_unver_obstructions,
-                svn_boolean_t innercheckout,
                 svn_client_ctx_t *ctx,
                 apr_pool_t *pool)
 {
@@ -69,12 +63,7 @@ initialize_area(svn_revnum_t *result_rev
   /* Make the unversioned directory into a versioned one.  */
   SVN_ERR(svn_wc_ensure_adm4(ctx->wc_ctx, local_abspath, session_url,
                              repos_root, uuid, revnum, depth, pool));
-  /* Have update fix the incompleteness. */
-  return svn_error_return(svn_client__update_internal(result_rev, local_abspath,
-                                    revision, depth, TRUE, ignore_externals,
-                                    allow_unver_obstructions,
-                                    use_sleep, FALSE, innercheckout,
-                                    ctx, pool));
+  return SVN_NO_ERROR;
 }
 
 
@@ -186,10 +175,8 @@ svn_client__checkout_internal(svn_revnum
          entries file should only have an entry for THIS_DIR with a
          URL, revnum, and an 'incomplete' flag.  */
       SVN_ERR(svn_io_make_dir_recursively(local_abspath, pool));
-      err = initialize_area(result_rev, local_abspath, revision, session_url,
-                            repos_root, uuid, revnum, depth, use_sleep,
-                            ignore_externals, allow_unver_obstructions,
-                            innercheckout, ctx, pool);
+      err = initialize_area(local_abspath, session_url,
+                            repos_root, uuid, revnum, depth, ctx, pool);
     }
   else if (kind == svn_node_dir)
     {
@@ -199,10 +186,8 @@ svn_client__checkout_internal(svn_revnum
       SVN_ERR(svn_wc_check_wc2(&wc_format, ctx->wc_ctx, local_abspath, pool));
       if (! wc_format)
         {
-          err = initialize_area(result_rev, local_abspath, revision, session_url,
-                                repos_root, uuid, revnum, depth, use_sleep,
-                                ignore_externals, allow_unver_obstructions,
-                                innercheckout, ctx, pool);
+          err = initialize_area(local_abspath, session_url,
+                                repos_root, uuid, revnum, depth, ctx, pool);
         }
       else
         {
@@ -212,17 +197,8 @@ svn_client__checkout_internal(svn_revnum
 
           /* If PATH's existing URL matches the incoming one, then
              just update.  This allows 'svn co' to restart an
-             interrupted checkout. */
-          if (strcmp(entry_url, session_url) == 0)
-            {
-              err = svn_client__update_internal(result_rev, local_abspath,
-                                                revision, depth, TRUE,
-                                                ignore_externals,
-                                                allow_unver_obstructions,
-                                                use_sleep, FALSE, innercheckout,
-                                                ctx, pool);
-            }
-          else
+             interrupted checkout.  Otherwise bail out. */
+          if (strcmp(entry_url, session_url) != 0)
             return svn_error_createf(
                           SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
                           _("'%s' is already a working copy for a different URL;"
@@ -237,6 +213,14 @@ svn_client__checkout_internal(svn_revnum
                                svn_dirent_local_style(local_abspath, pool));
     }
 
+  /* Have update fix the incompleteness. */
+  err = svn_client__update_internal(result_rev, local_abspath,
+                                    revision, depth, TRUE,
+                                    ignore_externals,
+                                    allow_unver_obstructions,
+                                    use_sleep, innercheckout,
+                                    ctx, pool);
+
   if (err)
     {
       /* Don't rely on the error handling to handle the sleep later, do

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/cleanup.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/cleanup.c Thu Nov  4 20:48:21 2010
@@ -129,6 +129,11 @@ svn_client_upgrade(const char *path,
   info_baton.last_repos = NULL;
   info_baton.last_uuid = NULL;
 
+  if (svn_path_is_url(path))
+    return svn_error_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, scratch_pool));
   SVN_ERR(svn_wc_upgrade(ctx->wc_ctx, local_abspath,
                          fetch_repos_info, &info_baton,

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/client.h?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/client.h (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/client.h Thu Nov  4 20:48:21 2010
@@ -490,12 +490,6 @@ svn_client__make_local_parents(const cha
    that obstruct items added from the repos are tolerated; if FALSE,
    these obstructions cause the update to fail.
 
-   If SEND_COPYFROM_ARGS is true, then request that the server not
-   send file contents when adding files that have been created by
-   explicit copying; instead, just send copyfrom-args to add_file(),
-   and possibly follow up with an apply_textdelta() against the copied
-   file.
-
    If INNERUPDATE is true, no anchor check is performed on the update target.
 */
 svn_error_t *
@@ -507,7 +501,6 @@ svn_client__update_internal(svn_revnum_t
                             svn_boolean_t ignore_externals,
                             svn_boolean_t allow_unver_obstructions,
                             svn_boolean_t *timestamp_sleep,
-                            svn_boolean_t send_copyfrom_args,
                             svn_boolean_t innerupdate,
                             svn_client_ctx_t *ctx,
                             apr_pool_t *pool);

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/cmdline.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/cmdline.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/cmdline.c Thu Nov  4 20:48:21 2010
@@ -82,7 +82,8 @@ resolve_repos_relative_url(const char **
    * arguments, it is presumed that the output will be canonicalized after
    * this function, which will remove any duplicate path separator.
    */
-  *absolute_url = apr_pstrcat(pool, repos_root_url, relative_url + 1, NULL);
+  *absolute_url = apr_pstrcat(pool, repos_root_url, relative_url + 1,
+                              (char *)NULL);
 
   return SVN_NO_ERROR;
 }
@@ -270,7 +271,7 @@ svn_client_args_to_target_array(apr_arra
                 }
             }
 
-          target = apr_pstrcat(pool, true_target, peg_rev, NULL);
+          target = apr_pstrcat(pool, true_target, peg_rev, (char *)NULL);
 
           if (rel_url_found)
             {
@@ -317,7 +318,7 @@ svn_client_args_to_target_array(apr_arra
               SVN_ERR(svn_opt__arg_canonicalize_url(&true_target, abs_target,
                                                     pool));
 
-              target = apr_pstrcat(pool, true_target, peg_rev, NULL);
+              target = apr_pstrcat(pool, true_target, peg_rev, (char *)NULL);
             }
 
           APR_ARRAY_PUSH(*targets_p, const char *) = target;

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/copy.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/copy.c Thu Nov  4 20:48:21 2010
@@ -300,7 +300,7 @@ do_wc_to_wc_copies(const apr_array_heade
   const char *dst_parent, *dst_parent_abspath;
   struct do_wc_to_wc_copies_with_write_lock_baton baton;
 
-  get_copy_pair_ancestors(copy_pairs, NULL, &dst_parent, NULL, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, NULL, &dst_parent, NULL, pool));
   if (copy_pairs->nelts == 1)
     dst_parent = svn_dirent_dirname(dst_parent, pool);
 
@@ -821,7 +821,8 @@ repos_to_repos_copy(const apr_array_head
      *and* destinations might be an optimization when the user is
      authorized to access all that stuff, but could cause the
      operation to fail altogether otherwise.  See issue #3242.  */
-  get_copy_pair_ancestors(copy_pairs, NULL, &top_url_dst, &top_url_all, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, NULL, &top_url_dst, &top_url_all, 
+                                  pool));
   top_url = is_move ? top_url_all : top_url_dst;
 
   /* Check each src/dst pair for resurrection, and verify that TOP_URL
@@ -1168,7 +1169,7 @@ wc_to_repos_copy(const apr_array_header_
   int i;
 
   /* Find the common root of all the source paths */
-  get_copy_pair_ancestors(copy_pairs, &top_src_path, NULL, NULL, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, &top_src_path, NULL, NULL, pool));
 
   /* Do we need to lock the working copy?  1.6 didn't take a write
      lock, but what happens if the working copy changes during the copy
@@ -1408,8 +1409,39 @@ wc_to_repos_copy(const apr_array_header_
   return SVN_NO_ERROR;
 }
 
+/* A baton for notification_adjust_func(). */
+struct notification_adjust_baton
+{
+  svn_wc_notify_func2_t inner_func;
+  void *inner_baton;
+  const char *checkout_abspath;
+  const char *final_abspath;
+};
+
+/* A svn_wc_notify_func2_t function that wraps BATON->inner_func (whose
+ * baton is BATON->inner_baton) and adjusts the notification paths that
+ * start with BATON->checkout_abspath to start instead with
+ * BATON->final_abspath. */
+static void
+notification_adjust_func(void *baton,
+                         const svn_wc_notify_t *notify,
+                         apr_pool_t *pool)
+{
+  struct notification_adjust_baton *nb = baton;
+  svn_wc_notify_t *inner_notify = svn_wc_dup_notify(notify, pool);
+  const char *relpath;
+
+  relpath = svn_dirent_skip_ancestor(nb->checkout_abspath, notify->path);
+  inner_notify->path = svn_dirent_join(nb->final_abspath, relpath, pool);
+
+  if (nb->inner_func)
+    nb->inner_func(nb->inner_baton, inner_notify, pool);
+}
+
 /* Peform each individual copy operation for a repos -> wc copy.  A
-   helper for repos_to_wc_copy(). */
+   helper for repos_to_wc_copy().
+
+   Resolve PAIR->src_revnum to a real revision number if it isn't already. */
 static svn_error_t *
 repos_to_wc_copy_single(svn_client__copy_pair_t *pair,
                         svn_boolean_t same_repositories,
@@ -1418,7 +1450,6 @@ repos_to_wc_copy_single(svn_client__copy
                         svn_client_ctx_t *ctx,
                         apr_pool_t *pool)
 {
-  svn_revnum_t src_revnum = pair->src_revnum;
   apr_hash_t *src_mergeinfo;
   const char *dst_abspath = pair->dst_abspath_or_url;
 
@@ -1426,69 +1457,79 @@ repos_to_wc_copy_single(svn_client__copy
 
   if (pair->src_kind == svn_node_dir)
     {
-      SVN_ERR(svn_client__checkout_internal(NULL, pair->src_original,
-                                            pair->dst_abspath_or_url,
-                                            &pair->src_peg_revision,
-                                            &pair->src_op_revision, NULL,
-                                            svn_depth_infinity,
-                                            ignore_externals, FALSE, TRUE,
-                                            NULL, ctx, pool));
-
-      /* Rewrite URLs recursively, remove wcprops, and mark everything
-         as 'copied' -- assuming that the src and dst are from the
-         same repository.  (It's kind of weird that svn_wc_add3() is the
-         way to do this; see its doc for more about the controversy.) */
+      svn_boolean_t sleep_needed = FALSE;
+      const char *tmp_abspath;
+
+      /* Find a temporary location in which to check out the copy source.
+       * (This function is deprecated, but we intend to replace this whole
+       * code path with something else.) */
+      SVN_ERR(svn_wc_create_tmp_file2(NULL, &tmp_abspath, dst_abspath,
+                                      svn_io_file_del_on_close, pool));
+
+      /* Make a new checkout of the requested source. While doing so,
+       * resolve pair->src_revnum to an actual revision number in case it
+       * was until now 'invalid' meaning 'head'.  Ask this function not to
+       * sleep for timestamps, by passing a sleep_needed output param.
+       * Send notifications for all nodes except the root node, and adjust
+       * them to refer to the destination rather than this temporary path. */
+      {
+        svn_wc_notify_func2_t old_notify_func2 = ctx->notify_func2;
+        void *old_notify_baton2 = ctx->notify_baton2;
+        struct notification_adjust_baton nb;
+
+        nb.inner_func = ctx->notify_func2;
+        nb.inner_baton = ctx->notify_baton2;
+        nb.checkout_abspath = tmp_abspath;
+        nb.final_abspath = dst_abspath;
+        ctx->notify_func2 = notification_adjust_func;
+        ctx->notify_baton2 = &nb;
+
+        SVN_ERR(svn_client__checkout_internal(&pair->src_revnum,
+                                              pair->src_original,
+                                              tmp_abspath,
+                                              &pair->src_peg_revision,
+                                              &pair->src_op_revision, NULL,
+                                              svn_depth_infinity,
+                                              ignore_externals, FALSE, TRUE,
+                                              &sleep_needed, ctx, pool));
+
+        ctx->notify_func2 = old_notify_func2;
+        ctx->notify_baton2 = old_notify_baton2;
+      }
+
+      /* Schedule dst_path for addition in parent, with copy history.
+         Don't send any notification here.
+         Then remove the temporary checkout's .svn dir in preparation for
+         moving the rest of it into the final destination. */
       if (same_repositories)
         {
-          if (pair->src_op_revision.kind == svn_opt_revision_head)
-            {
-              /* If we just checked out from the "head" revision,
-                 that's fine, but we don't want to pass a '-1' as a
-                 copyfrom_rev to svn_wc_add3().  That function will
-                 dump it right into the entry, and when we try to
-                 commit later on, the 'add-dir-with-history' step will
-                 be -very- unhappy; it only accepts specific
-                 revisions.
-
-                 On the other hand, we *could* say that -1 is a
-                 legitimate copyfrom_rev, but I think that's bogus.
-                 Somebody made a copy from a particular revision; if
-                 they wait a long time to commit, it would be terrible
-                 if the copied happened from a newer revision!! */
-
-              /* We just did a checkout; whatever revision we just
-                 got, that should be the copyfrom_revision when we
-                 commit later. */
-              SVN_ERR(svn_wc__node_get_base_rev(&src_revnum, ctx->wc_ctx,
-                                                dst_abspath, pool));
-            }
+          SVN_ERR(svn_wc_copy3(ctx->wc_ctx, tmp_abspath, dst_abspath,
+                               TRUE /* metadata_only */,
+                               ctx->cancel_func, ctx->cancel_baton,
+                               NULL, NULL, pool));
+          SVN_ERR(svn_wc__acquire_write_lock(NULL, ctx->wc_ctx, tmp_abspath,
+                                             FALSE, pool, pool));
+          SVN_ERR(svn_wc_remove_from_revision_control2(ctx->wc_ctx,
+                                                       tmp_abspath,
+                                                       FALSE, FALSE,
+                                                       ctx->cancel_func,
+                                                       ctx->cancel_baton,
+                                                       pool));
+        }
+      else
+        {
+          /* ### We want to schedule this as a simple add, or even better
+             a copy from a foreign repos, but we don't yet have the
+             WC APIs to do that, so we will just move the whole WC into
+             place as a disjoint, nested WC. */
+        }
+
+      /* Move the temporary disk tree into place. */
+      SVN_ERR(svn_io_file_rename(tmp_abspath, dst_abspath, pool));
 
-          /* Schedule dst_path for addition in parent, with copy history.
-             (This function also recursively puts a 'copied' flag on every
-             entry). */
-          SVN_ERR(svn_wc_add4(ctx->wc_ctx, dst_abspath, svn_depth_infinity,
-                              pair->src_abspath_or_url, src_revnum,
-                              ctx->cancel_func, ctx->cancel_baton,
-                              ctx->notify_func2, ctx->notify_baton2, pool));
-
-          /* ### Recording of implied mergeinfo should really occur
-             ### *before* the notification callback is invoked by
-             ### svn_wc_add4(), but can't occur before we add the new
-             ### source path. */
-          SVN_ERR(calculate_target_mergeinfo(ra_session, &src_mergeinfo, NULL,
-                                             pair->src_abspath_or_url,
-                                             src_revnum, ctx, pool));
-          SVN_ERR(extend_wc_mergeinfo(dst_abspath, src_mergeinfo, ctx, pool));
-        }
-      else  /* different repositories */
-        {
-          /* ### Someday, we would just call svn_wc_add4(), as above,
-             but with no copyfrom args.  I.e. in the
-             directory-foreign-UUID case, we still want everything
-             scheduled for addition, URLs rewritten, and wcprop cache
-             deleted, but WITHOUT any copied flags or copyfrom urls.
-             Unfortunately, svn_wc_add4() is such a mess that it chokes
-             at the moment when we pass a NULL copyfromurl. */
+      if (! same_repositories)
+        {
+          svn_io_sleep_for_timestamps(dst_abspath, pool);
 
           return svn_error_createf
             (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
@@ -1500,7 +1541,6 @@ repos_to_wc_copy_single(svn_client__copy
   else if (pair->src_kind == svn_node_file)
     {
       svn_stream_t *fstream;
-      svn_revnum_t real_rev;
       const char *new_text_path;
       apr_hash_t *new_props;
       const char *src_rel;
@@ -1513,48 +1553,44 @@ repos_to_wc_copy_single(svn_client__copy
       SVN_ERR(svn_ra_get_path_relative_to_session(ra_session, &src_rel,
                                                   pair->src_abspath_or_url,
                                                   pool));
-      SVN_ERR(svn_ra_get_file(ra_session, src_rel, src_revnum, fstream,
-                              &real_rev, &new_props, pool));
+      /* Fetch the file content. While doing so, resolve pair->src_revnum
+       * to an actual revision number if it's 'invalid' meaning 'head'. */
+      SVN_ERR(svn_ra_get_file(ra_session, src_rel, pair->src_revnum, fstream,
+                              &pair->src_revnum, &new_props, pool));
       SVN_ERR(svn_stream_close(fstream));
 
-      /* If SRC_REVNUM is invalid (HEAD), then REAL_REV is now the
-         revision that was actually retrieved.  This is the value we
-         want to use as 'copyfrom_rev' below. */
-      if (! SVN_IS_VALID_REVNUM(src_revnum))
-        src_revnum = real_rev;
-
       SVN_ERR(svn_stream_open_readonly(&new_base_contents, new_text_path,
                                        pool, pool));
       SVN_ERR(svn_wc_add_repos_file4(
          ctx->wc_ctx, dst_abspath,
          new_base_contents, NULL, new_props, NULL,
          same_repositories ? pair->src_abspath_or_url : NULL,
-         same_repositories ? src_revnum : SVN_INVALID_REVNUM,
+         same_repositories ? pair->src_revnum : SVN_INVALID_REVNUM,
          ctx->cancel_func, ctx->cancel_baton,
-         ctx->notify_func2, ctx->notify_baton2,
          pool));
+    }
 
-      SVN_ERR(calculate_target_mergeinfo(ra_session, &src_mergeinfo,
-                                         NULL, pair->src_abspath_or_url,
-                                         src_revnum, ctx, pool));
-      SVN_ERR(extend_wc_mergeinfo(dst_abspath, src_mergeinfo, ctx, pool));
-
-      /* Ideally, svn_wc_add_repos_file3() would take a notify function
-         and baton, and we wouldn't have to make this call here.
-         However, the situation is... complicated.  See issue #1552
-         for the full story. */
-      if (ctx->notify_func2)
-        {
-          svn_wc_notify_t *notify = svn_wc_create_notify(
-                                      pair->dst_abspath_or_url,
-                                      svn_wc_notify_add, pool);
-          notify->kind = pair->src_kind;
-          (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
-        }
-
-      svn_io_sleep_for_timestamps(pair->dst_abspath_or_url, pool);
+  /* Record the implied mergeinfo (before the notification callback
+     is invoked for the root node). */
+  SVN_ERR(calculate_target_mergeinfo(ra_session, &src_mergeinfo, NULL,
+                                     pair->src_abspath_or_url,
+                                     pair->src_revnum, ctx, pool));
+  SVN_ERR(extend_wc_mergeinfo(dst_abspath, src_mergeinfo, ctx, pool));
+
+  /* Do our own notification for the root node, even if we could possibly
+     have delegated it.  See also issue #1552.
+
+     ### Maybe this notification should mention the mergeinfo change. */
+  if (ctx->notify_func2)
+    {
+      svn_wc_notify_t *notify = svn_wc_create_notify(
+                                  dst_abspath, svn_wc_notify_add, pool);
+      notify->kind = pair->src_kind;
+      (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
     }
 
+  svn_io_sleep_for_timestamps(dst_abspath, pool);
+
   return SVN_NO_ERROR;
 }
 
@@ -1754,7 +1790,8 @@ repos_to_wc_copy(const apr_array_header_
       pair->src_abspath_or_url = apr_pstrdup(pool, src);
     }
 
-  get_copy_pair_ancestors(copy_pairs, &top_src_url, &top_dst_path, NULL, pool);
+  SVN_ERR(get_copy_pair_ancestors(copy_pairs, &top_src_url, &top_dst_path,
+                                  NULL, pool));
   lock_abspath = top_dst_path;
   if (copy_pairs->nelts == 1)
     {
@@ -1866,7 +1903,6 @@ static svn_error_t *
 try_copy(const apr_array_header_t *sources,
          const char *dst_path_in,
          svn_boolean_t is_move,
-         svn_boolean_t force,
          svn_boolean_t make_parents,
          svn_boolean_t ignore_externals,
          const apr_hash_t *revprop_table,
@@ -2028,29 +2064,28 @@ try_copy(const apr_array_header_t *sourc
 
   if (is_move)
     {
-      if (srcs_are_urls == dst_is_url)
+      /* Disallow moves between the working copy and the repository. */
+      if (srcs_are_urls != dst_is_url)
         {
-          for (i = 0; i < copy_pairs->nelts; i++)
-            {
-              svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
-                                                svn_client__copy_pair_t *);
-
-              if (strcmp(pair->src_abspath_or_url,
-                         pair->dst_abspath_or_url) == 0)
-                return svn_error_createf
-                  (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
-                   _("Cannot move path '%s' into itself"),
-                   svn_dirent_local_style(pair->src_abspath_or_url, pool));
-            }
-        }
-      else
-        {
-          /* Disallow moves between the working copy and the repository. */
           return svn_error_create
             (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
              _("Moves between the working copy and the repository are not "
                "supported"));
         }
+
+      /* Disallow moving any path onto or into itself. */
+      for (i = 0; i < copy_pairs->nelts; i++)
+        {
+          svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
+                                            svn_client__copy_pair_t *);
+
+          if (strcmp(pair->src_abspath_or_url,
+                     pair->dst_abspath_or_url) == 0)
+            return svn_error_createf
+              (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+               _("Cannot move path '%s' into itself"),
+               svn_dirent_local_style(pair->src_abspath_or_url, pool));
+        }
     }
   else
     {
@@ -2203,7 +2238,6 @@ svn_client_copy6(const apr_array_header_
 
   err = try_copy(sources, dst_path,
                  FALSE /* is_move */,
-                 TRUE /* force, set to avoid deletion check */,
                  make_parents,
                  ignore_externals,
                  revprop_table,
@@ -2236,7 +2270,6 @@ svn_client_copy6(const apr_array_header_
                          ? svn_uri_join(dst_path, src_basename, subpool)
                          : svn_dirent_join(dst_path, src_basename, subpool),
                      FALSE /* is_move */,
-                     TRUE /* force, set to avoid deletion check */,
                      make_parents,
                      ignore_externals,
                      revprop_table,
@@ -2253,7 +2286,6 @@ svn_client_copy6(const apr_array_header_
 svn_error_t *
 svn_client_move6(const apr_array_header_t *src_paths,
                  const char *dst_path,
-                 svn_boolean_t force,
                  svn_boolean_t move_as_child,
                  svn_boolean_t make_parents,
                  const apr_hash_t *revprop_table,
@@ -2289,7 +2321,6 @@ svn_client_move6(const apr_array_header_
 
   err = try_copy(sources, dst_path,
                  TRUE /* is_move */,
-                 force,
                  make_parents,
                  FALSE,
                  revprop_table,
@@ -2319,7 +2350,6 @@ svn_client_move6(const apr_array_header_
                          ? svn_uri_join(dst_path, src_basename, pool)
                          : svn_dirent_join(dst_path, src_basename, pool),
                      TRUE /* is_move */,
-                     force,
                      make_parents,
                      FALSE,
                      revprop_table,

Modified: subversion/branches/py-tests-as-modules/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/py-tests-as-modules/subversion/libsvn_client/delete.c?rev=1031230&r1=1031229&r2=1031230&view=diff
==============================================================================
--- subversion/branches/py-tests-as-modules/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/py-tests-as-modules/subversion/libsvn_client/delete.c Thu Nov  4 20:48:21 2010
@@ -162,7 +162,7 @@ delete_urls(const apr_array_header_t *pa
     {
       const char *bname;
       svn_uri_split(&common, &bname, common, pool);
-      APR_ARRAY_PUSH(targets, const char *) = svn_path_uri_decode(bname, pool);
+      APR_ARRAY_PUSH(targets, const char *) = bname;
     }
 
   /* Create new commit items and add them to the array. */
@@ -206,7 +206,7 @@ delete_urls(const apr_array_header_t *pa
       const char *item_url;
 
       svn_pool_clear(subpool);
-      item_url = svn_path_url_add_component2(common, path, subpool);
+      item_url = svn_uri_join(common, path, subpool);
       path = svn_path_uri_decode(path, pool);
       APR_ARRAY_IDX(targets, i, const char *) = path;