You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/03/30 22:58:01 UTC
svn commit: r929279 [19/20] - in
/subversion/branches/svn-patch-improvements: ./ build/ac-macros/
build/generator/ build/generator/templates/ contrib/client-side/emacs/
notes/feedback/ notes/meetings/ notes/wc-ng/ subversion/
subversion/bindings/javahl...
Modified: subversion/branches/svn-patch-improvements/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/cl.h?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/cl.h (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/cl.h Tue Mar 30 20:57:53 2010
@@ -224,6 +224,7 @@ typedef struct svn_cl__opt_state_t
int strip_count; /* number of leading path components to strip */
svn_boolean_t ignore_keywords; /* do not expand keywords */
svn_boolean_t reverse_diff; /* reverse a diff (e.g. when patching) */
+ apr_array_header_t *include_patterns; /* targets to include in operation */
apr_array_header_t *exclude_patterns; /* targets to exclude from operation */
} svn_cl__opt_state_t;
@@ -381,7 +382,7 @@ svn_cl__time_cstring_to_human_cstring(co
When DETAILED is set, and REPOS_LOCKS is set, treat missing repository locks
as broken WC locks.
-
+
Increment *TEXT_CONFLICTS, *PROP_CONFLICTS, or *TREE_CONFLICTS if
a conflict was encountered.
*/
@@ -445,7 +446,7 @@ svn_cl__print_xml_commit(svn_stringbuf_t
*/
svn_error_t *
svn_cl__revprop_prepare(const svn_opt_revision_t *revision,
- apr_array_header_t *targets,
+ const apr_array_header_t *targets,
const char **URL,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
@@ -676,7 +677,9 @@ svn_cl__check_boolean_prop_val(const cha
/* De-streamifying wrapper around svn_client_get_changelists(), which
is called for each target in TARGETS to populate *PATHS (a list of
- paths assigned to one of the CHANGELISTS. */
+ paths assigned to one of the CHANGELISTS.
+ If all targets are to be included, may set *PATHS to TARGETS without
+ reallocating. */
svn_error_t *
svn_cl__changelist_paths(apr_array_header_t **paths,
const apr_array_header_t *changelists,
@@ -692,7 +695,7 @@ svn_cl__changelist_paths(apr_array_heade
svn_error_t *
svn_cl__args_to_target_array_print_reserved(apr_array_header_t **targets_p,
apr_getopt_t *os,
- apr_array_header_t *known_targets,
+ const apr_array_header_t *known_targets,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
@@ -725,8 +728,8 @@ svn_cl__node_description(const svn_wc_co
* if BASE is an uri, dirent or relative.
*/
const char *
-svn_cl__path_join(const char *base,
- const char *component,
+svn_cl__path_join(const char *base,
+ const char *component,
apr_pool_t *pool);
#ifdef __cplusplus
Modified: subversion/branches/svn-patch-improvements/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/log-cmd.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/log-cmd.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/log-cmd.c Tue Mar 30 20:57:53 2010
@@ -367,8 +367,8 @@ log_entry_receiver_xml(void *baton,
hi != NULL;
hi = apr_hash_next(hi))
{
- const char *path = svn_apr_hash_index_key(hi);
- svn_log_changed_path2_t *log_item = svn_apr_hash_index_val(hi);
+ const char *path = svn__apr_hash_index_key(hi);
+ svn_log_changed_path2_t *log_item = svn__apr_hash_index_val(hi);
char action[2];
action[0] = log_item->action;
@@ -545,8 +545,8 @@ svn_cl__log(apr_getopt_t *os,
hi != NULL;
hi = apr_hash_next(hi))
{
- const char *property = svn_apr_hash_index_key(hi);
- svn_string_t *value = svn_apr_hash_index_val(hi);
+ const char *property = svn__apr_hash_index_key(hi);
+ svn_string_t *value = svn__apr_hash_index_val(hi);
if (value && value->data[0] != '\0')
return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
Modified: subversion/branches/svn-patch-improvements/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/main.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/main.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/main.c Tue Mar 30 20:57:53 2010
@@ -117,6 +117,7 @@ typedef enum {
opt_show_copies_as_adds,
opt_ignore_keywords,
opt_reverse_diff,
+ opt_include_pattern,
opt_exclude_pattern,
} svn_cl__longopt_t;
@@ -348,6 +349,24 @@ const apr_getopt_option_t svn_cl__option
N_("apply the unidiff in reverse\n"
" "
"[alias: --rd]")},
+ {"include-pattern", opt_include_pattern, 1,
+ N_("operate only on targets matching ARG,\n"
+ " "
+ "which may be a glob pattern such as '*.txt'.\n"
+ " "
+ "If this option is specified multiple times,\n"
+ " "
+ "all patterns are matched in turn.\n"
+ " "
+ "If both --include-pattern and --exclude-pattern\n"
+ " "
+ "options are specified include patterns are applied\n"
+ " "
+ "first, i.e. exclude patterns are applied to all\n"
+ " "
+ "targets which match an include pattern.\n"
+ " "
+ "[alias: --ip]")},
{"exclude-pattern", opt_exclude_pattern, 1,
N_("do not operate on targets matching ARG,\n"
" "
@@ -357,6 +376,8 @@ const apr_getopt_option_t svn_cl__option
" "
"all patterns are matched in turn.\n"
" "
+ "See also the --include-pattern option.\n"
+ " "
"[alias: --ep]")},
/* Long-opt Aliases
*
@@ -382,6 +403,7 @@ const apr_getopt_option_t svn_cl__option
{"ri", opt_reintegrate, 0, NULL},
{"sca", opt_show_copies_as_adds, 0, NULL},
{"ik", opt_ignore_keywords, 0, NULL},
+ {"ip", opt_include_pattern, 1, NULL},
{"ep", opt_exclude_pattern, 1, NULL},
{0, 0, 0, 0},
@@ -824,7 +846,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
" for addition. Use 'svn revert' to undo deletions and additions you\n"
" do not agree with.\n"
),
- {'q', opt_dry_run, 'p', opt_reverse_diff, opt_exclude_pattern} },
+ {'q', opt_dry_run, 'p', opt_reverse_diff, opt_include_pattern,
+ opt_exclude_pattern} },
{ "propdel", svn_cl__propdel, {"pdel", "pd"}, N_
("Remove a property from files, dirs, or revisions.\n"
@@ -1739,6 +1762,12 @@ main(int argc, const char *argv[])
case opt_reverse_diff:
opt_state.reverse_diff = TRUE;
break;
+ case opt_include_pattern:
+ if (opt_state.include_patterns == NULL)
+ opt_state.include_patterns = apr_array_make(pool, 1,
+ sizeof (const char *));
+ APR_ARRAY_PUSH(opt_state.include_patterns, const char *) = opt_arg;
+ break;
case opt_exclude_pattern:
if (opt_state.exclude_patterns == NULL)
opt_state.exclude_patterns = apr_array_make(pool, 1,
Modified: subversion/branches/svn-patch-improvements/subversion/svn/mergeinfo-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/mergeinfo-cmd.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/mergeinfo-cmd.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/mergeinfo-cmd.c Tue Mar 30 20:57:53 2010
@@ -117,7 +117,7 @@ svn_cl__mergeinfo(apr_getopt_t *os,
/* Do the real work, depending on the requested data flavor. */
if (opt_state->show_revs == svn_cl__show_revs_merged)
{
- SVN_ERR(svn_client_mergeinfo_log(target, TRUE, &tgt_peg_revision,
+ SVN_ERR(svn_client_mergeinfo_log(TRUE, target, &tgt_peg_revision,
source, &src_peg_revision,
print_log_rev, NULL,
TRUE, depth, NULL, ctx,
@@ -125,7 +125,7 @@ svn_cl__mergeinfo(apr_getopt_t *os,
}
else if (opt_state->show_revs == svn_cl__show_revs_eligible)
{
- SVN_ERR(svn_client_mergeinfo_log(target, FALSE, &tgt_peg_revision,
+ SVN_ERR(svn_client_mergeinfo_log(FALSE, target, &tgt_peg_revision,
source, &src_peg_revision,
print_log_rev, NULL,
TRUE, depth, NULL, ctx,
Modified: subversion/branches/svn-patch-improvements/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/notify.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/notify.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/notify.c Tue Mar 30 20:57:53 2010
@@ -319,7 +319,7 @@ notify(void *baton, const svn_wc_notify_
minus, off, n->hunk_fuzz)))
goto print_error;
}
- else
+ else
{
s = _("> applied hunk @@ -%lu,%lu +%lu,%lu @@ "
"with offset %s");
@@ -337,7 +337,7 @@ notify(void *baton, const svn_wc_notify_
}
else if (n->hunk_fuzz)
{
- if ((err = svn_cmdline_printf(pool,
+ if ((err = svn_cmdline_printf(pool,
_("> applied hunk @@ -%lu,%lu +%lu,%lu @@ "
"with fuzz %d\n"),
n->hunk_original_start,
@@ -692,7 +692,7 @@ notify(void *baton, const svn_wc_notify_
pool,
_("--- Recording mergeinfo for reverse merge of r%ld through r%ld into '%s':\n"),
n->merge_range->start, n->merge_range->end + 1, path_local);
-
+
if (err)
goto print_error;
}
Modified: subversion/branches/svn-patch-improvements/subversion/svn/patch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/patch-cmd.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/patch-cmd.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/patch-cmd.c Tue Mar 30 20:57:53 2010
@@ -79,7 +79,9 @@ svn_cl__patch(apr_getopt_t *os,
SVN_ERR(svn_client_patch(abs_patch_path, abs_target_path,
opt_state->dry_run, opt_state->strip_count,
opt_state->reverse_diff,
- opt_state->exclude_patterns, ctx, pool));
+ opt_state->include_patterns,
+ opt_state->exclude_patterns,
+ NULL, NULL, ctx, pool, pool));
if (! opt_state->quiet)
SVN_ERR(svn_cl__print_conflict_stats(ctx->notify_baton2, pool));
Modified: subversion/branches/svn-patch-improvements/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/propget-cmd.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/propget-cmd.c Tue Mar 30 20:57:53 2010
@@ -76,8 +76,8 @@ print_properties_xml(const char *pname,
for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
{
- const char *filename = svn_apr_hash_index_key(hi);
- svn_string_t *propval = svn_apr_hash_index_val(hi);
+ const char *filename = svn__apr_hash_index_key(hi);
+ svn_string_t *propval = svn__apr_hash_index_val(hi);
svn_stringbuf_t *sb = NULL;
svn_pool_clear(iterpool);
@@ -120,8 +120,8 @@ print_properties(svn_stream_t *out,
for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
{
- const char *filename = svn_apr_hash_index_key(hi);
- svn_string_t *propval = svn_apr_hash_index_val(hi);
+ const char *filename = svn__apr_hash_index_key(hi);
+ svn_string_t *propval = svn__apr_hash_index_val(hi);
svn_pool_clear(iterpool);
Modified: subversion/branches/svn-patch-improvements/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/props.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/props.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/props.c Tue Mar 30 20:57:53 2010
@@ -47,7 +47,7 @@
svn_error_t *
svn_cl__revprop_prepare(const svn_opt_revision_t *revision,
- apr_array_header_t *targets,
+ const apr_array_header_t *targets,
const char **URL,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
@@ -90,8 +90,8 @@ svn_cl__print_prop_hash(apr_hash_t *prop
for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi))
{
- const char *pname = svn_apr_hash_index_key(hi);
- svn_string_t *propval = svn_apr_hash_index_val(hi);
+ const char *pname = svn__apr_hash_index_key(hi);
+ svn_string_t *propval = svn__apr_hash_index_val(hi);
const char *pname_stdout;
if (svn_prop_needs_translation(pname))
@@ -131,8 +131,8 @@ svn_cl__print_xml_prop_hash(svn_stringbu
for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi))
{
- const char *pname = svn_apr_hash_index_key(hi);
- svn_string_t *propval = svn_apr_hash_index_val(hi);
+ const char *pname = svn__apr_hash_index_key(hi);
+ svn_string_t *propval = svn__apr_hash_index_val(hi);
if (names_only)
{
Modified: subversion/branches/svn-patch-improvements/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/propset-cmd.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/propset-cmd.c Tue Mar 30 20:57:53 2010
@@ -88,12 +88,11 @@ svn_cl__propset(apr_getopt_t *os,
if (svn_prop_needs_translation(pname_utf8))
SVN_ERR(svn_subst_translate_string(&propval, propval,
opt_state->encoding, scratch_pool));
- else
- if (opt_state->encoding)
- return svn_error_create
- (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("--encoding option applies only to textual"
- " Subversion-controlled properties"));
+ else if (opt_state->encoding)
+ return svn_error_create
+ (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("--encoding option applies only to textual"
+ " Subversion-controlled properties"));
/* Suck up all the remaining arguments into a targets array */
Modified: subversion/branches/svn-patch-improvements/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/status-cmd.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/status-cmd.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/status-cmd.c Tue Mar 30 20:57:53 2010
@@ -180,7 +180,7 @@ print_status(void *baton,
scache->path = apr_pstrdup(sb->cl_pool, path);
scache->status = svn_wc_dup_status2(status, sb->cl_pool);
- path_array = (apr_array_header_t *)
+ path_array =
apr_hash_get(sb->cached_changelists, cl_key, APR_HASH_KEY_STRING);
if (path_array == NULL)
{
@@ -305,8 +305,8 @@ svn_cl__status(apr_getopt_t *os,
for (hi = apr_hash_first(scratch_pool, master_cl_hash); hi;
hi = apr_hash_next(hi))
{
- const char *changelist_name = svn_apr_hash_index_key(hi);
- apr_array_header_t *path_array = svn_apr_hash_index_val(hi);
+ const char *changelist_name = svn__apr_hash_index_key(hi);
+ apr_array_header_t *path_array = svn__apr_hash_index_val(hi);
int j;
/* ### TODO: For non-XML output, we shouldn't print the
Modified: subversion/branches/svn-patch-improvements/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/switch-cmd.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/switch-cmd.c Tue Mar 30 20:57:53 2010
@@ -40,7 +40,7 @@
/*** Code. ***/
static svn_error_t *
-rewrite_urls(apr_array_header_t *targets,
+rewrite_urls(const apr_array_header_t *targets,
svn_boolean_t recurse,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
Modified: subversion/branches/svn-patch-improvements/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn/util.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn/util.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn/util.c Tue Mar 30 20:57:53 2010
@@ -1100,7 +1100,7 @@ svn_cl__operation_str_human_readable(svn
svn_error_t *
svn_cl__args_to_target_array_print_reserved(apr_array_header_t **targets,
apr_getopt_t *os,
- apr_array_header_t *known_targets,
+ const apr_array_header_t *known_targets,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
Modified: subversion/branches/svn-patch-improvements/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svn_private_config.hw?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svn_private_config.hw (original)
+++ subversion/branches/svn-patch-improvements/subversion/svn_private_config.hw Tue Mar 30 20:57:53 2010
@@ -30,9 +30,9 @@
#define SVN_PRIVATE_CONFIG_HW
/* The minimal version of Berkeley DB we want */
-#define SVN_FS_WANT_DB_MAJOR 4
-#define SVN_FS_WANT_DB_MINOR 0
-#define SVN_FS_WANT_DB_PATCH 14
+#define SVN_FS_WANT_DB_MAJOR 4
+#define SVN_FS_WANT_DB_MINOR 0
+#define SVN_FS_WANT_DB_PATCH 14
/* Path separator for local filesystem */
Modified: subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svnadmin/main.c Tue Mar 30 20:57:53 2010
@@ -1248,8 +1248,8 @@ subcommand_lslocks(apr_getopt_t *os, voi
for (hi = apr_hash_first(pool, locks); hi; hi = apr_hash_next(hi))
{
const char *cr_date, *exp_date = "";
- const char *path = svn_apr_hash_index_key(hi);
- svn_lock_t *lock = svn_apr_hash_index_val(hi);
+ const char *path = svn__apr_hash_index_key(hi);
+ svn_lock_t *lock = svn__apr_hash_index_val(hi);
int comment_lines = 0;
cr_date = svn_time_to_human_cstring(lock->creation_date, pool);
Modified: subversion/branches/svn-patch-improvements/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svndumpfilter/main.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svndumpfilter/main.c Tue Mar 30 20:57:53 2010
@@ -110,7 +110,7 @@ write_prop_to_stringbuf(svn_stringbuf_t
/* Prefix matching function to compare node-path with set of prefixes. */
static svn_boolean_t
-ary_prefix_match(apr_array_header_t *pfxlist, const char *path)
+ary_prefix_match(const apr_array_header_t *pfxlist, const char *path)
{
int i, pfx_len, path_len = strlen(path);
const char *pfx;
@@ -133,7 +133,7 @@ ary_prefix_match(apr_array_header_t *pfx
/* Check whether we need to skip this PATH based on its presence in
the PREFIXES list, and the DO_EXCLUDE option. */
static APR_INLINE svn_boolean_t
-skip_path(const char *path, apr_array_header_t *prefixes,
+skip_path(const char *path, const apr_array_header_t *prefixes,
svn_boolean_t do_exclude, svn_boolean_t glob)
{
const svn_boolean_t matches =
@@ -285,8 +285,8 @@ new_revision_record(void **revision_bato
for (hi = apr_hash_first(pool, headers); hi; hi = apr_hash_next(hi))
{
- const char *key = svn_apr_hash_index_key(hi);
- const char *val = svn_apr_hash_index_val(hi);
+ const char *key = svn__apr_hash_index_key(hi);
+ const char *val = svn__apr_hash_index_val(hi);
if ((!strcmp(key, SVN_REPOS_DUMPFILE_CONTENT_LENGTH))
|| (!strcmp(key, SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH))
@@ -351,8 +351,8 @@ output_revision(struct revision_baton_t
hi;
hi = apr_hash_next(hi))
{
- const char *pname = svn_apr_hash_index_key(hi);
- const svn_string_t *pval = svn_apr_hash_index_val(hi);
+ const char *pname = svn__apr_hash_index_key(hi);
+ const svn_string_t *pval = svn__apr_hash_index_val(hi);
write_prop_to_stringbuf(&props, pname, pval);
}
@@ -550,8 +550,8 @@ new_node_record(void **node_baton,
for (hi = apr_hash_first(pool, headers); hi; hi = apr_hash_next(hi))
{
- const char *key = svn_apr_hash_index_key(hi);
- const char *val = svn_apr_hash_index_val(hi);
+ const char *key = svn__apr_hash_index_key(hi);
+ const char *val = svn__apr_hash_index_val(hi);
if ((!strcmp(key, SVN_REPOS_DUMPFILE_CONTENT_LENGTH))
|| (!strcmp(key, SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH))
@@ -672,8 +672,8 @@ adjust_mergeinfo(svn_string_t **final_va
SVN_ERR(svn_mergeinfo_parse(&mergeinfo, initial_val->data, subpool));
for (hi = apr_hash_first(subpool, mergeinfo); hi; hi = apr_hash_next(hi))
{
- const char *merge_source = svn_apr_hash_index_key(hi);
- apr_array_header_t *rangelist = svn_apr_hash_index_val(hi);
+ const char *merge_source = svn__apr_hash_index_key(hi);
+ apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
struct parse_baton_t *pb = rb->pb;
int i;
@@ -1132,7 +1132,7 @@ do_filter(apr_getopt_t *os,
hi;
hi = apr_hash_next(hi))
{
- const svn_revnum_t *revnum = svn_apr_hash_index_key(hi);
+ const svn_revnum_t *revnum = svn__apr_hash_index_key(hi);
APR_ARRAY_PUSH(keys, svn_revnum_t) = *revnum;
}
@@ -1176,7 +1176,7 @@ do_filter(apr_getopt_t *os,
hi;
hi = apr_hash_next(hi))
{
- const char *path = svn_apr_hash_index_key(hi);
+ const char *path = svn__apr_hash_index_key(hi);
APR_ARRAY_PUSH(keys, const char *) = path;
}
Modified: subversion/branches/svn-patch-improvements/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svnlook/main.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svnlook/main.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svnlook/main.c Tue Mar 30 20:57:53 2010
@@ -1218,7 +1218,7 @@ print_tree(svn_fs_root_t *root,
subpool = svn_pool_create(pool);
for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
{
- svn_fs_dirent_t *entry = svn_apr_hash_index_val(hi);
+ svn_fs_dirent_t *entry = svn__apr_hash_index_val(hi);
svn_pool_clear(subpool);
SVN_ERR(print_tree(root,
@@ -1729,8 +1729,8 @@ do_plist(svnlook_ctxt_t *c,
for (hi = apr_hash_first(pool, props); hi; hi = apr_hash_next(hi))
{
- const char *pname = svn_apr_hash_index_key(hi);
- svn_string_t *propval = svn_apr_hash_index_val(hi);
+ const char *pname = svn__apr_hash_index_key(hi);
+ svn_string_t *propval = svn__apr_hash_index_val(hi);
SVN_ERR(check_cancel(NULL));
@@ -1752,12 +1752,11 @@ do_plist(svnlook_ctxt_t *c,
else
printf(" %s : %s\n", pname_stdout, propval->data);
}
+ else if (xml)
+ svn_xml_make_open_tag(&sb, pool, svn_xml_self_closing, "property",
+ "name", pname, NULL);
else
- if (xml)
- svn_xml_make_open_tag(&sb, pool, svn_xml_self_closing, "property",
- "name", pname, NULL);
- else
- printf(" %s\n", pname);
+ printf(" %s\n", pname);
}
if (xml)
{
Modified: subversion/branches/svn-patch-improvements/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svnserve/serve.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svnserve/serve.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svnserve/serve.c Tue Mar 30 20:57:53 2010
@@ -772,7 +772,7 @@ static svn_error_t *finish_report(svn_ra
}
static svn_error_t *abort_report(svn_ra_svn_conn_t *conn, apr_pool_t *pool,
- apr_array_header_t *params, void *baton)
+ apr_array_header_t *params, void *baton)
{
report_driver_baton_t *b = baton;
@@ -864,7 +864,7 @@ static svn_error_t *accept_report(svn_bo
* values. */
static svn_error_t *write_prop_diffs(svn_ra_svn_conn_t *conn,
apr_pool_t *pool,
- apr_array_header_t *propdiffs)
+ const apr_array_header_t *propdiffs)
{
int i;
@@ -1065,7 +1065,7 @@ static svn_error_t *commit_done(const sv
* to the client. Use POOL for temporary allocations only.
*/
static svn_error_t *add_lock_tokens(svn_ra_svn_conn_t *conn,
- apr_array_header_t *lock_tokens,
+ const apr_array_header_t *lock_tokens,
server_baton_t *sb,
apr_pool_t *pool)
{
@@ -1117,7 +1117,7 @@ static svn_error_t *add_lock_tokens(svn_
/* Unlock the paths with lock tokens in LOCK_TOKENS, ignoring any errors.
LOCK_TOKENS contains svn_ra_svn_item_t elements, assumed to be lists. */
-static svn_error_t *unlock_paths(apr_array_header_t *lock_tokens,
+static svn_error_t *unlock_paths(const apr_array_header_t *lock_tokens,
server_baton_t *sb,
svn_ra_svn_conn_t *conn,
apr_pool_t *pool)
@@ -1430,8 +1430,8 @@ static svn_error_t *get_dir(svn_ra_svn_c
subpool = svn_pool_create(pool);
for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
{
- const char *name = svn_apr_hash_index_key(hi);
- svn_fs_dirent_t *fsent = svn_apr_hash_index_val(hi);
+ const char *name = svn__apr_hash_index_key(hi);
+ svn_fs_dirent_t *fsent = svn__apr_hash_index_val(hi);
svn_dirent_t *entry;
svn_pool_clear(subpool);
@@ -1495,8 +1495,8 @@ static svn_error_t *get_dir(svn_ra_svn_c
{
for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
{
- const char *name = svn_apr_hash_index_key(hi);
- svn_dirent_t *entry = svn_apr_hash_index_val(hi);
+ const char *name = svn__apr_hash_index_key(hi);
+ svn_dirent_t *entry = svn__apr_hash_index_val(hi);
cdate = (entry->time == (time_t) -1) ? NULL
: svn_time_to_cstring(entry->time, pool);
@@ -1761,8 +1761,8 @@ static svn_error_t *get_mergeinfo(svn_ra
iterpool = svn_pool_create(pool);
for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
{
- const char *key = svn_apr_hash_index_key(hi);
- svn_mergeinfo_t value = svn_apr_hash_index_val(hi);
+ const char *key = svn__apr_hash_index_key(hi);
+ svn_mergeinfo_t value = svn__apr_hash_index_val(hi);
svn_string_t *mergeinfo_string;
svn_pool_clear(iterpool);
@@ -1810,8 +1810,8 @@ static svn_error_t *log_receiver(void *b
for (h = apr_hash_first(pool, log_entry->changed_paths2); h;
h = apr_hash_next(h))
{
- const char *path = svn_apr_hash_index_key(h);
- svn_log_changed_path2_t *change = svn_apr_hash_index_val(h);
+ const char *path = svn__apr_hash_index_key(h);
+ svn_log_changed_path2_t *change = svn__apr_hash_index_val(h);
action[0] = change->action;
action[1] = '\0';
@@ -2084,8 +2084,8 @@ static svn_error_t *get_locations(svn_ra
for (iter = apr_hash_first(pool, fs_locations); iter;
iter = apr_hash_next(iter))
{
- const svn_revnum_t *iter_key = svn_apr_hash_index_key(iter);
- const char *iter_value = svn_apr_hash_index_val(iter);
+ const svn_revnum_t *iter_key = svn__apr_hash_index_key(iter);
+ const char *iter_value = svn__apr_hash_index_val(iter);
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "rc",
*iter_key, iter_value));
@@ -2591,7 +2591,7 @@ static svn_error_t *get_locks(svn_ra_svn
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w((!", "success"));
for (hi = apr_hash_first(pool, locks); hi; hi = apr_hash_next(hi))
{
- svn_lock_t *l = svn_apr_hash_index_val(hi);
+ svn_lock_t *l = svn__apr_hash_index_val(hi);
SVN_ERR(write_lock(conn, pool, l));
}
@@ -2810,7 +2810,7 @@ repos_path_valid(const char *path)
static svn_error_t *find_repos(const char *url, const char *root,
server_baton_t *b,
svn_ra_svn_conn_t *conn,
- apr_array_header_t *capabilities,
+ const apr_array_header_t *capabilities,
apr_pool_t *pool)
{
const char *path, *full_path, *repos_root, *fs_path;
Modified: subversion/branches/svn-patch-improvements/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svnsync/main.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svnsync/main.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svnsync/main.c Tue Mar 30 20:57:53 2010
@@ -437,7 +437,7 @@ remove_props_not_in_source(svn_ra_sessio
hi;
hi = apr_hash_next(hi))
{
- const char *propname = svn_apr_hash_index_key(hi);
+ const char *propname = svn__apr_hash_index_key(hi);
svn_pool_clear(subpool);
@@ -477,8 +477,8 @@ filter_props(int *filtered_count, apr_ha
for (hi = apr_hash_first(pool, props); hi ; hi = apr_hash_next(hi))
{
- const char *propname = svn_apr_hash_index_key(hi);
- void *propval = svn_apr_hash_index_val(hi);
+ const char *propname = svn__apr_hash_index_key(hi);
+ void *propval = svn__apr_hash_index_val(hi);
/* Copy all properties:
- not matching the exclude pattern if provided OR
@@ -519,8 +519,8 @@ write_revprops(int *filtered_count,
for (hi = apr_hash_first(pool, rev_props); hi; hi = apr_hash_next(hi))
{
- const char *propname = svn_apr_hash_index_key(hi);
- const svn_string_t *propval = svn_apr_hash_index_val(hi);
+ const char *propname = svn__apr_hash_index_key(hi);
+ const svn_string_t *propval = svn__apr_hash_index_val(hi);
svn_pool_clear(subpool);
Modified: subversion/branches/svn-patch-improvements/subversion/svnsync/sync.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svnsync/sync.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svnsync/sync.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svnsync/sync.c Tue Mar 30 20:57:53 2010
@@ -100,8 +100,8 @@ svnsync_normalize_revprops(apr_hash_t *r
hi;
hi = apr_hash_next(hi))
{
- const char *propname = svn_apr_hash_index_key(hi);
- const svn_string_t *propval = svn_apr_hash_index_val(hi);
+ const char *propname = svn__apr_hash_index_key(hi);
+ const svn_string_t *propval = svn__apr_hash_index_val(hi);
if (svn_prop_needs_translation(propname))
{
Modified: subversion/branches/svn-patch-improvements/subversion/svnversion/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/svnversion/main.c?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/svnversion/main.c (original)
+++ subversion/branches/svn-patch-improvements/subversion/svnversion/main.c Tue Mar 30 20:57:53 2010
@@ -253,18 +253,25 @@ main(int argc, const char *argv[])
return EXIT_SUCCESS;
}
- SVN_INT_ERR(svn_wc_revision_status2(&res, wc_ctx, local_abspath,
- trail_url, committed, NULL, NULL,
- pool, pool));
+ err = svn_wc_revision_status2(&res, wc_ctx, local_abspath,
+ trail_url, committed, NULL, NULL,
+ pool, pool);
- /* Unversioned file in versioned directory */
- if (res->min_rev == -1)
+ if (err)
{
- SVN_INT_ERR(svn_cmdline_printf(pool, _("Unversioned file%s"),
- no_newline ? "" : "\n"));
- svn_pool_destroy(pool);
- return EXIT_SUCCESS;
+ /* Unversioned file in versioned directory */
+ if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+ {
+ svn_error_clear(err);
+ SVN_INT_ERR(svn_cmdline_printf(pool, _("Unversioned file%s"),
+ no_newline ? "" : "\n"));
+ svn_pool_destroy(pool);
+ return EXIT_SUCCESS;
+ }
+ else
+ SVN_INT_ERR(err);
}
+
}
else if (kind == svn_node_none)
{
Modified: subversion/branches/svn-patch-improvements/subversion/tests/README
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/README?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/README (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/README Tue Mar 30 20:57:53 2010
@@ -86,7 +86,7 @@ correctly, nor as a place-holder for a t
Each test function conforms to the svn_test_driver_t prototype:
- svn_error_t *f (const char **MSG,
+ svn_error_t *f (const char **MSG,
svn_boolean_t MSG_ONLY
apr_pool_t *POOL);
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/checkout_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/checkout_tests.py Tue Mar 30 20:57:53 2010
@@ -26,7 +26,7 @@
######################################################################
# General modules
-import sys, re, os, time
+import sys, re, os, time, subprocess
# Our testing module
import svntest
@@ -824,6 +824,87 @@ def co_with_obstructing_local_adds(sbox)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
#----------------------------------------------------------------------
+# Test if checking out from a Windows driveroot is supported.
+def checkout_wc_from_drive(sbox):
+ "checkout from the root of a Windows drive"
+
+ def find_the_next_available_drive_letter():
+ "find the first available drive"
+
+ # get the list of used drive letters, use some Windows specific function.
+ try:
+ import win32api
+
+ drives=win32api.GetLogicalDriveStrings()
+ drives=drives.split('\000')
+
+ for d in range(ord('G'), ord('Z')+1):
+ drive = chr(d)
+ if not drive + ':\\' in drives:
+ return drive
+ except ImportError:
+ # In ActiveState python x64 win32api is not available
+ for d in range(ord('G'), ord('Z')+1):
+ drive = chr(d)
+ if not os.path.isdir(drive + ':\\'):
+ return drive
+
+ return None
+
+ # Skip the test if not on Windows
+ if not svntest.main.windows:
+ raise svntest.Skip
+
+ # just create an empty folder, we'll checkout later.
+ sbox.build(create_wc = False)
+ svntest.main.safe_rmtree(sbox.wc_dir)
+ os.mkdir(sbox.wc_dir)
+
+ # create a virtual drive to the working copy folder
+ drive = find_the_next_available_drive_letter()
+ if drive is None:
+ raise svntest.Skip
+
+ subprocess.call(['subst', drive +':', sbox.repo_dir])
+ repo_url = 'file:///' + drive + ':/'
+ wc_dir = sbox.wc_dir
+ was_cwd = os.getcwd()
+
+ try:
+ expected_wc = svntest.main.greek_state.copy()
+ expected_output = wc.State(wc_dir, {
+ 'A' : Item(status='A '),
+ 'A/D' : Item(status='A '),
+ 'A/D/H' : Item(status='A '),
+ 'A/D/H/psi' : Item(status='A '),
+ 'A/D/H/chi' : Item(status='A '),
+ 'A/D/H/omega' : Item(status='A '),
+ 'A/D/G' : Item(status='A '),
+ 'A/D/G/tau' : Item(status='A '),
+ 'A/D/G/pi' : Item(status='A '),
+ 'A/D/G/rho' : Item(status='A '),
+ 'A/D/gamma' : Item(status='A '),
+ 'A/C' : Item(status='A '),
+ 'A/mu' : Item(status='A '),
+ 'A/B' : Item(status='A '),
+ 'A/B/E' : Item(status='A '),
+ 'A/B/E/alpha' : Item(status='A '),
+ 'A/B/E/beta' : Item(status='A '),
+ 'A/B/F' : Item(status='A '),
+ 'A/B/lambda' : Item(status='A '),
+ 'iota' : Item(status='A '),
+ })
+ svntest.actions.run_and_verify_checkout(repo_url, wc_dir,
+ expected_output, expected_wc,
+ None, None, None, None,
+ '--force')
+
+ finally:
+ os.chdir(was_cwd)
+ # cleanup the virtual drive
+ subprocess.call(['subst', '/D', drive +':'])
+
+#----------------------------------------------------------------------
# list all tests here, starting with None:
test_list = [ None,
@@ -840,6 +921,7 @@ test_list = [ None,
checkout_peg_rev,
checkout_peg_rev_date,
co_with_obstructing_local_adds,
+ checkout_wc_from_drive
]
if __name__ == "__main__":
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/commit_tests.py Tue Mar 30 20:57:53 2010
@@ -1496,8 +1496,11 @@ def commit_multiple_wc_multiple_repos(sb
svntest.actions.run_and_verify_status(wc2_dir, expected_status2)
# Commit should fail, since WCs come from different repositories.
+ # The exact error message depends on whether or not the tests are
+ # run below a 1.7 working copy
+ error_re = ".*(is not a|Are all targets part of the same) working copy.*"
svntest.actions.run_and_verify_svn("Expected output on stderr doesn't match",
- [], ".*is not a working copy.*",
+ [], error_re,
'commit', '-m', 'log',
wc1_dir, wc2_dir)
@@ -2430,7 +2433,7 @@ def set_invalid_revprops(sbox):
svntest.actions.run_and_verify_svn(None, [],
'svn: Revision property pair is empty',
'mkdir', '-m', 'msg',
- '--with-revprop', '',
+ '--with-revprop', '',
remote_dir)
#----------------------------------------------------------------------
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/copy_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/copy_tests.py Tue Mar 30 20:57:53 2010
@@ -29,7 +29,7 @@ import stat, os, re, shutil
# Our testing module
import svntest
-
+from svntest import main
from svntest.main import SVN_PROP_MERGEINFO
# (abbreviation)
@@ -4322,6 +4322,74 @@ def reverse_merge_move(sbox):
None,
None)
+def nonrecursive_commit_of_copy(sbox):
+ """commit only top of copy; check child behavior"""
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ main.run_svn(None, 'cp', os.path.join(wc_dir, 'A'),
+ os.path.join(wc_dir, 'A_new'))
+ main.run_svn(None, 'cp', os.path.join(wc_dir, 'A/D/G'),
+ os.path.join(wc_dir, 'A_new/G_new'))
+ main.run_svn(None, 'rm', os.path.join(wc_dir, 'A_new/C'))
+ main.run_svn(None, 'rm', os.path.join(wc_dir, 'A_new/B/E'))
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'A_new' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A_new/D' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/G' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/G/pi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/G/rho' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/G/tau' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/H' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/H/psi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/H/chi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/H/omega' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/D/gamma' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/B' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/B/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/B/E' : Item(status='D ', wc_rev='?'),
+ 'A_new/B/E/alpha' : Item(status='D ', wc_rev='?'),
+ 'A_new/B/E/beta' : Item(status='D ', wc_rev='?'),
+ 'A_new/B/F' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/mu' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/C' : Item(status='D ', wc_rev='?'),
+ 'A_new/G_new' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A_new/G_new/pi' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/G_new/rho' : Item(status=' ', copied='+', wc_rev='-'),
+ 'A_new/G_new/tau' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+
+
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A_new': Item(verb='Adding'),
+ })
+
+ # These nodes are added by the commit
+ expected_status.tweak('A_new', 'A_new/D', 'A_new/D/G', 'A_new/D/G/pi',
+ 'A_new/D/G/rho', 'A_new/D/G/tau', 'A_new/D/H',
+ 'A_new/D/H/psi', 'A_new/D/H/chi', 'A_new/D/H/omega',
+ 'A_new/D/gamma', 'A_new/B', 'A_new/B/lambda',
+ 'A_new/B/F', 'A_new/mu',
+ status=' ', copied=None, wc_rev='2')
+
+ # And these are deleted with their parent (not sure if this is ok)
+ expected_status.remove('A_new/C', 'A_new/B/E', 'A_new/B/E/alpha',
+ 'A_new/B/E/beta')
+
+ # 'A_new/G_new' and everything below should still be added
+ # as their operation root was not committed
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ wc_dir, '--depth', 'immediates')
+
+
########################################################################
# Run the tests
@@ -4410,6 +4478,7 @@ test_list = [ None,
copy_below_copy,
XFail(move_below_move),
reverse_merge_move,
+ XFail(nonrecursive_commit_of_copy),
]
if __name__ == '__main__':
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/depth_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/depth_tests.py Tue Mar 30 20:57:53 2010
@@ -2228,8 +2228,8 @@ def excluded_path_misc_operation(sbox):
svntest.actions.run_and_verify_commit(wc_dir,
expected_output,
expected_status,
- None,
- wc_dir)
+ None,
+ wc_dir)
# Relocate wc, with excluded items in it.
repo_dir = sbox.repo_dir
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/export_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/export_tests.py Tue Mar 30 20:57:53 2010
@@ -409,12 +409,12 @@ def export_to_explicit_cwd(sbox):
sbox.build(create_wc = False, read_only = True)
svntest.main.safe_rmtree(sbox.wc_dir)
- expected_output = svntest.tree.build_generic_tree([
- Item(status='A ').as_node_tuple('iota'),
- ]).as_state()
- expected_disk = svntest.tree.build_generic_tree([
- Item(contents="This is the file 'iota'.\n").as_node_tuple('iota'),
- ]).as_state()
+ expected_output = svntest.wc.State('', {
+ 'iota': Item(status='A '),
+ })
+ expected_disk = svntest.wc.State('', {
+ 'iota': Item(contents="This is the file 'iota'.\n"),
+ })
os.mkdir(sbox.wc_dir)
os.chdir(sbox.wc_dir)
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/lock_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/lock_tests.py Tue Mar 30 20:57:53 2010
@@ -1451,7 +1451,7 @@ def lock_path_not_in_head(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'delete', lambda_path, D_path)
svntest.actions.run_and_verify_svn(None, None, [], 'commit',
- '-m', 'Some deletions', wc_dir)
+ '-m', 'Some deletions', wc_dir)
svntest.actions.run_and_verify_svn(None, None, [], 'up', '-r1', wc_dir)
expected_lock_fail_err_re = "svn: warning:.*" \
"((Path .* doesn't exist in HEAD revision)" \
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/log_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/log_tests.py Tue Mar 30 20:57:53 2010
@@ -68,6 +68,7 @@ msg_separator = '-----------------------
Skip = svntest.testcase.Skip
SkipUnless = svntest.testcase.SkipUnless
XFail = svntest.testcase.XFail
+Wimp = svntest.testcase.Wimp
Item = svntest.wc.StateItem
@@ -1432,22 +1433,35 @@ def log_xml_with_bad_data(sbox):
def merge_sensitive_log_target_with_bogus_mergeinfo(sbox):
"'svn log -g target_with_bogus_mergeinfo'"
- #Refer issue 3172 for details.
- #Create greek tree
- #svn ps 'svn:mergeinfo' '/A/B:0' A/D
- #svn ci -m 'setting bogus mergeinfo'
- #svn log -g -r2
+ # A test for issue #3172 'svn log -g' seems to encounter error on server':
+ # 'log -g' fails the moment it encounters a bogus mergeinfo which claims a
+ # merge from a non-existentpath@REV1-REV2.
+ #
+ # ### Present test: test that 'svn log -g' does not report an error.
+ # ### Desirable test: test that 'svn log -g' produces the results expected
+ # from ignoring all such revisions and reporting on all revisions that
+ # are valid.
+
+ # In r2, create /A/B-copied as a copy of something that existed at r1, and
+ # /A/B-new as something new. Manually set mergeinfo on /A/C@2 saying it
+ # was merged from the non-existent r1 of /A/B-copied, and on /A/D@2 saying
+ # it was merged from the non-existent r1 of /A/B-new.
sbox.build()
wc_path = sbox.wc_dir
+ B_copied_path = os.path.join(wc_path, 'A', 'B-copied')
+ B_new_path = os.path.join(wc_path, 'A', 'B-new')
+ B_path = os.path.join(wc_path, 'A', 'B')
+ C_path = os.path.join(wc_path, 'A', 'C')
D_path = os.path.join(wc_path, 'A', 'D')
- svntest.main.run_svn(None, 'ps', SVN_PROP_MERGEINFO, '/A/B:0', D_path)
- #commit at r2
- svntest.main.run_svn(None, 'ci', '-m', 'setting bogus mergeinfo', D_path)
- exit_code, output, err = svntest.actions.run_and_verify_svn(None, None,
- [], 'log',
- '-g', D_path)
- if len(err):
- raise svntest.Failure("svn log -g target_with_bogus_mergeinfo fails")
+ svntest.main.run_svn(None, 'cp', B_path, B_copied_path)
+ svntest.main.run_svn(None, 'ps', SVN_PROP_MERGEINFO, '/A/B-copied:1', C_path)
+ svntest.main.run_svn(None, 'mkdir', B_new_path)
+ svntest.main.run_svn(None, 'ps', SVN_PROP_MERGEINFO, '/A/B-new:1', D_path)
+ svntest.main.run_svn(None, 'ci', '-m', 'setting bogus mergeinfo', wc_path)
+
+ # The tests: Check that 'svn log -g' doesn't error on these.
+ svntest.actions.run_and_verify_svn(None, None, [], 'log', '-g', C_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'log', '-g', D_path)
def merge_sensitive_log_added_mergeinfo_replaces_inherited(sbox):
"log -g and explicit mergeinfo replacing inherited"
@@ -1689,7 +1703,7 @@ def log_of_local_copy(sbox):
C_path, C_moved_path)
svntest.actions.run_and_verify_svn(None, None, [], 'mv',
psi_path, psi_moved_path)
-
+
# Get the logs for the move destinations.
#
# This was failing with:
@@ -1752,7 +1766,7 @@ test_list = [ None,
retrieve_revprops,
log_xml_with_bad_data,
SkipUnless(merge_sensitive_log_target_with_bogus_mergeinfo,
- server_has_mergeinfo),
+ server_has_mergeinfo),
SkipUnless(merge_sensitive_log_added_mergeinfo_replaces_inherited,
server_has_mergeinfo),
SkipUnless(merge_sensitive_log_propmod_merge_inheriting_path,
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_authz_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_authz_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_authz_tests.py Tue Mar 30 20:57:53 2010
@@ -388,7 +388,7 @@ def mergeinfo_and_skipped_paths(sbox):
svntest.actions.run_and_verify_merge(A_COPY_2_H_path, '4', '5',
sbox.repo_url + '/A/D/H', None,
expected_output,
- None, # expected_mergeinfo_output,
+ None, # expected_mergeinfo_output,
expected_elision_output,
expected_disk,
expected_status,
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/merge_tests.py Tue Mar 30 20:57:53 2010
@@ -3011,7 +3011,7 @@ def merge_dir_and_file_replace(sbox):
'A/C/foo' : Item(verb='Replacing'),
'A/C/foo/bar' : Item(verb='Adding'),
})
-
+
expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
expected_status.add({
'A/B/F/foo' : Item(status=' ', wc_rev=5),
@@ -7838,7 +7838,7 @@ def merge_away_subtrees_noninheritable_r
'mu' : Item(status=' G'),
})
expected_elision_output = wc.State('.', {
- })
+ })
expected_status = wc.State('.', {
'' : Item(status=' M'),
'B' : Item(status=' '),
@@ -10746,7 +10746,7 @@ def reintegrate_with_rename(sbox):
'D/G/tauprime' : Item(status=' G'),
})
expected_elision_output = wc.State(A_path, {
- })
+ })
k_expected_status = wc.State(A_path, {
"B" : Item(status=' ', wc_rev=9),
"B/lambda" : Item(status=' ', wc_rev=9),
@@ -12378,7 +12378,7 @@ def merge_chokes_on_renamed_subtrees(sbo
# svn: svn: File not found: revision 3, path '/A/D/H/psi'
svntest.actions.run_and_verify_svn(
None,
- expected_merge_output([[5,6],[3,6]],
+ expected_merge_output([[5,6],[3,6]],
['U ' + psi_COPY_moved_path + '\n',
' U ' + psi_COPY_moved_path + '\n',
' G ' + psi_COPY_moved_path + '\n',],
@@ -13227,7 +13227,7 @@ def subtree_source_missing_in_requested_
'' : Item(status=' U'),
'D/H/psi' : Item(status=' U'),
'D/H/omega' : Item(status=' U'),
- })
+ })
expected_status = wc.State(A_COPY_path, {
'' : Item(status=' M', wc_rev=13),
'B' : Item(status=' ', wc_rev=13),
@@ -18447,7 +18447,7 @@ def merge_into_wc_for_deleted_branch(sbo
# Some paths we'll care about
A_COPY_path = os.path.join(wc_dir, "A_COPY")
gamma_path = os.path.join(wc_dir, "A", "D", "gamma")
-
+
# r7 - Delete the branch on the repository, obviously it still
# exists in our WC.
svntest.actions.run_and_verify_svn(None, None, [],
@@ -18539,7 +18539,7 @@ def merge_into_wc_for_deleted_branch(sbo
expected_status,
expected_skip,
None, None, None, None,
- None, 1, 0)
+ None, 1, 0)
# Test for a reintegrate bug which can occur when the merge source
# has mergeinfo that explicitly describes common history with the reintegrate
@@ -18562,7 +18562,7 @@ def reintegrate_with_self_referential_me
A2_B_path = os.path.join(wc_dir, "A2", "B")
A2_1_path = os.path.join(wc_dir, "A2.1")
A2_1_mu_path = os.path.join(wc_dir, "A2.1", "mu")
-
+
# r6 Copy A to A2 and then manually set some self-referential mergeinfo on
# A2/B and A2.
svntest.actions.run_and_verify_svn(None, ["At revision 5.\n"], [],
@@ -18592,7 +18592,7 @@ def reintegrate_with_self_referential_me
svntest.actions.run_and_verify_svn(None, None, [], 'ci',
'-m', 'Work done on the A2.1 branch.',
wc_dir)
-
+
# Update to uniform revision and reintegrate A2.1 back to A2.
# Note that the mergeinfo on A2/B is not changed by the reintegration
# and so is not expected to by updated to describe the merge.
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/mergeinfo_tests.py Tue Mar 30 20:57:53 2010
@@ -371,7 +371,7 @@ def mergeinfo_on_pegged_wc_path(sbox):
psi_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "psi")
omega_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "H", "omega")
beta_COPY_path = os.path.join(wc_dir, "A_COPY", "B", "E", "beta")
-
+
# Do a couple merges
#
# r7 - Merge -c3,6 from A to A_COPY.
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/patch_tests.py Tue Mar 30 20:57:53 2010
@@ -838,13 +838,13 @@ def patch_strip1(sbox):
def patch_add_new_dir(sbox):
"patch with missing dirs"
-
+
sbox.build()
wc_dir = sbox.wc_dir
-
+
patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
- # The first diff is adding 'new' with two missing dirs. The second is
+ # The first diff is adding 'new' with two missing dirs. The second is
# adding 'new' with one missing dir to a 'A' that is locally deleted
# (should be skipped). The third is adding 'new' with a directory that
# is unversioned (should be skipped as well).
@@ -902,7 +902,7 @@ def patch_add_new_dir(sbox):
expected_skip = wc.State('', {A_C_Y_new_path : Item(),
A_Z_new_path : Item() })
- svntest.actions.run_and_verify_patch(wc_dir,
+ svntest.actions.run_and_verify_patch(wc_dir,
os.path.abspath(patch_file_path),
expected_output,
expected_disk,
@@ -1677,8 +1677,166 @@ def patch_with_svn_eol_style_uncommitted
expected_output = ["Reverted '" + mu_path + "'\n"]
svntest.actions.run_and_verify_svn(None, expected_output, [], 'revert', '-R', wc_dir)
+def patch_with_include_patterns(sbox):
+ "patch with include-patterns"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+
+ mu_contents = [
+ "Dear internet user,\n",
+ "\n",
+ "We wish to congratulate you over your email success in our computer\n",
+ "Balloting. This is a Millennium Scientific Electronic Computer Draw\n",
+ "in which email addresses were used. All participants were selected\n",
+ "through a computer ballot system drawn from over 100,000 company\n",
+ "and 50,000,000 individual email addresses from all over the world.\n",
+ "\n",
+ "Your email address drew and have won the sum of 750,000 Euros\n",
+ "( Seven Hundred and Fifty Thousand Euros) in cash credited to\n",
+ "file with\n",
+ " REFERENCE NUMBER: ESP/WIN/008/05/10/MA;\n",
+ " WINNING NUMBER : 14-17-24-34-37-45-16\n",
+ " BATCH NUMBERS :\n",
+ " EULO/1007/444/606/08;\n",
+ " SERIAL NUMBER: 45327\n",
+ "and PROMOTION DATE: 13th June. 2009\n",
+ "\n",
+ "To claim your winning prize, you are to contact the appointed\n",
+ "agent below as soon as possible for the immediate release of your\n",
+ "winnings with the below details.\n",
+ "\n",
+ "Again, we wish to congratulate you over your email success in our\n"
+ "computer Balloting.\n"
+ ]
+
+ # Set mu contents
+ svntest.main.file_write(mu_path, ''.join(mu_contents))
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/mu' : Item(verb='Sending'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', wc_rev=2)
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ # Apply patch
+
+ unidiff_patch = [
+ "Index: A/D/gamma\n",
+ "===================================================================\n",
+ "--- A/D/gamma\t(revision 1)\n",
+ "+++ A/D/gamma\t(working copy)\n",
+ "@@ -1 +1 @@\n",
+ "-This is the file 'gamma'.\n",
+ "+It is the file 'gamma'.\n",
+ "Index: iota\n",
+ "===================================================================\n",
+ "--- iota\t(revision 1)\n",
+ "+++ iota\t(working copy)\n",
+ "@@ -1 +1,2 @@\n",
+ " This is the file 'iota'.\n",
+ "+Some more bytes\n",
+ "\n",
+ "Index: new\n",
+ "===================================================================\n",
+ "--- new (revision 0)\n",
+ "+++ new (revision 0)\n",
+ "@@ -0,0 +1 @@\n",
+ "+new\n",
+ "\n",
+ "--- A/mu.orig 2009-06-24 15:23:55.000000000 +0100\n",
+ "+++ A/mu 2009-06-24 15:21:23.000000000 +0100\n",
+ "@@ -6,6 +6,9 @@\n",
+ " through a computer ballot system drawn from over 100,000 company\n",
+ " and 50,000,000 individual email addresses from all over the world.\n",
+ " \n",
+ "+It is a promotional program aimed at encouraging internet users;\n",
+ "+therefore you do not need to buy ticket to enter for it.\n",
+ "+\n",
+ " Your email address drew and have won the sum of 750,000 Euros\n",
+ " ( Seven Hundred and Fifty Thousand Euros) in cash credited to\n",
+ " file with\n",
+ "@@ -14,11 +17,8 @@\n",
+ " BATCH NUMBERS :\n",
+ " EULO/1007/444/606/08;\n",
+ " SERIAL NUMBER: 45327\n",
+ "-and PROMOTION DATE: 13th June. 2009\n",
+ "+and PROMOTION DATE: 14th June. 2009\n",
+ " \n",
+ " To claim your winning prize, you are to contact the appointed\n",
+ " agent below as soon as possible for the immediate release of your\n",
+ " winnings with the below details.\n",
+ "-\n",
+ "-Again, we wish to congratulate you over your email success in our\n",
+ "-computer Balloting.\n",
+ "Index: A/B/E/beta\n",
+ "===================================================================\n",
+ "--- A/B/E/beta (revision 1)\n",
+ "+++ A/B/E/beta (working copy)\n",
+ "@@ -1 +0,0 @@\n",
+ "-This is the file 'beta'.\n",
+ ]
+
+ svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+ gamma_contents = "It is the file 'gamma'.\n"
+ iota_contents = "This is the file 'iota'.\nSome more bytes\n"
+ new_contents = "new\n"
+ mu_contents = [
+ "Dear internet user,\n",
+ "\n",
+ "We wish to congratulate you over your email success in our computer\n",
+ "Balloting. This is a Millennium Scientific Electronic Computer Draw\n",
+ "in which email addresses were used. All participants were selected\n",
+ "through a computer ballot system drawn from over 100,000 company\n",
+ "and 50,000,000 individual email addresses from all over the world.\n",
+ "\n",
+ "It is a promotional program aimed at encouraging internet users;\n",
+ "therefore you do not need to buy ticket to enter for it.\n",
+ "\n",
+ "Your email address drew and have won the sum of 750,000 Euros\n",
+ "( Seven Hundred and Fifty Thousand Euros) in cash credited to\n",
+ "file with\n",
+ " REFERENCE NUMBER: ESP/WIN/008/05/10/MA;\n",
+ " WINNING NUMBER : 14-17-24-34-37-45-16\n",
+ " BATCH NUMBERS :\n",
+ " EULO/1007/444/606/08;\n",
+ " SERIAL NUMBER: 45327\n",
+ "and PROMOTION DATE: 14th June. 2009\n",
+ "\n",
+ "To claim your winning prize, you are to contact the appointed\n",
+ "agent below as soon as possible for the immediate release of your\n",
+ "winnings with the below details.\n",
+ ]
+
+ expected_output = [
+ 'U %s\n' % os.path.join(wc_dir, 'A', 'mu'),
+ ]
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.tweak('A/mu', contents=''.join(mu_contents))
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', status='M ', wc_rev=2)
+
+ expected_skip = wc.State('', { })
+
+ svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, # expected err
+ 1, # check-props
+ 1, # dry-run
+ "--include-pattern", "A/mu")
+
def patch_with_exclude_patterns(sbox):
- "patch with --exclude-patterns"
+ "patch with exclude-patterns"
sbox.build()
wc_dir = sbox.wc_dir
@@ -1837,6 +1995,172 @@ def patch_with_exclude_patterns(sbox):
"--exclude-pattern", "new",
"--exclude-pattern", "*a")
+def patch_with_include_exclude_patterns(sbox):
+ "patch with include-patterns and exclude-patterns"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ patch_file_path = tempfile.mkstemp(dir=os.path.abspath(svntest.main.temp_dir))[1]
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+
+ mu_contents = [
+ "Dear internet user,\n",
+ "\n",
+ "We wish to congratulate you over your email success in our computer\n",
+ "Balloting. This is a Millennium Scientific Electronic Computer Draw\n",
+ "in which email addresses were used. All participants were selected\n",
+ "through a computer ballot system drawn from over 100,000 company\n",
+ "and 50,000,000 individual email addresses from all over the world.\n",
+ "\n",
+ "Your email address drew and have won the sum of 750,000 Euros\n",
+ "( Seven Hundred and Fifty Thousand Euros) in cash credited to\n",
+ "file with\n",
+ " REFERENCE NUMBER: ESP/WIN/008/05/10/MA;\n",
+ " WINNING NUMBER : 14-17-24-34-37-45-16\n",
+ " BATCH NUMBERS :\n",
+ " EULO/1007/444/606/08;\n",
+ " SERIAL NUMBER: 45327\n",
+ "and PROMOTION DATE: 13th June. 2009\n",
+ "\n",
+ "To claim your winning prize, you are to contact the appointed\n",
+ "agent below as soon as possible for the immediate release of your\n",
+ "winnings with the below details.\n",
+ "\n",
+ "Again, we wish to congratulate you over your email success in our\n"
+ "computer Balloting.\n"
+ ]
+
+ # Set mu contents
+ svntest.main.file_write(mu_path, ''.join(mu_contents))
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/mu' : Item(verb='Sending'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', wc_rev=2)
+ svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+ expected_status, None, wc_dir)
+
+ # Apply patch
+
+ unidiff_patch = [
+ "Index: A/D/gamma\n",
+ "===================================================================\n",
+ "--- A/D/gamma\t(revision 1)\n",
+ "+++ A/D/gamma\t(working copy)\n",
+ "@@ -1 +1 @@\n",
+ "-This is the file 'gamma'.\n",
+ "+It is the file 'gamma'.\n",
+ "Index: iota\n",
+ "===================================================================\n",
+ "--- iota\t(revision 1)\n",
+ "+++ iota\t(working copy)\n",
+ "@@ -1 +1,2 @@\n",
+ " This is the file 'iota'.\n",
+ "+Some more bytes\n",
+ "\n",
+ "Index: new\n",
+ "===================================================================\n",
+ "--- new (revision 0)\n",
+ "+++ new (revision 0)\n",
+ "@@ -0,0 +1 @@\n",
+ "+new\n",
+ "\n",
+ "--- A/mu.orig 2009-06-24 15:23:55.000000000 +0100\n",
+ "+++ A/mu 2009-06-24 15:21:23.000000000 +0100\n",
+ "@@ -6,6 +6,9 @@\n",
+ " through a computer ballot system drawn from over 100,000 company\n",
+ " and 50,000,000 individual email addresses from all over the world.\n",
+ " \n",
+ "+It is a promotional program aimed at encouraging internet users;\n",
+ "+therefore you do not need to buy ticket to enter for it.\n",
+ "+\n",
+ " Your email address drew and have won the sum of 750,000 Euros\n",
+ " ( Seven Hundred and Fifty Thousand Euros) in cash credited to\n",
+ " file with\n",
+ "@@ -14,11 +17,8 @@\n",
+ " BATCH NUMBERS :\n",
+ " EULO/1007/444/606/08;\n",
+ " SERIAL NUMBER: 45327\n",
+ "-and PROMOTION DATE: 13th June. 2009\n",
+ "+and PROMOTION DATE: 14th June. 2009\n",
+ " \n",
+ " To claim your winning prize, you are to contact the appointed\n",
+ " agent below as soon as possible for the immediate release of your\n",
+ " winnings with the below details.\n",
+ "-\n",
+ "-Again, we wish to congratulate you over your email success in our\n",
+ "-computer Balloting.\n",
+ "Index: A/B/E/beta\n",
+ "===================================================================\n",
+ "--- A/B/E/beta (revision 1)\n",
+ "+++ A/B/E/beta (working copy)\n",
+ "@@ -1 +0,0 @@\n",
+ "-This is the file 'beta'.\n",
+ ]
+
+ svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+ gamma_contents = "It is the file 'gamma'.\n"
+ iota_contents = "This is the file 'iota'.\nSome more bytes\n"
+ new_contents = "new\n"
+ mu_contents = [
+ "Dear internet user,\n",
+ "\n",
+ "We wish to congratulate you over your email success in our computer\n",
+ "Balloting. This is a Millennium Scientific Electronic Computer Draw\n",
+ "in which email addresses were used. All participants were selected\n",
+ "through a computer ballot system drawn from over 100,000 company\n",
+ "and 50,000,000 individual email addresses from all over the world.\n",
+ "\n",
+ "It is a promotional program aimed at encouraging internet users;\n",
+ "therefore you do not need to buy ticket to enter for it.\n",
+ "\n",
+ "Your email address drew and have won the sum of 750,000 Euros\n",
+ "( Seven Hundred and Fifty Thousand Euros) in cash credited to\n",
+ "file with\n",
+ " REFERENCE NUMBER: ESP/WIN/008/05/10/MA;\n",
+ " WINNING NUMBER : 14-17-24-34-37-45-16\n",
+ " BATCH NUMBERS :\n",
+ " EULO/1007/444/606/08;\n",
+ " SERIAL NUMBER: 45327\n",
+ "and PROMOTION DATE: 14th June. 2009\n",
+ "\n",
+ "To claim your winning prize, you are to contact the appointed\n",
+ "agent below as soon as possible for the immediate release of your\n",
+ "winnings with the below details.\n",
+ ]
+
+ expected_output = [
+ 'U %s\n' % os.path.join(wc_dir, 'iota'),
+ 'U %s\n' % os.path.join(wc_dir, 'A', 'mu'),
+ 'D %s\n' % os.path.join(wc_dir, 'A', 'B', 'E', 'beta'),
+ ]
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.tweak('A/mu', contents=''.join(mu_contents))
+ expected_disk.tweak('iota', contents=''.join(iota_contents))
+ expected_disk.remove('A/B/E/beta')
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', status='M ', wc_rev=2)
+ expected_status.tweak('iota', status='M ')
+ expected_status.tweak('A/B/E/beta', status='D ')
+
+ expected_skip = wc.State('', { })
+
+ svntest.actions.run_and_verify_patch(wc_dir, os.path.abspath(patch_file_path),
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, # expected err
+ 1, # check-props
+ 1, # dry-run
+ "--include-pattern", "A/mu",
+ "--include-pattern", "*a",
+ "--exclude-pattern", "A/*/gamma")
+
########################################################################
#Run the tests
@@ -1855,7 +2179,9 @@ test_list = [ None,
patch_no_svn_eol_style,
patch_with_svn_eol_style,
patch_with_svn_eol_style_uncommitted,
+ patch_with_include_patterns,
patch_with_exclude_patterns,
+ patch_with_include_exclude_patterns,
]
if __name__ == '__main__':
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/prop_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/prop_tests.py Tue Mar 30 20:57:53 2010
@@ -1734,6 +1734,51 @@ def post_revprop_change_hook(sbox):
'ps', '--revprop', '-r0', 'p', 'v',
wc_dir)
+def rm_of_replaced_file(sbox):
+ """properties after a removal of a replaced file"""
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Add some properties to iota and mu
+ iota_path = os.path.join(wc_dir, 'iota')
+ svntest.main.run_svn(None, 'propset', 'red', 'rojo', iota_path)
+ svntest.main.run_svn(None, 'propset', 'blue', 'lagoon', iota_path)
+
+ mu_path = os.path.join(wc_dir, 'A', 'mu')
+ svntest.main.run_svn(None, 'propset', 'yellow', 'submarine', mu_path)
+ svntest.main.run_svn(None, 'propset', 'orange', 'toothpick', mu_path)
+
+ svntest.main.run_svn(None, 'ci', '-m', 'log message', wc_dir)
+
+ # Copy iota over the top of mu
+ svntest.main.run_svn(None, 'rm', mu_path)
+ svntest.main.run_svn(None, 'cp', iota_path, mu_path)
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.tweak('iota', props={'red': 'rojo', 'blue': 'lagoon'})
+ expected_disk.tweak('A/mu', props={'red': 'rojo', 'blue': 'lagoon'},
+ contents="This is the file 'iota'.\n")
+ actual_disk_tree = svntest.tree.build_tree_from_wc(wc_dir, 1)
+ svntest.tree.compare_trees("disk", actual_disk_tree,
+ expected_disk.old_tree())
+
+ # Remove the copy. Properties should go back to mu's original props.
+ svntest.main.run_svn(None, 'rm', '--force', mu_path)
+
+ exit_code, output, errput = svntest.main.run_svn(None,
+ 'proplist', '-v', mu_path)
+ expected_output = svntest.verify.UnorderedRegexOutput([
+ 'Properties on',
+ ' yellow',
+ ' submarine',
+ ' orange',
+ ' toothpick',
+ ])
+ svntest.verify.compare_and_display_lines('message', 'label',
+ expected_output, output)
+ svntest.verify.verify_exit_code(None, exit_code, 0)
+
########################################################################
# Run the tests
@@ -1775,6 +1820,7 @@ test_list = [ None,
added_moved_file,
delete_nonexistent_property,
XFail(post_revprop_change_hook, svntest.main.is_ra_type_dav),
+ rm_of_replaced_file,
]
if __name__ == '__main__':
Modified: subversion/branches/svn-patch-improvements/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/tests/cmdline/revert_tests.py?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/branches/svn-patch-improvements/subversion/tests/cmdline/revert_tests.py Tue Mar 30 20:57:53 2010
@@ -29,7 +29,8 @@ import re, os
# Our testing module
import svntest
-from svntest import wc
+from svntest import wc, main, actions
+from svntest.actions import run_and_verify_svn
# (abbreviation)
@@ -952,6 +953,26 @@ def revert_tree_conflicts_in_updated_fil
svntest.actions.run_and_verify_status(wc_dir_2, expected_status)
svntest.actions.verify_disk(wc_dir_2, expected_disk)
+def revert_add_over_not_present_dir(sbox):
+ "reverting an add over not present directory"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ main.run_svn(None, 'rm', os.path.join(wc_dir, 'A/C'))
+ main.run_svn(None, 'ci', wc_dir, '-m', 'Deleted dir')
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.remove('A/C')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ main.run_svn(None, 'mkdir', os.path.join(wc_dir, 'A/C'))
+
+ # This fails in the current WC-NG state (r927318).
+ main.run_svn(None, 'revert', os.path.join(wc_dir, 'A/C'))
+
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
########################################################################
# Run the tests
@@ -979,6 +1000,7 @@ test_list = [ None,
status_of_missing_dir_after_revert_replaced_with_history_dir),
revert_replaced_with_history_file_2,
revert_tree_conflicts_in_updated_files,
+ XFail(revert_add_over_not_present_dir),
]
if __name__ == '__main__':