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/08/11 00:07:31 UTC
svn commit: r984234 [4/20] - in /subversion/branches/ignore-mergeinfo: ./
build/ build/ac-macros/ build/generator/ notes/ notes/api-errata/
notes/obliterate/ notes/obliterate/fspec-cc1/ notes/rename-tracking/
notes/svnpatch/ notes/tree-conflicts/ notes...
Modified: subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/include/svn_wc.h Tue Aug 10 22:07:24 2010
@@ -994,7 +994,8 @@ typedef enum svn_wc_notify_action_t
svn_wc_notify_changelist_clear,
/** Warn user that a path has moved from one changelist to another.
- @since New in 1.5. */
+ @since New in 1.5.
+ @deprecated As of 1.7, separate clear and set notifications are sent. */
svn_wc_notify_changelist_moved,
/** A merge operation (to path) has begun. See #svn_wc_notify_t.merge_range.
@@ -1209,7 +1210,7 @@ typedef struct svn_wc_notify_t {
*/
svn_revnum_t revision;
- /** When @c action is #svn_wc_notify_changelist_add or name. (### What?)
+ /** If @c action pertains to a changelist, this is the changelist name.
* In all other cases, it is @c NULL. @since New in 1.5 */
const char *changelist_name;
@@ -3532,8 +3533,16 @@ typedef struct svn_wc_status3_t
* (#svn_depth_unknown for files or when no depth is set) */
svn_depth_t depth;
- /** Can be @c NULL if not under version control. */
- const svn_wc_entry_t *entry;
+ /** If the path is under version control, versioned is TRUE, otherwise
+ * FALSE. */
+ svn_boolean_t versioned;
+
+ /** Set to TRUE if the item is the victim of a conflict. */
+ svn_boolean_t conflicted;
+
+ /** The status of the node itself. In order of precendence: Tree conflicts,
+ * structural changes, text changes (including text conflicts). */
+ enum svn_wc_status_kind node_status;
/** The status of the entry itself, including its text if it is a file. */
enum svn_wc_status_kind text_status;
@@ -3541,30 +3550,43 @@ typedef struct svn_wc_status3_t
/** The status of the entry's properties. */
enum svn_wc_status_kind prop_status;
- /** a directory can be 'locked' if a working copy update was interrupted. */
- svn_boolean_t locked;
-
/** a file or directory can be 'copied' if it's scheduled for
* addition-with-history (or part of a subtree that is scheduled as such.).
*/
svn_boolean_t copied;
- /** a file or directory can be 'switched' if the switch command has been
+ /** Base revision. */
+ svn_revnum_t revision;
+
+ /** Last revision this was changed */
+ svn_revnum_t changed_rev;
+
+ /** Date of last commit. */
+ apr_time_t changed_date;
+
+ /** Last commit author of this item */
+ const char *changed_author;
+
+ /** The URL of the repository */
+ const char *repos_root_url;
+
+ /** The in-repository path relative to the repository root.
+ * Use svn_path_url_component2() to join this value to the
+ * repos_root_url to get the full URL.
+ */
+ const char *repos_relpath;
+
+ /** a file or directory can be 'switched' if the switch command has been
* used. If this is TRUE, then file_external will be FALSE.
*/
svn_boolean_t switched;
- /** The entry's text status in the repository. */
- enum svn_wc_status_kind repos_text_status;
-
- /** The entry's property status in the repository. */
- enum svn_wc_status_kind repos_prop_status;
-
- /** The entry's lock in the repository, if any. */
- const svn_lock_t *repos_lock;
+ /** The locally present lock. (Values of path, token, owner, comment and
+ * are available if a lock is present) */
+ const svn_lock_t *lock;
- /** Set to the URI (actual or expected) of the item. */
- const char *url;
+ /** Which changelist this item is part of, or NULL if not part of any. */
+ const char *changelist;
/**
* @defgroup svn_wc_status_ood WC out-of-date info from the repository
@@ -3577,93 +3599,38 @@ typedef struct svn_wc_status3_t
* below.
*/
- /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM
- * if not out of date.
- */
- svn_revnum_t ood_last_cmt_rev;
-
- /** Set to the most recent commit date, or @c 0 if not out of date.
- */
- apr_time_t ood_last_cmt_date;
-
/** Set to the node kind of the youngest commit, or #svn_node_none
- * if not out of date.
- */
+ * if not out of date. */
svn_node_kind_t ood_kind;
- /** Set to the user name of the youngest commit, or @c NULL if not
- * out of date or non-existent. Because a non-existent @c
- * svn:author property has the same behavior as an out-of-date
- * working copy, examine @c ood_last_cmt_rev to determine whether
- * the working copy is out of date.
- */
- const char *ood_last_cmt_author;
-
- /** @} */
-
- /** If the item is a file that was added to the working copy with an
- * svn:externals; if file_external is TRUE, then switched is always
- * FALSE.
- */
- svn_boolean_t file_external;
-
- /** The actual status of the text compared to the pristine base of the
- * file. This value isn't masked by other working copy statuses.
- * @c pristine_text_status is #svn_wc_status_none if this value was
- * not calculated during the status walk.
- */
- enum svn_wc_status_kind pristine_text_status;
-
- /** The actual status of the properties compared to the pristine base of
- * the node. This value isn't masked by other working copy statuses.
- * @c pristine_prop_status is #svn_wc_status_none if this value was
- * not calculated during the status walk.
- */
- enum svn_wc_status_kind pristine_prop_status;
-
- /** Base revision. */
- svn_revnum_t revision;
+ /** The status of the node, based on the text status if the node has no
+ * restructuring changes */
+ enum svn_wc_status_kind repos_node_status;
- /** Last revision this was changed */
- svn_revnum_t changed_rev;
-
- /** Last commit author of this item */
- const char *changed_author;
-
- /** Date of last commit. */
- apr_time_t changed_date;
-
- /** The locally present lock token.
- */
- const char *lock_token;
-
- /** The locally present lock owner.
- */
- const char *lock_owner;
+ /** The entry's text status in the repository. */
+ enum svn_wc_status_kind repos_text_status;
- /** The locally present lock comment.
- */
- const char *lock_comment;
+ /** The entry's property status in the repository. */
+ enum svn_wc_status_kind repos_prop_status;
- /** The locally present lock creation date.
- */
- apr_time_t lock_creation_date;
-
- /** Set to TRUE if the item is the victim of a conflict. */
- svn_boolean_t conflicted;
+ /** The entry's lock in the repository, if any. */
+ const svn_lock_t *repos_lock;
- /** If the path is under version control, versioned is TRUE. */
- svn_boolean_t versioned;
+ /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM
+ * if not out of date. */
+ svn_revnum_t ood_changed_rev;
- /** Which changelist this item is part of, or NULL if not part of any. */
- const char *changelist;
+ /** Set to the most recent commit date, or @c 0 if not out of date. */
+ apr_time_t ood_changed_date;
- /** The leading part of the url, not including the wc root and subsequent
- * paths. */
- const char *repos_root_url;
+ /** Set to the user name of the youngest commit, or @c NULL if not
+ * out of date or non-existent. Because a non-existent @c
+ * svn:author property has the same behavior as an out-of-date
+ * working copy, examine @c ood_last_cmt_rev to determine whether
+ * the working copy is out of date. */
+ const char *ood_changed_author;
- /** The path relative to the wc root. */
- const char *repos_relpath;
+ /** @} */
/* NOTE! Please update svn_wc_dup_status3() when adding new fields here. */
} svn_wc_status3_t;
@@ -4412,39 +4379,34 @@ svn_wc_delete(const char *path,
apr_pool_t *pool);
/**
- * Register @a local_abspath as a new file external aimed at
- * @a external_url, @a external_peg_rev, and @a external_rev.
+ * 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
+ * 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
+ * by code like that of 'svn cp URL@rev path' @a copyfrom_url and
+ * @a copyfrom_rev MUST BE the the url and revision of @a local_abspath
+ * in the separate working copy.
+ *
+ * 2a) If the node was not versioned before it will be scheduled as a local
+ * addition or 2b) if @a copyfrom_url and @a copyfrom_rev are set as a copy
+ * 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
+ * using this variant.
*
- * If not @c NULL, @a external_peg_rev and @a external_rev must each
- * be of kind @c svn_opt_revision_number or @c svn_opt_revision_head.
+ * If @a local_abspath does not exist as file, directory or symlink, return
+ * #SVN_ERR_WC_PATH_NOT_FOUND.
*
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_register_file_external(svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- const char *external_url,
- const svn_opt_revision_t *external_peg_rev,
- const svn_opt_revision_t *external_rev,
- apr_pool_t *scratch_pool);
-
-/**
- * Put @a local_abspath under version control by adding an entry in its
- * parent, and if @a local_abspath is a directory, adding an
- * administrative area. The new node and anything under it is scheduled
- * for addition to the repository. @a wc_ctx should hold a write lock
- * for the parent directory of @a local_abspath. If @a local_abspath is
- * a directory then an access baton for @a local_abspath will be added
- * to the set containing @a parent_access.
- *
- * If @a local_abspath does not exist, return #SVN_ERR_WC_PATH_NOT_FOUND.
- *
- * If @a local_abspath is a directory, add it at @a depth; otherwise, ignore
- * @a depth.
- *
- * If @a copyfrom_url is non-NULL, it and @a copyfrom_rev are used as
- * `copyfrom' args. This is for copy operations, where one wants
- * to schedule @a local_abspath for addition with a particular history.
+ * If @a local_abspath is an unversioned directory, record @a depth on it;
+ * otherwise, ignore @a depth. (Use #svn_depth_infinity unless you exactly
+ * know what you are doing, or you may create an unexpected sparse working
+ * copy)
*
* If @a cancel_func is non-NULL, call it with @a cancel_baton at
* various points during the operation. If it returns an error
@@ -4453,39 +4415,6 @@ svn_wc_register_file_external(svn_wc_con
* 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.
*
- * Return #SVN_ERR_WC_NODE_KIND_CHANGE if @a local_abspath is both an
- * unversioned directory and a file that is scheduled for deletion or in
- * state deleted.
- *
- *<pre> ### This function currently does double duty -- it is also
- * ### responsible for "switching" a working copy directory over to a
- * ### new copyfrom ancestry and scheduling it for addition. Here is
- * ### the old doc string from Ben, lightly edited to bring it
- * ### up-to-date, explaining the TRUE, secret life of this function:</pre>
- *
- * Given a @a path within a working copy of type KIND, follow this algorithm:
- *
- * - if @a path is not under version control:
- * - Place it under version control and schedule for addition;
- * if @a copyfrom_url is non-NULL, use it and @a copyfrom_rev as
- * 'copyfrom' history
- *
- * - if @a path is already under version control:
- * (This can only happen when a directory is copied, in which
- * case ancestry must have been supplied as well.)
- *
- * - Schedule the directory itself for addition with copyfrom history.
- * - Mark all its children with a 'copied' flag
- * - Rewrite all the URLs to what they will be after a commit.
- * - ### @todo Remove old wcprops too, see the '###' below.
- *
- *<pre> ### I think possibly the "switchover" functionality should be
- * ### broken out into a separate function, but it's all intertwined in
- * ### the code right now. Ben, thoughts? Hard? Easy? Mauve?</pre>
- *
- * ### Update: see "###" comment in svn_wc_add_repos_file3()'s doc
- * string about this.
- *
* @since New in 1.7.
*/
svn_error_t *
@@ -6368,11 +6297,10 @@ typedef enum svn_wc_merge_outcome_t
* @a left_abspath and @a right_abspath into @a target_abspath.
* It may help to know that @a left_abspath, @a right_abspath and @a
* target_abspath correspond to "OLDER", "YOURS", and "MINE",
- * respectively, in the diff3 documentation.) Use @a scratch_pool for any
- * temporary allocation.
+ * respectively, in the diff3 documentation.
*
* @a wc_ctx should contain a write lock for the directory containing @a
- * merge_target.
+ * target_abspath.
*
* This function assumes that @a left_abspath and @a right_abspath are
* in repository-normal form (linefeeds, with keywords contracted); if
@@ -6409,7 +6337,7 @@ typedef enum svn_wc_merge_outcome_t
*
* * Copy @a left_abspath, @a right_abspath, and the original @a
* target_abspath to unique names in the same directory as @a
- * merge_target, ending with the suffixes ".LEFT_LABEL", ".RIGHT_LABEL",
+ * target_abspath, ending with the suffixes ".LEFT_LABEL", ".RIGHT_LABEL",
* and ".TARGET_LABEL" respectively.
*
* * Mark @a target_abspath as "text-conflicted", and track the above
@@ -6431,6 +6359,8 @@ typedef enum svn_wc_merge_outcome_t
* If @a dry_run is @c TRUE no files are changed. The outcome of the merge
* is returned in @a *merge_outcome.
*
+ * Use @a scratch_pool for any temporary allocation.
+ *
* @since New in 1.7.
*/
svn_error_t *
@@ -7127,16 +7057,17 @@ svn_wc_translated_file(const char **xlat
apr_pool_t *pool);
-/** Returns a @a stream allocated in @a result_pool with access to the given
- * @a local_abspath taking the file properties from @a versioned_abspath
- * using @a wc_ctx.
- *
- * When translation from normal form is requested
- * (#SVN_WC_TRANSLATE_FROM_NF is specified in @a flags), @a path
- * is used as target path and stream read operations are not supported.
- * Conversely, if translation to normal form is requested
- * (#SVN_WC_TRANSLATE_TO_NF is specified in @a flags), @a path is
- * used as source path and stream write operations are not supported.
+/** Set @a stream to a stream allocated in @a result_pool, that will
+ * translate *to* normal form while reading, or *from* normal form while
+ * writing @a local_abspath. The translation will take the file properties
+ * from @a versioned_abspath using @a wc_ctx.
+ *
+ * If @a flags includes #SVN_WC_TRANSLATE_FROM_NF, the stream will
+ * translate from Normal Form to working copy form while writing to
+ * @a local_abspath; stream read operations are not supported.
+ * Conversely, if @a flags includes #SVN_WC_TRANSLATE_TO_NF, the stream will
+ * translate from working copy form to Normal Form while reading from
+ * @a local_abspath; stream write operations are not supported.
*
* The @a flags are the same constants as those used for
* svn_wc_translated_file().
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/add.c Tue Aug 10 22:07:24 2010
@@ -734,7 +734,7 @@ mkdir_urls(svn_commit_info_t **commit_in
if (! targets->nelts)
{
const char *bname;
- svn_uri_split(common, &common, &bname, pool);
+ svn_uri_split(&common, &bname, common, pool);
APR_ARRAY_PUSH(targets, const char *) = bname;
}
else
@@ -756,7 +756,7 @@ mkdir_urls(svn_commit_info_t **commit_in
if (resplit)
{
const char *bname;
- svn_uri_split(common, &common, &bname, pool);
+ svn_uri_split(&common, &bname, common, pool);
for (i = 0; i < targets->nelts; i++)
{
const char *path = APR_ARRAY_IDX(targets, i, const char *);
@@ -768,6 +768,11 @@ mkdir_urls(svn_commit_info_t **commit_in
qsort(targets->elts, targets->nelts, targets->elt_size,
svn_sort_compare_paths);
+ /* ### This reparent may be problematic in limited-authz-to-common-parent
+ ### scenarios (compare issue #3242). See also issue #3649. */
+ if (ra_session)
+ SVN_ERR(svn_ra_reparent(ra_session, common, pool));
+
/* Create new commit items and add them to the array. */
if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
{
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/blame.c Tue Aug 10 22:07:24 2010
@@ -787,13 +787,16 @@ svn_client_blame5(const char *target,
if (!eof || sb->len)
{
if (walk->rev)
- SVN_ERR(receiver(receiver_baton, line_no, walk->rev->revision,
+ SVN_ERR(receiver(receiver_baton, start_revnum, end_revnum,
+ line_no, walk->rev->revision,
walk->rev->rev_props, merged_rev,
merged_rev_props, merged_path,
sb->data, FALSE, iterpool));
else
- SVN_ERR(receiver(receiver_baton, line_no, SVN_INVALID_REVNUM,
- NULL, SVN_INVALID_REVNUM, NULL, NULL,
+ SVN_ERR(receiver(receiver_baton, start_revnum, end_revnum,
+ line_no, SVN_INVALID_REVNUM,
+ NULL, SVN_INVALID_REVNUM,
+ NULL, NULL,
sb->data, TRUE, iterpool));
}
if (eof) break;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/client.h Tue Aug 10 22:07:24 2010
@@ -1028,15 +1028,15 @@ svn_client__fetch_externals(apr_hash_t *
/* Perform status operations on each external in TRAVERSAL_INFO. All
other options are the same as those passed to svn_client_status4(). */
svn_error_t *
-svn_client__do_external_status(apr_hash_t *external_defs,
- svn_wc_status_func4_t status_func,
- void *status_baton,
+svn_client__do_external_status(svn_client_ctx_t *ctx,
+ apr_hash_t *external_defs,
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t update,
svn_boolean_t no_ignore,
apr_hash_t *ignored_props,
- svn_client_ctx_t *ctx,
+ svn_client_status_func_t status_func,
+ void *status_baton,
apr_pool_t *pool);
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit.c Tue Aug 10 22:07:24 2010
@@ -728,7 +728,7 @@ svn_client_import3(svn_commit_info_t **c
else
svn_error_clear(err);
- svn_uri_split(url, &temp, &dir, pool);
+ svn_uri_split(&temp, &dir, url, pool);
APR_ARRAY_PUSH(new_entries, const char *) =
svn_path_uri_decode(dir, pool);
url = temp;
@@ -1028,8 +1028,8 @@ check_nonrecursive_dir_delete(const char
pristine compare etc. */
SVN_ERR(svn_wc_status3(&status, wc_ctx, target_abspath, pool,
pool));
- if (status->text_status == svn_wc_status_deleted ||
- status->text_status == svn_wc_status_replaced)
+ if (status->node_status == svn_wc_status_deleted ||
+ status->node_status == svn_wc_status_replaced)
{
const apr_array_header_t *children;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/commit_util.c Tue Aug 10 22:07:24 2010
@@ -522,7 +522,7 @@ harvest_committables(apr_hash_t *committ
svn_boolean_t is_copy_target;
/* ### TODO: sensibly align this call of get_copyfrom_info() with
* the same call below (when checking added nodes). */
- SVN_ERR(svn_wc__node_get_copyfrom_info(&is_copy, NULL,
+ SVN_ERR(svn_wc__node_get_copyfrom_info(NULL, NULL, &is_copy, NULL,
&is_copy_target, ctx->wc_ctx,
local_abspath, scratch_pool,
scratch_pool));
@@ -543,7 +543,7 @@ harvest_committables(apr_hash_t *committ
{
svn_boolean_t is_copy_target;
- SVN_ERR(svn_wc__node_get_copyfrom_info(&node_copyfrom_url,
+ SVN_ERR(svn_wc__node_get_copyfrom_info(NULL, NULL, &node_copyfrom_url,
&node_copyfrom_rev,
&is_copy_target,
ctx->wc_ctx, local_abspath,
@@ -572,7 +572,8 @@ harvest_committables(apr_hash_t *committ
const char *parent_abspath = svn_dirent_dirname(local_abspath,
scratch_pool);
- SVN_ERR(svn_wc__node_get_copyfrom_info(&parent_copyfrom_url,
+ SVN_ERR(svn_wc__node_get_copyfrom_info(NULL, NULL,
+ &parent_copyfrom_url,
&parent_copyfrom_rev,
NULL,
ctx->wc_ctx, parent_abspath,
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/copy.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/copy.c Tue Aug 10 22:07:24 2010
@@ -92,18 +92,18 @@ calculate_target_mergeinfo(svn_ra_sessio
if (local_abspath)
{
svn_boolean_t is_added;
- const char *copyfrom_url;
+ const char *is_copied;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
SVN_ERR(svn_wc__node_is_added(&is_added, ctx->wc_ctx,
local_abspath, pool));
if (is_added)
- SVN_ERR(svn_wc__node_get_copyfrom_info(©from_url, NULL, NULL,
- ctx->wc_ctx, local_abspath,
- pool, pool));
+ SVN_ERR(svn_wc__node_get_copyfrom_info(&is_copied, NULL, NULL,
+ NULL, NULL, ctx->wc_ctx,
+ local_abspath, pool, pool));
- if (is_added && !copyfrom_url)
+ if (is_added && ! is_copied)
{
locally_added = TRUE;
}
@@ -483,8 +483,8 @@ wc_to_wc_copy(const apr_array_header_t *
_("Path '%s' already exists"),
svn_dirent_local_style(pair->dst_abspath_or_url, pool));
- svn_dirent_split(pair->dst_abspath_or_url, &pair->dst_parent_abspath,
- &pair->base_name, pool);
+ svn_dirent_split(&pair->dst_parent_abspath, &pair->base_name,
+ pair->dst_abspath_or_url, pool);
/* Make sure the destination parent is a directory and produce a clear
error message if it is not. */
@@ -703,7 +703,7 @@ find_absent_parents2(svn_ra_session_t *r
while (kind == svn_node_none)
{
APR_ARRAY_PUSH(new_dirs, const char *) = root_url;
- svn_uri_split(root_url, &root_url, NULL, pool);
+ root_url = svn_uri_dirname(root_url, pool);
SVN_ERR(svn_ra_reparent(ra_session, root_url, pool));
SVN_ERR(svn_ra_check_path(ra_session, "", SVN_INVALID_REVNUM, &kind,
@@ -1205,7 +1205,7 @@ wc_to_repos_copy(svn_commit_info_t **com
* It looks like the entire block of code hanging off this comment
* is redundant. */
first_pair = APR_ARRAY_IDX(copy_pairs, 0, svn_client__copy_pair_t *);
- svn_uri_split(first_pair->dst_abspath_or_url, &top_dst_url, NULL, pool);
+ top_dst_url = svn_uri_dirname(first_pair->dst_abspath_or_url, pool);
for (i = 1; i < copy_pairs->nelts; i++)
{
svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
@@ -2102,8 +2102,8 @@ try_copy(svn_commit_info_t **commit_info
SVN_ERR_ASSERT(svn_dirent_is_absolute(pair->src_abspath_or_url));
SVN_ERR(svn_wc__node_get_copyfrom_info(
- ©from_url, ©from_rev, NULL, ctx->wc_ctx,
- pair->src_abspath_or_url, pool, iterpool));
+ NULL, NULL, ©from_url, ©from_rev, NULL,
+ ctx->wc_ctx, pair->src_abspath_or_url, pool, iterpool));
if (copyfrom_url)
{
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/delete.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/delete.c Tue Aug 10 22:07:24 2010
@@ -45,16 +45,16 @@
/*** Code. ***/
-/* An svn_wc_status_func4_t callback function for finding
+/* An svn_client_status_func_t callback function for finding
status structures which are not safely deletable. */
static svn_error_t *
find_undeletables(void *baton,
const char *path,
- const svn_wc_status3_t *status,
+ const svn_client_status_t *status,
apr_pool_t *pool)
{
/* Check for error-ful states. */
- if (status->text_status == svn_wc_status_obstructed)
+ if (status->node_status == svn_wc_status_obstructed)
return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("'%s' is in the way of the resource "
"actually under version control"),
@@ -64,9 +64,9 @@ find_undeletables(void *baton,
_("'%s' is not under version control"),
svn_dirent_local_style(path, pool));
- else if ((status->text_status != svn_wc_status_normal
- && status->text_status != svn_wc_status_deleted
- && status->text_status != svn_wc_status_missing)
+ else if ((status->node_status != svn_wc_status_normal
+ && status->node_status != svn_wc_status_deleted
+ && status->node_status != svn_wc_status_missing)
||
(status->prop_status != svn_wc_status_none
&& status->prop_status != svn_wc_status_normal))
@@ -82,7 +82,7 @@ find_undeletables(void *baton,
svn_error_t *
svn_client__can_delete(const char *path,
svn_client_ctx_t *ctx,
- apr_pool_t *pool)
+ apr_pool_t *scratch_pool)
{
svn_opt_revision_t revision;
svn_boolean_t file_external;
@@ -90,21 +90,22 @@ svn_client__can_delete(const char *path,
revision.kind = svn_opt_revision_unspecified;
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
/* A file external should not be deleted since the file external is
implemented as a switched file and it would delete the file the
file external is switched to, which is not the behavior the user
would probably want. */
SVN_ERR(svn_wc__node_is_file_external(&file_external, ctx->wc_ctx,
- local_abspath, pool));
+ local_abspath, scratch_pool));
if (file_external)
return svn_error_createf(SVN_ERR_WC_CANNOT_DELETE_FILE_EXTERNAL, NULL,
_("Cannot remove the file external at '%s'; "
"please propedit or propdel the svn:externals "
"description that created it"),
- svn_dirent_local_style(local_abspath, pool));
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
/* Use an infinite-depth status check to see if there's anything in
@@ -112,11 +113,12 @@ svn_client__can_delete(const char *path,
status callback function find_undeletables() makes the
determination, returning an error if it finds anything that shouldn't
be deleted. */
- return svn_error_return(svn_client_status5(NULL, path, &revision,
- find_undeletables, NULL,
+ return svn_error_return(svn_client_status5(NULL, ctx, path, &revision,
svn_depth_infinity, FALSE,
FALSE, FALSE, FALSE, FALSE,
- NULL, ctx, pool));
+ NULL,
+ find_undeletables, NULL,
+ scratch_pool));
}
@@ -159,7 +161,7 @@ delete_urls(svn_commit_info_t **commit_i
if (! targets->nelts)
{
const char *bname;
- svn_uri_split(common, &common, &bname, pool);
+ svn_uri_split(&common, &bname, common, pool);
APR_ARRAY_PUSH(targets, const char *) = svn_path_uri_decode(bname, pool);
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/deprecated.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/deprecated.c Tue Aug 10 22:07:24 2010
@@ -119,6 +119,8 @@ struct blame_receiver_wrapper_baton2 {
static svn_error_t *
blame_wrapper_receiver2(void *baton,
+ svn_revnum_t start_revnum,
+ svn_revnum_t end_revnum,
apr_int64_t line_no,
svn_revnum_t revision,
apr_hash_t *rev_props,
@@ -638,7 +640,7 @@ svn_client_diff4(const apr_array_header_
return svn_client_diff5(options, path1, revision1, path2,
revision2, relative_to_dir, depth,
ignore_ancestry, no_diff_deleted, FALSE,
- ignore_content_type, FALSE, header_encoding,
+ ignore_content_type, FALSE, FALSE, header_encoding,
outfile, errfile, changelists, ctx, pool);
}
@@ -734,6 +736,7 @@ svn_client_diff_peg4(const apr_array_hea
ignore_ancestry,
no_diff_deleted,
FALSE,
+ FALSE,
ignore_content_type,
FALSE,
header_encoding,
@@ -1471,18 +1474,20 @@ struct status4_wrapper_baton
void *old_baton;
};
+/* Implements svn_client_status_func_t */
static svn_error_t *
status4_wrapper_func(void *baton,
const char *path,
- const svn_wc_status3_t *status,
+ const svn_client_status_t *status,
apr_pool_t *scratch_pool)
{
struct status4_wrapper_baton *swb = baton;
svn_wc_status2_t *dup;
const char *local_abspath;
+ const svn_wc_status3_t *wc_status = status->backwards_compatibility_baton;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
- SVN_ERR(svn_wc__status2_from_3(&dup, status, swb->wc_ctx,
+ SVN_ERR(svn_wc__status2_from_3(&dup, wc_status, swb->wc_ctx,
local_abspath, scratch_pool,
scratch_pool));
@@ -1507,9 +1512,9 @@ svn_client_status4(svn_revnum_t *result_
struct status4_wrapper_baton swb = { status_func, ctx->wc_ctx,
status_baton };
- return svn_client_status5(result_rev, path, revision, status4_wrapper_func,
- &swb, depth, get_all, update, no_ignore,
- ignore_externals, FALSE, changelists, ctx, pool);
+ return svn_client_status5(result_rev, ctx, path, revision, depth, get_all,
+ update, no_ignore, ignore_externals, FALSE,
+ changelists, status4_wrapper_func, &swb, pool);
}
struct status3_wrapper_baton
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/diff.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/diff.c Tue Aug 10 22:07:24 2010
@@ -246,11 +246,11 @@ display_prop_diffs(const apr_array_heade
continue;
if (! original_value)
- action = _("Added");
+ action = "Added";
else if (! propchange->value)
- action = _("Deleted");
+ action = "Deleted";
else
- action = _("Modified");
+ action = "Modified";
/* Lazily print the property diff header. */
if (!header_printed)
@@ -321,6 +321,90 @@ display_prop_diffs(const apr_array_heade
}
+/*
+ * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
+ * All allocations are done in RESULT_POOL. */
+static svn_error_t *
+print_git_diff_header_added(svn_stream_t *os, const char *header_encoding,
+ const char *path, apr_pool_t *result_pool)
+{
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "diff --git a/%s b/%s%s",
+ path, path, APR_EOL_STR));
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "new file mode 10644" APR_EOL_STR));
+ return SVN_NO_ERROR;
+}
+
+/*
+ * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
+ * All allocations are done in RESULT_POOL. */
+static svn_error_t *
+print_git_diff_header_deleted(svn_stream_t *os, const char *header_encoding,
+ const char *path, apr_pool_t *result_pool)
+{
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "diff --git a/%s b/%s%s",
+ path, path, APR_EOL_STR));
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "deleted file mode 10644"
+ APR_EOL_STR));
+ return SVN_NO_ERROR;
+}
+
+/*
+ * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
+ * COPYFROM_PATH is the origin of the operation. All allocations are done
+ * in RESULT_POOL. */
+static svn_error_t *
+print_git_diff_header_copied(svn_stream_t *os, const char *header_encoding,
+ const char *path, const char *copyfrom_path,
+ apr_pool_t *result_pool)
+{
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "diff --git a/%s b/%s%s",
+ copyfrom_path, path, APR_EOL_STR));
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "copy from %s%s", copyfrom_path,
+ APR_EOL_STR));
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "copy to %s%s", path, APR_EOL_STR));
+ return SVN_NO_ERROR;
+}
+
+/*
+ * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
+ * COPYFROM_PATH is the origin of the operation. All allocations are done
+ * in RESULT_POOL. */
+static svn_error_t *
+print_git_diff_header_moved(svn_stream_t *os, const char *header_encoding,
+ const char *path, const char *copyfrom_path,
+ apr_pool_t *result_pool)
+{
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "diff --git a/%s b/%s%s",
+ copyfrom_path, path, APR_EOL_STR));
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "rename from %s%s", copyfrom_path,
+ APR_EOL_STR));
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "rename to %s%s", path, APR_EOL_STR));
+ return SVN_NO_ERROR;
+}
+
+/*
+ * Print a git diff header for PATH to the stream OS using HEADER_ENCODING.
+ * All allocations are done in RESULT_POOL. */
+static svn_error_t *
+print_git_diff_header_modified(svn_stream_t *os, const char *header_encoding,
+ const char *path, apr_pool_t *result_pool)
+{
+ SVN_ERR(svn_stream_printf_from_utf8(os, header_encoding, result_pool,
+ "diff --git a/%s b/%s%s",
+ path, path, APR_EOL_STR));
+ return SVN_NO_ERROR;
+}
+
/*-----------------------------------------------------------------*/
/*** Callbacks for 'svn diff', invoked by the repos-diff editor. ***/
@@ -382,6 +466,10 @@ struct diff_cmd_baton {
/* Props which, when we encounter mods for, we ignore. */
apr_hash_t *ignored_props;
+
+ svn_boolean_t use_git_diff_format;
+
+ svn_wc_context_t *wc_ctx;
};
/* Generate a label for the diff output for file PATH at revision REVNUM.
@@ -449,6 +537,8 @@ diff_content_changed(const char *path,
svn_revnum_t rev2,
const char *mimetype1,
const char *mimetype2,
+ svn_diff_operation_kind_t operation,
+ const char *copyfrom_path,
void *diff_baton)
{
struct diff_cmd_baton *diff_cmd_baton = diff_baton;
@@ -553,6 +643,8 @@ diff_content_changed(const char *path,
(os, diff_cmd_baton->header_encoding, subpool,
"Index: %s" APR_EOL_STR "%s" APR_EOL_STR, path, equal_string));
+ /* ### Print git diff headers. */
+
SVN_ERR(svn_stream_printf_from_utf8
(os, diff_cmd_baton->header_encoding, subpool,
_("Cannot display: file marked as a binary type.%s"),
@@ -595,6 +687,11 @@ diff_content_changed(const char *path,
/* Close the stream (flush) */
SVN_ERR(svn_stream_close(os));
+ /* ### 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
+ * ### is up to the external diff application. We may be dealing with
+ * ### a non-git compatible diff application.*/
+
SVN_ERR(svn_io_run_diff2(".",
diff_cmd_baton->options.for_external.argv,
diff_cmd_baton->options.for_external.argc,
@@ -618,6 +715,71 @@ diff_content_changed(const char *path,
(os, diff_cmd_baton->header_encoding, subpool,
"Index: %s" APR_EOL_STR "%s" APR_EOL_STR,
path, equal_string));
+
+ if (diff_cmd_baton->use_git_diff_format)
+ {
+
+ /* Add git headers and adjust the labels.
+ * ### Once we're using the git format everywhere, we can create
+ * ### one func that sets the correct labels in one place. */
+ if (operation == svn_diff_op_deleted)
+ {
+ SVN_ERR(print_git_diff_header_deleted(
+ os,
+ diff_cmd_baton->header_encoding,
+ path, subpool));
+ label1 = diff_label(apr_psprintf(subpool, "a/%s", path1), rev1,
+ subpool);
+ label2 = diff_label("/dev/null", rev2, subpool);
+
+ }
+ else if (operation == svn_diff_op_copied)
+ {
+ SVN_ERR(print_git_diff_header_copied(
+ os,
+ diff_cmd_baton->header_encoding,
+ copyfrom_path, path, subpool));
+ label1 = diff_label(apr_psprintf(subpool, "a/%s", path1), rev1,
+ subpool);
+ label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), rev2,
+ subpool);
+ }
+ else if (operation == svn_diff_op_added)
+ {
+ SVN_ERR(print_git_diff_header_added(
+ os,
+ diff_cmd_baton->header_encoding,
+ path, subpool));
+ label1 = diff_label("/dev/null", rev1, subpool);
+ label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), rev2,
+ subpool);
+ }
+ else if (operation == svn_diff_op_modified)
+ {
+ SVN_ERR(print_git_diff_header_modified(
+ os,
+ diff_cmd_baton->header_encoding,
+ path, subpool));
+ label1 = diff_label(apr_psprintf(subpool, "a/%s", path1), rev1,
+ subpool);
+ label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), rev2,
+ subpool);
+ }
+ else if (operation == svn_diff_op_moved)
+ {
+ SVN_ERR(print_git_diff_header_moved(
+ os,
+ diff_cmd_baton->header_encoding,
+ copyfrom_path, path, subpool));
+ label1 = diff_label(apr_psprintf(subpool, "a/%s", path1), rev1,
+ subpool);
+ label2 = diff_label(apr_psprintf(subpool, "b/%s", path2), rev2,
+ subpool);
+ }
+
+ /* ### Print git headers for renames too. */
+ }
+
/* Output the actual diff */
SVN_ERR(svn_diff_file_output_unified3
(os, diff, tmpfile1, tmpfile2, label1, label2,
@@ -658,7 +820,8 @@ diff_file_changed(const char *local_dir_
if (tmpfile1)
SVN_ERR(diff_content_changed(path,
tmpfile1, tmpfile2, rev1, rev2,
- mimetype1, mimetype2, diff_baton));
+ mimetype1, mimetype2,
+ svn_diff_op_modified, NULL, diff_baton));
if (prop_changes->nelts > 0)
SVN_ERR(diff_props_changed(local_dir_abspath, prop_state, tree_conflicted,
path, prop_changes,
@@ -705,13 +868,62 @@ diff_file_added(const char *local_dir_ab
user see that *something* happened. */
diff_cmd_baton->force_empty = TRUE;
- SVN_ERR(diff_file_changed(local_dir_abspath, content_state, prop_state,
- tree_conflicted, path,
- tmpfile1, tmpfile2,
- rev1, rev2,
- mimetype1, mimetype2,
- prop_changes, original_props, diff_baton,
- scratch_pool));
+ /* ### We still can't detect moves without extending the parameters of
+ * ### file_added(). The *right* thing to do is propably to extend
+ * ### svn_wc_diff_callbacks4_t with file_copied() and file_moved(). */
+ if (tmpfile1 && copyfrom_path)
+ {
+ const char *repos_relpath;
+ char *ancestor_of_path;
+ const char *local_abspath;
+ int offset;
+ svn_diff_operation_kind_t op_kind = svn_diff_op_copied;
+
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
+
+ SVN_ERR(svn_wc__node_get_repos_relpath(&repos_relpath,
+ diff_cmd_baton->wc_ctx,
+ local_abspath, scratch_pool,
+ scratch_pool));
+
+ /* We need to determine if the copyfrom_path is within scope of the
+ * diff we're producing. If not we'll just mark it as an add.
+ * Determining scope involves checking two things; the dir we executed
+ * the command from (orig_path2) and the target of the command (path).
+ *
+ * ### We'll do the same thing for moves but then we'll have to
+ * ### consider the scope of both the delete-half and the add-half. */
+ ancestor_of_path = apr_pstrdup(scratch_pool, repos_relpath);
+
+ offset = strlen(repos_relpath) - strlen(path)
+ + strlen(diff_cmd_baton->orig_path_2);
+
+ ancestor_of_path[offset] = '\0';
+
+ if (strncmp(copyfrom_path, ancestor_of_path, strlen(ancestor_of_path)))
+ op_kind = svn_diff_op_added;
+
+ SVN_ERR(diff_content_changed(path,
+ tmpfile1, tmpfile2, rev1, rev2,
+ mimetype1, mimetype2,
+ op_kind, copyfrom_path,
+ diff_baton));
+ }
+ else if (tmpfile1)
+ SVN_ERR(diff_content_changed(path,
+ tmpfile1, tmpfile2, rev1, rev2,
+ mimetype1, mimetype2,
+ svn_diff_op_added, NULL, diff_baton));
+ if (prop_changes->nelts > 0)
+ SVN_ERR(diff_props_changed(local_dir_abspath, prop_state, tree_conflicted,
+ path, prop_changes,
+ original_props, diff_baton, scratch_pool));
+ if (content_state)
+ *content_state = svn_wc_notify_state_unknown;
+ if (prop_state)
+ *prop_state = svn_wc_notify_state_unknown;
+ if (tree_conflicted)
+ *tree_conflicted = FALSE;
diff_cmd_baton->force_empty = FALSE;
@@ -734,15 +946,21 @@ diff_file_deleted_with_diff(const char *
{
struct diff_cmd_baton *diff_cmd_baton = diff_baton;
+ if (tmpfile1)
+ SVN_ERR(diff_content_changed(path,
+ tmpfile1, tmpfile2, diff_cmd_baton->revnum1,
+ diff_cmd_baton->revnum2,
+ mimetype1, mimetype2,
+ svn_diff_op_deleted, NULL, diff_baton));
+
/* We don't list all the deleted properties. */
- return diff_file_changed(local_dir_abspath, state, NULL, tree_conflicted,
- path, tmpfile1, tmpfile2,
- diff_cmd_baton->revnum1, diff_cmd_baton->revnum2,
- mimetype1, mimetype2,
- apr_array_make(diff_cmd_baton->pool, 1,
- sizeof(svn_prop_t)),
- apr_hash_make(diff_cmd_baton->pool), diff_baton,
- scratch_pool);
+
+ if (state)
+ *state = svn_wc_notify_state_unknown;
+ if (tree_conflicted)
+ *tree_conflicted = FALSE;
+
+ return SVN_NO_ERROR;
}
/* An svn_wc_diff_callbacks4_t function. */
@@ -1140,9 +1358,9 @@ diff_prepare_repos_repos(const struct di
drr->target2 = "";
if ((kind1 == svn_node_file) || (kind2 == svn_node_file))
{
- svn_uri_split(drr->url1, &drr->anchor1, &drr->target1, pool);
+ svn_uri_split(&drr->anchor1, &drr->target1, drr->url1, pool);
drr->target1 = svn_path_uri_decode(drr->target1, pool);
- svn_uri_split(drr->url2, &drr->anchor2, &drr->target2, pool);
+ svn_uri_split(&drr->anchor2, &drr->target2, drr->url2, pool);
drr->target2 = svn_path_uri_decode(drr->target2, pool);
if (drr->base_path)
drr->base_path = svn_dirent_dirname(drr->base_path, pool);
@@ -1611,7 +1829,7 @@ do_diff_summarize(const struct diff_para
/* Initialize DIFF_CMD_BATON.diff_cmd and DIFF_CMD_BATON.options,
- * according to OPTIONS and CONFIG. CONFIG may be null.
+ * according to OPTIONS and CONFIG. CONFIG and OPTIONS may be null.
* Allocate the fields in POOL, which should be at least as long-lived
* as the pool DIFF_CMD_BATON itself is allocated in.
*/
@@ -1622,14 +1840,25 @@ set_up_diff_cmd_and_options(struct diff_
{
const char *diff_cmd = NULL;
- /* See if there is a command. */
+ /* See if there is a diff command and/or diff arguments. */
if (config)
{
svn_config_t *cfg = apr_hash_get(config, SVN_CONFIG_CATEGORY_CONFIG,
APR_HASH_KEY_STRING);
svn_config_get(cfg, &diff_cmd, SVN_CONFIG_SECTION_HELPERS,
SVN_CONFIG_OPTION_DIFF_CMD, NULL);
+ if (options == NULL)
+ {
+ const char *diff_extensions;
+ svn_config_get(cfg, &diff_extensions, SVN_CONFIG_SECTION_HELPERS,
+ SVN_CONFIG_OPTION_DIFF_EXTENSIONS, NULL);
+ if (diff_extensions)
+ options = svn_cstring_split(diff_extensions, " \t\n\r", TRUE, pool);
+ }
}
+
+ if (options == NULL)
+ options = apr_array_make(pool, 0, sizeof(const char *));
if (diff_cmd)
SVN_ERR(svn_path_cstring_to_utf8(&diff_cmd_baton->diff_cmd, diff_cmd,
@@ -1712,6 +1941,7 @@ svn_client_diff5(const apr_array_header_
svn_boolean_t no_diff_deleted,
svn_boolean_t show_copies_as_adds,
svn_boolean_t ignore_content_type,
+ svn_boolean_t use_git_diff_format,
svn_boolean_t ignore_mergeinfo,
const char *header_encoding,
apr_file_t *outfile,
@@ -1767,6 +1997,8 @@ svn_client_diff5(const apr_array_header_
diff_cmd_baton.force_empty = FALSE;
diff_cmd_baton.force_binary = ignore_content_type;
diff_cmd_baton.relative_to_dir = relative_to_dir;
+ diff_cmd_baton.use_git_diff_format = use_git_diff_format;
+ diff_cmd_baton.wc_ctx = ctx->wc_ctx;
if (ignore_mergeinfo)
{
@@ -1792,6 +2024,7 @@ svn_client_diff_peg5(const apr_array_hea
svn_boolean_t no_diff_deleted,
svn_boolean_t show_copies_as_adds,
svn_boolean_t ignore_content_type,
+ svn_boolean_t use_git_diff_format,
svn_boolean_t ignore_mergeinfo,
const char *header_encoding,
apr_file_t *outfile,
@@ -1843,6 +2076,8 @@ svn_client_diff_peg5(const apr_array_hea
diff_cmd_baton.force_empty = FALSE;
diff_cmd_baton.force_binary = ignore_content_type;
diff_cmd_baton.relative_to_dir = relative_to_dir;
+ diff_cmd_baton.use_git_diff_format = use_git_diff_format;
+ diff_cmd_baton.wc_ctx = ctx->wc_ctx;
if (ignore_mergeinfo)
{
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/export.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/export.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/export.c Tue Aug 10 22:07:24 2010
@@ -326,11 +326,11 @@ copy_versioned_files(const char *from,
from_abspath, pool));
if (is_added)
{
- const char *copyfrom_url;
- SVN_ERR(svn_wc__node_get_copyfrom_info(©from_url, NULL, NULL,
- ctx->wc_ctx, from_abspath,
- pool, pool));
- if (! copyfrom_url)
+ const char *is_copied;
+ SVN_ERR(svn_wc__node_get_copyfrom_info(&is_copied, NULL, NULL,
+ NULL, NULL, ctx->wc_ctx,
+ from_abspath, pool, pool));
+ if (! is_copied)
return SVN_NO_ERROR;
}
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/externals.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/externals.c Tue Aug 10 22:07:24 2010
@@ -116,7 +116,7 @@ relegate_dir_external(void *baton,
svn_error_clear(err);
err = SVN_NO_ERROR;
- svn_dirent_split(b->local_abspath, &parent_dir, &dirname, scratch_pool);
+ svn_dirent_split(&parent_dir, &dirname, b->local_abspath, scratch_pool);
/* Reserve the new dir name. */
SVN_ERR(svn_io_open_uniquely_named(NULL, &new_path,
@@ -439,8 +439,8 @@ switch_file_external(const char *path,
if (err)
goto cleanup;
- err = svn_wc_register_file_external(ctx->wc_ctx, local_abspath, url,
- peg_revision, revision, subpool);
+ err = svn_wc__register_file_external(ctx->wc_ctx, local_abspath, url,
+ peg_revision, revision, subpool);
if (err)
goto cleanup;
}
@@ -1301,15 +1301,15 @@ svn_client__fetch_externals(apr_hash_t *
svn_error_t *
-svn_client__do_external_status(apr_hash_t *externals_new,
- svn_wc_status_func4_t status_func,
- void *status_baton,
+svn_client__do_external_status(svn_client_ctx_t *ctx,
+ apr_hash_t *externals_new,
svn_depth_t depth,
svn_boolean_t get_all,
svn_boolean_t update,
svn_boolean_t no_ignore,
apr_hash_t *ignored_props,
- svn_client_ctx_t *ctx,
+ svn_client_status_func_t status_func,
+ void *status_baton,
apr_pool_t *pool)
{
apr_hash_index_t *hi;
@@ -1365,13 +1365,13 @@ svn_client__do_external_status(apr_hash_
iterpool), iterpool);
/* And then do the status. */
- SVN_ERR(svn_client_status5(NULL, fullpath,
+ SVN_ERR(svn_client_status5(NULL, ctx, fullpath,
&(external->revision),
- status_func, status_baton,
depth, get_all, update,
- no_ignore, FALSE, NULL,
+ no_ignore, FALSE,
ignored_props ? TRUE : FALSE,
- ctx, iterpool));
+ NULL, status_func, status_baton,
+ iterpool));
}
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/info.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/info.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/info.c Tue Aug 10 22:07:24 2010
@@ -87,20 +87,25 @@ build_info_for_entry(svn_info_t **info,
const char *local_abspath,
apr_pool_t *pool)
{
- svn_info_t *tmpinfo = apr_pcalloc(pool, sizeof(*tmpinfo));
+ svn_info_t *tmpinfo;
const char *copyfrom_url;
svn_revnum_t copyfrom_rev;
svn_boolean_t is_copy_target;
- const svn_wc_entry_t *entry;
const char *lock_token, *lock_owner, *lock_comment;
apr_time_t lock_date;
const svn_checksum_t *checksum;
+ svn_node_kind_t kind;
- SVN_ERR(svn_wc__get_entry_versioned(&entry, wc_ctx, local_abspath,
- svn_node_unknown, TRUE, FALSE,
- pool, pool));
+ SVN_ERR(svn_wc_read_kind(&kind, wc_ctx, local_abspath, FALSE, pool));
+
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The node '%s' was not found."),
+ svn_dirent_local_style(local_abspath, pool));
+
+ tmpinfo = apr_pcalloc(pool, sizeof(*tmpinfo));
+ tmpinfo->kind = kind;
- SVN_ERR(svn_wc_read_kind(&tmpinfo->kind, wc_ctx, local_abspath, TRUE, pool));
SVN_ERR(svn_wc__node_get_url(&tmpinfo->URL, wc_ctx, local_abspath,
pool, pool));
@@ -131,7 +136,8 @@ build_info_for_entry(svn_info_t **info,
if (! SVN_IS_VALID_REVNUM(tmpinfo->rev))
tmpinfo->rev = 0;
- SVN_ERR(svn_wc__node_get_copyfrom_info(©from_url, ©from_rev,
+ SVN_ERR(svn_wc__node_get_copyfrom_info(NULL, NULL,
+ ©from_url, ©from_rev,
&is_copy_target, wc_ctx,
local_abspath, pool, pool));
if (is_copy_target)
@@ -158,14 +164,19 @@ build_info_for_entry(svn_info_t **info,
if (tmpinfo->depth == svn_depth_unknown)
tmpinfo->depth = svn_depth_infinity;
- /* entry-specific stuff */
+ SVN_ERR(svn_wc__node_get_schedule(&tmpinfo->schedule, NULL,
+ wc_ctx, local_abspath, pool));
+
+ /* Some random stuffs we don't have wc-ng apis for yet */
+ SVN_ERR(svn_wc__node_get_info_bits(&tmpinfo->text_time,
+ &tmpinfo->conflict_old,
+ &tmpinfo->conflict_new,
+ &tmpinfo->conflict_wrk,
+ &tmpinfo->prejfile,
+ wc_ctx, local_abspath, pool, pool));
+
+ /* Some defaults */
tmpinfo->has_wc_info = TRUE;
- tmpinfo->schedule = entry->schedule;
- tmpinfo->text_time = entry->text_time;
- tmpinfo->conflict_old = entry->conflict_old;
- tmpinfo->conflict_new = entry->conflict_new;
- tmpinfo->conflict_wrk = entry->conflict_wrk;
- tmpinfo->prejfile = entry->prejfile;
tmpinfo->size = SVN_INFO_SIZE_UNKNOWN;
tmpinfo->size64 = SVN_INVALID_FILESIZE;
@@ -324,49 +335,40 @@ info_found_node_callback(const char *loc
apr_pool_t *pool)
{
struct found_entry_baton *fe_baton = walk_baton;
+ svn_info_t *info = NULL;
+ const svn_wc_conflict_description2_t *tree_conflict = NULL;
+ svn_error_t *err;
- if (svn_wc__changelist_match(fe_baton->wc_ctx, local_abspath,
- fe_baton->changelist_hash, pool))
+ if (! svn_wc__changelist_match(fe_baton->wc_ctx, local_abspath,
+ fe_baton->changelist_hash, pool))
+ return SVN_NO_ERROR;
+
+ SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, fe_baton->wc_ctx,
+ local_abspath, pool, pool));
+
+ err = build_info_for_entry(&info, fe_baton->wc_ctx, local_abspath,
+ pool);
+ if (err && (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+ && tree_conflict)
{
- svn_info_t *info;
- const svn_wc_conflict_description2_t *tmp_conflict;
- svn_error_t *err;
-
- err = build_info_for_entry(&info, fe_baton->wc_ctx, local_abspath,
- pool);
- if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- {
- /* Check for a tree conflict, and if there is one, send a minimal
- info struct. */
- const svn_wc_conflict_description2_t *tree_conflict;
-
- SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, fe_baton->wc_ctx,
- local_abspath, pool, pool));
+ svn_error_clear(err);
- if (tree_conflict)
- {
- svn_error_clear(err);
+ SVN_ERR(build_info_for_unversioned(&info, pool));
+ SVN_ERR(svn_wc__node_get_repos_info(&(info->repos_root_URL),
+ NULL,
+ fe_baton->wc_ctx,
+ local_abspath, FALSE, FALSE,
+ pool, pool));
+ }
+ else if (err)
+ return svn_error_return(err);
- SVN_ERR(build_info_for_unversioned(&info, pool));
- SVN_ERR(svn_wc__node_get_repos_info(&(info->repos_root_URL),
- NULL,
- fe_baton->wc_ctx,
- local_abspath, FALSE, FALSE,
- pool, pool));
- }
- else
- return svn_error_return(err);
- }
- else if (err)
- return svn_error_return(err);
+ SVN_ERR_ASSERT(info != NULL);
- SVN_ERR(svn_wc__get_tree_conflict(&tmp_conflict, fe_baton->wc_ctx,
- local_abspath, pool, pool));
- if (tmp_conflict)
- info->tree_conflict = svn_wc__cd2_to_cd(tmp_conflict, pool);
- SVN_ERR(fe_baton->receiver(fe_baton->receiver_baton, local_abspath,
- info, pool));
- }
+ if (tree_conflict)
+ info->tree_conflict = svn_wc__cd2_to_cd(tree_conflict, pool);
+ SVN_ERR(fe_baton->receiver(fe_baton->receiver_baton, local_abspath,
+ info, pool));
return SVN_NO_ERROR;
}
@@ -498,6 +500,9 @@ svn_client_info3(const char *abspath_or_
svn_info_t *info;
svn_error_t *err;
+ if (depth == svn_depth_unknown)
+ depth = svn_depth_empty;
+
if ((revision == NULL
|| revision->kind == svn_opt_revision_unspecified)
&& (peg_revision == NULL
@@ -527,7 +532,7 @@ svn_client_info3(const char *abspath_or_
SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_URL, pool));
SVN_ERR(svn_ra_get_uuid2(ra_session, &repos_UUID, pool));
- svn_uri_split(url, &parent_url, &base_name, pool);
+ svn_uri_split(&parent_url, &base_name, url, pool);
base_name = svn_path_uri_decode(base_name, pool);
/* Get the dirent for the URL itself. */
@@ -629,7 +634,8 @@ svn_client_info3(const char *abspath_or_
pre_1_2_recurse:
if (peg_revision->kind == svn_opt_revision_head)
{
- err = svn_ra_get_locks(ra_session, &locks, "", pool);
+ err = svn_ra_get_locks2(ra_session, &locks, "", depth,
+ pool);
/* Catch specific errors thrown by old mod_dav_svn or svnserve. */
if (err &&
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/list.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/list.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/list.c Tue Aug 10 22:07:24 2010
@@ -170,7 +170,7 @@ svn_client_list2(const char *path_or_url
/* Open another session to the path's parent. This server
doesn't support svn_ra_reparent anyway, so don't try it. */
- svn_uri_split(url, &parent_url, &base_name, pool);
+ svn_uri_split(&parent_url, &base_name, url, pool);
/* 'base_name' is now the last component of an URL, but we want
to use it as a plain file name. Therefore, we must URI-decode
@@ -245,7 +245,7 @@ svn_client_list2(const char *path_or_url
{
/* IMPORTANT: If locks are stored in a more temporary pool, we need
to fix store_dirent below to duplicate the locks. */
- err = svn_ra_get_locks(ra_session, &locks, "", pool);
+ err = svn_ra_get_locks2(ra_session, &locks, "", depth, pool);
if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED)
{
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/locking_commands.c?rev=984234&r1=984233&r2=984234&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/locking_commands.c Tue Aug 10 22:07:24 2010
@@ -206,9 +206,9 @@ organize_lock_targets(const char **commo
{
const char *parent, *base;
if (url_mode)
- svn_uri_split(*common_parent_url, &parent, &base, pool);
+ svn_uri_split(&parent, &base, *common_parent_url, pool);
else
- svn_dirent_split(*common_parent_url, &parent, &base, pool);
+ svn_dirent_split(&parent, &base, *common_parent_url, pool);
*common_parent_url = parent;
APR_ARRAY_PUSH(rel_targets, const char *) = base;