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/10 19:03:37 UTC
svn commit: r984122 [14/40] - in /subversion/branches/ignore-mergeinfo: ./
build/ build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ build/generator/util/ build/hudson/
build/hudson/jobs/ build/hudson/jobs/subversion-1.6...
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=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/export.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/export.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
* export.c: export a tree.
*
* ====================================================================
- * Licensed to the Subversion Corporation (SVN Corp.) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The SVN Corp. licenses this file
+ * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -101,6 +101,7 @@ copy_one_versioned_file(const char *from
svn_wc_context_t *wc_ctx,
const svn_opt_revision_t *revision,
const char *native_eol,
+ svn_boolean_t ignore_keywords,
apr_pool_t *scratch_pool)
{
const svn_wc_entry_t *entry;
@@ -204,7 +205,7 @@ copy_one_versioned_file(const char *from
if (keywords)
{
svn_revnum_t changed_rev;
- const char *fmt;
+ const char *suffix;
const char *author;
SVN_ERR(svn_wc__node_get_changed_info(&changed_rev, NULL, &author,
@@ -217,17 +218,17 @@ copy_one_versioned_file(const char *from
to the revision number, and set the author to
"(local)" since we can't always determine the
current user's username */
- fmt = "%ldM";
+ suffix = "M";
author = _("(local)");
}
else
{
- fmt = "%ld";
+ suffix = "";
}
SVN_ERR(svn_subst_build_keywords2
(&kw, keywords->data,
- apr_psprintf(scratch_pool, fmt, changed_rev),
+ apr_psprintf(scratch_pool, "%ld%s", changed_rev, suffix),
entry->url, tm, author, scratch_pool));
}
@@ -245,7 +246,7 @@ copy_one_versioned_file(const char *from
eol,
FALSE /* repair */,
kw,
- TRUE /* expand */,
+ ! ignore_keywords /* expand */,
scratch_pool);
/* ###: use cancel func/baton in place of NULL/NULL below. */
@@ -271,6 +272,7 @@ copy_versioned_files(const char *from,
const svn_opt_revision_t *revision,
svn_boolean_t force,
svn_boolean_t ignore_externals,
+ svn_boolean_t ignore_keywords,
svn_depth_t depth,
const char *native_eol,
svn_client_ctx_t *ctx,
@@ -369,7 +371,8 @@ copy_versioned_files(const char *from,
SVN_ERR(copy_versioned_files(new_from, new_to,
revision, force,
- ignore_externals, depth,
+ ignore_externals,
+ ignore_keywords, depth,
native_eol, ctx, iterpool));
}
}
@@ -391,7 +394,8 @@ copy_versioned_files(const char *from,
SVN_ERR(copy_one_versioned_file(new_from_abspath, new_to_abspath,
ctx->wc_ctx, revision,
- native_eol, iterpool));
+ native_eol, ignore_keywords,
+ iterpool));
}
}
@@ -435,6 +439,7 @@ copy_versioned_files(const char *from,
SVN_ERR(copy_versioned_files(new_from, new_to,
revision, force, FALSE,
+ ignore_keywords,
svn_depth_infinity, native_eol,
ctx, iterpool));
}
@@ -446,7 +451,8 @@ copy_versioned_files(const char *from,
else if (from_kind == svn_node_file)
{
SVN_ERR(copy_one_versioned_file(from_abspath, to_abspath, ctx->wc_ctx,
- revision, native_eol, pool));
+ revision, native_eol, ignore_keywords,
+ pool));
}
return SVN_NO_ERROR;
@@ -511,6 +517,7 @@ struct edit_baton
svn_revnum_t *target_revision;
apr_hash_t *externals;
const char *native_eol;
+ svn_boolean_t ignore_keywords;
svn_wc_notify_func2_t notify_func;
void *notify_baton;
@@ -739,7 +746,8 @@ change_file_prop(void *file_baton,
if (strcmp(name, SVN_PROP_EOL_STYLE) == 0)
fb->eol_style_val = svn_string_dup(value, fb->pool);
- else if (strcmp(name, SVN_PROP_KEYWORDS) == 0)
+ else if (! fb->edit_baton->ignore_keywords &&
+ strcmp(name, SVN_PROP_KEYWORDS) == 0)
fb->keywords_val = svn_string_dup(value, fb->pool);
else if (strcmp(name, SVN_PROP_EXECUTABLE) == 0)
@@ -868,13 +876,14 @@ close_file(void *file_baton,
/*** Public Interfaces ***/
svn_error_t *
-svn_client_export4(svn_revnum_t *result_rev,
+svn_client_export5(svn_revnum_t *result_rev,
const char *from,
const char *to,
const svn_opt_revision_t *peg_revision,
const svn_opt_revision_t *revision,
svn_boolean_t overwrite,
svn_boolean_t ignore_externals,
+ svn_boolean_t ignore_keywords,
svn_depth_t depth,
const char *native_eol,
svn_client_ctx_t *ctx,
@@ -915,6 +924,7 @@ svn_client_export4(svn_revnum_t *result_
eb->notify_baton = ctx->notify_baton2;
eb->externals = apr_hash_make(pool);
eb->native_eol = native_eol;
+ eb->ignore_keywords = ignore_keywords;
SVN_ERR(svn_ra_check_path(ra_session, "", revnum, &kind, pool));
@@ -1038,8 +1048,8 @@ svn_client_export4(svn_revnum_t *result_
/* This is a working copy export. */
/* just copy the contents of the working copy into the target path. */
SVN_ERR(copy_versioned_files(from, to, revision, overwrite,
- ignore_externals, depth, native_eol,
- ctx, pool));
+ ignore_externals, ignore_keywords,
+ depth, native_eol, ctx, pool));
}
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=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/externals.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
* externals.c: handle the svn:externals property
*
* ====================================================================
- * Licensed to the Subversion Corporation (SVN Corp.) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The SVN Corp. licenses this file
+ * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -105,11 +105,16 @@ relegate_dir_external(const char *path,
const char *local_abspath;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+ SVN_ERR(svn_wc__acquire_write_lock(NULL, wc_ctx, local_abspath, NULL, pool));
err = svn_wc_remove_from_revision_control2(wc_ctx, local_abspath,
TRUE, FALSE,
cancel_func, cancel_baton,
pool);
+ /* ### Ugly. Unlock only if not going to return an error. Revisit */
+ if (!err || err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
+ SVN_ERR(svn_wc__release_write_lock(wc_ctx, local_abspath, pool));
+
if (err && (err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD))
{
const char *parent_dir;
@@ -329,7 +334,7 @@ switch_file_external(const char *path,
svn_error_clear(err);
close_adm_access = TRUE;
SVN_ERR(svn_wc__adm_open_in_context(&target_adm_access, ctx->wc_ctx,
- anchor, TRUE, 1,
+ anchor, TRUE, -1,
ctx->cancel_func,
ctx->cancel_baton, subpool));
@@ -557,7 +562,7 @@ resolve_relative_external_url(svn_wc_ext
/* "//schema-relative" and in some cases "///schema-relative".
This last format is supported on file:// schema relative. */
url = apr_pstrcat(
- pool,
+ pool,
url[2] == '/' ? "///" : "//",
svn_relpath_canonicalize(url+2, pool),
NULL);
@@ -889,51 +894,22 @@ handle_external_item_change(const void *
just be renamed to a new one. */
svn_error_t *err;
- svn_wc_adm_access_t *adm_access;
- svn_boolean_t close_access_baton_when_done;
-
const char *remove_target_abspath;
+ svn_boolean_t lock_existed;
- /* Determine if a directory or file external is being removed.
- Try to handle the case when the user deletes the external by
- hand or it is missing. First try to open the directory for a
- directory external. If that doesn't work, get the access
- baton for the parent directory and remove the entry for the
- external. */
- err = svn_wc__adm_open_in_context(&adm_access, ib->ctx->wc_ctx, path,
- TRUE, -1, ib->ctx->cancel_func,
- ib->ctx->cancel_baton, ib->iter_pool);
- if (err)
- {
- const char *anchor;
- const char *target;
- svn_error_t *err2;
-
- SVN_ERR(svn_wc_get_actual_target2(&anchor, &target, ib->ctx->wc_ctx,
- path, ib->iter_pool,
- ib->iter_pool));
+ SVN_ERR(svn_dirent_get_absolute(&remove_target_abspath,
+ path,
+ ib->iter_pool));
- err2 = svn_wc_adm_retrieve(&adm_access, ib->adm_access, anchor,
- ib->iter_pool);
- if (err2)
- {
- svn_error_clear(err2);
- return svn_error_return(err);
- }
- else
- {
- svn_error_clear(err);
- }
- close_access_baton_when_done = FALSE;
- SVN_ERR(svn_dirent_get_absolute(&remove_target_abspath, target,
- ib->iter_pool));
- }
- else
+ SVN_ERR(svn_wc_locked2(&lock_existed, NULL, ib->ctx->wc_ctx,
+ remove_target_abspath, ib->iter_pool));
+
+ if (! lock_existed)
{
- close_access_baton_when_done = TRUE;
- SVN_ERR(svn_dirent_get_absolute(&remove_target_abspath,
- svn_wc_adm_access_path(adm_access),
- ib->iter_pool));
+ SVN_ERR(svn_wc__acquire_write_lock(NULL, ib->ctx->wc_ctx,
+ remove_target_abspath,
+ ib->iter_pool,
+ ib->iter_pool));
}
/* We don't use relegate_dir_external() here, because we know that
@@ -947,7 +923,7 @@ handle_external_item_change(const void *
if (ib->ctx->notify_func2)
{
- svn_wc_notify_t *notify =
+ svn_wc_notify_t *notify =
svn_wc_create_notify(remove_target_abspath,
svn_wc_notify_update_external_removed,
ib->iter_pool);
@@ -960,13 +936,15 @@ handle_external_item_change(const void *
}
/* ### Ugly. Unlock only if not going to return an error. Revisit */
- if (close_access_baton_when_done &&
- (!err || err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD))
+ if (! lock_existed
+ && (! err || err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD))
{
- svn_error_t *err2 = svn_wc_adm_close2(adm_access, ib->iter_pool);
+ svn_error_t *err2 = svn_wc__release_write_lock(ib->ctx->wc_ctx,
+ remove_target_abspath,
+ ib->iter_pool);
if (err2)
{
- if (!err)
+ if (! err)
err = err2;
else
svn_error_clear(err2);
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=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/info.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/info.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
* info.c: return system-generated metadata about paths or URLs.
*
* ====================================================================
- * Licensed to the Subversion Corporation (SVN Corp.) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The SVN Corp. licenses this file
+ * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -363,7 +363,7 @@ crawl_entries(const char *local_abspath,
SVN_ERR(build_info_for_unversioned(&info, pool));
info->tree_conflict = svn_wc__cd2_to_cd(tree_conflict, pool);
-
+
SVN_ERR(svn_wc__node_get_repos_info(&(info->repos_root_URL),
NULL,
ctx->wc_ctx,
@@ -377,7 +377,7 @@ crawl_entries(const char *local_abspath,
}
else if (err)
return svn_error_return(err);
-
+
return SVN_NO_ERROR;
}
@@ -416,7 +416,7 @@ same_resource_in_head(svn_boolean_t *sam
*same_p = FALSE;
return SVN_NO_ERROR;
}
- else
+ else
SVN_ERR(err);
/* ### Currently, the URLs should always be equal, since we can't
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=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/list.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/list.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
* list.c: list local and remote directory entries.
*
* ====================================================================
- * Licensed to the Subversion Corporation (SVN Corp.) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The SVN Corp. licenses this file
+ * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -86,11 +86,11 @@ get_dir_contents(apr_uint32_t dirent_fie
svn_pool_clear(iterpool);
- path = svn_path_join(dir, item->key, iterpool);
+ path = svn_relpath_join(dir, item->key, iterpool);
if (locks)
{
- const char *abs_path = svn_path_join(fs_path, path, iterpool);
+ const char *abs_path = svn_uri_join(fs_path, path, iterpool);
lock = apr_hash_get(locks, abs_path, APR_HASH_KEY_STRING);
}
else
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=984122&r1=984121&r2=984122&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 17:03:06 2010
@@ -2,10 +2,10 @@
* locking_commands.c: Implementation of lock and unlock.
*
* ====================================================================
- * Licensed to the Subversion Corporation (SVN Corp.) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The SVN Corp. licenses this file
+ * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -185,7 +185,7 @@ organize_lock_targets(const char **commo
/* All targets must be either urls or paths */
- url_mode = ((targets->nelts >= 1) &&
+ url_mode = ((targets->nelts >= 1) &&
svn_path_is_url(APR_ARRAY_IDX(targets, 0, const char *)));
/* Get the common parent and all paths */
@@ -291,7 +291,6 @@ organize_lock_targets(const char **commo
store the mapping between relative repository path and WC path. */
for (i = 0; i < rel_targets->nelts; i++)
{
- const svn_wc_entry_t *entry;
const char *target = APR_ARRAY_IDX(rel_targets, i, const char *);
const char *url = APR_ARRAY_IDX(rel_urls, i, const char *);
const char *abs_path;
@@ -305,32 +304,34 @@ organize_lock_targets(const char **commo
abs_path = svn_dirent_join(*common_parent_url, target, subpool);
- SVN_ERR(svn_wc__get_entry_versioned(&entry, ctx->wc_ctx, abs_path,
- svn_node_unknown, FALSE, FALSE,
- subpool, subpool));
-
if (do_lock) /* Lock. */
{
svn_revnum_t *revnum;
revnum = apr_palloc(pool, sizeof(* revnum));
- *revnum = entry->revision;
-
+ SVN_ERR(svn_wc__node_get_base_rev(revnum, ctx->wc_ctx,
+ abs_path, subpool));
apr_hash_set(rel_targets_ret, decoded_url,
APR_HASH_KEY_STRING, revnum);
}
else /* Unlock. */
{
- /* If not force, get the lock token from the WC entry. */
+ /* If not force, get the lock token. */
if (! force)
{
- if (! entry->lock_token)
+ const char *lock_token;
+
+ SVN_ERR(svn_wc__node_get_lock_token(&lock_token,
+ ctx->wc_ctx,
+ abs_path,
+ pool, subpool));
+ if (! lock_token)
return svn_error_createf
(SVN_ERR_CLIENT_MISSING_LOCK_TOKEN, NULL,
_("'%s' is not locked in this working copy"), target);
apr_hash_set(rel_targets_ret, decoded_url,
APR_HASH_KEY_STRING,
- apr_pstrdup(pool, entry->lock_token));
+ lock_token);
}
else
{
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_client/log.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_client/log.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_client/log.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
* log.c: return log messages
*
* ====================================================================
- * Licensed to the Subversion Corporation (SVN Corp.) under one
+ * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The SVN Corp. licenses this file
+ * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -313,7 +313,6 @@ svn_client_log5(const apr_array_header_t
{
svn_ra_session_t *ra_session;
const char *url_or_path;
- svn_boolean_t is_url;
svn_boolean_t has_log_revprops;
const char *actual_url;
apr_array_header_t *condensed_targets;
@@ -333,15 +332,6 @@ svn_client_log5(const apr_array_header_t
/* Use the passed URL, if there is one. */
url_or_path = APR_ARRAY_IDX(targets, 0, const char *);
- is_url = svn_path_is_url(url_or_path);
-
- if (is_url && SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind))
- {
- return svn_error_create
- (SVN_ERR_CLIENT_BAD_REVISION, NULL,
- _("Revision type requires a working copy path, not a URL"));
- }
-
session_opt_rev.kind = svn_opt_revision_unspecified;
for (i = 0; i < revision_ranges->nelts; i++)
@@ -393,15 +383,6 @@ svn_client_log5(const apr_array_header_t
_("Missing required revision specification"));
}
- if (is_url
- && (SVN_CLIENT__REVKIND_NEEDS_WC(range->start.kind)
- || SVN_CLIENT__REVKIND_NEEDS_WC(range->end.kind)))
- {
- return svn_error_create
- (SVN_ERR_CLIENT_BAD_REVISION, NULL,
- _("Revision type requires a working copy path, not a URL"));
- }
-
/* Determine the revision to open the RA session to. */
if (session_opt_rev.kind == svn_opt_revision_unspecified)
{
@@ -423,7 +404,7 @@ svn_client_log5(const apr_array_header_t
}
/* Use the passed URL, if there is one. */
- if (is_url)
+ if (svn_path_is_url(url_or_path))
{
/* Initialize this array, since we'll be building it below */
condensed_targets = apr_array_make(pool, 1, sizeof(const char *));
@@ -580,7 +561,7 @@ svn_client_log5(const apr_array_header_t
{
svn_revnum_t start_revnum, end_revnum, youngest_rev = SVN_INVALID_REVNUM;
const char *path = APR_ARRAY_IDX(targets, 0, const char *);
- const char *local_abspath;
+ const char *local_abspath_or_url;
svn_opt_revision_range_t *range;
limit_receiver_baton_t lb;
svn_log_entry_receiver_t passed_receiver;
@@ -588,15 +569,20 @@ svn_client_log5(const apr_array_header_t
const apr_array_header_t *passed_receiver_revprops;
svn_pool_clear(iterpool);
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, iterpool));
+
+ if (!svn_path_is_url(path))
+ SVN_ERR(svn_dirent_get_absolute(&local_abspath_or_url, path, iterpool));
+ else
+ local_abspath_or_url = path;
+
range = APR_ARRAY_IDX(revision_ranges, i, svn_opt_revision_range_t *);
SVN_ERR(svn_client__get_revision_number(&start_revnum, &youngest_rev,
- ctx->wc_ctx, local_abspath,
+ ctx->wc_ctx, local_abspath_or_url,
ra_session, &range->start,
iterpool));
SVN_ERR(svn_client__get_revision_number(&end_revnum, &youngest_rev,
- ctx->wc_ctx, local_abspath,
+ ctx->wc_ctx, local_abspath_or_url,
ra_session, &range->end,
iterpool));