You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/09/12 16:43:59 UTC
svn commit: r1383980 [6/6] - in /subversion/branches/master-passphrase: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/emacs/ subversion/
subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversio...
Modified: subversion/branches/master-passphrase/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/cl.h?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/cl.h (original)
+++ subversion/branches/master-passphrase/subversion/svn/cl.h Wed Sep 12 14:43:54 2012
@@ -108,6 +108,12 @@ typedef enum svn_cl__accept_t
svn_cl__accept_t
svn_cl__accept_from_word(const char *word);
+/* --search and --isearch option values */
+typedef struct svn_cl__search_pattern_t {
+ const char *pattern; /* glob syntax */
+ svn_boolean_t case_insensitive;
+} svn_cl__search_pattern_t;
+
/*** Mergeinfo flavors. ***/
@@ -236,8 +242,7 @@ typedef struct svn_cl__opt_state_t
svn_boolean_t show_diff; /* produce diff output (maps to --diff) */
svn_boolean_t allow_mixed_rev; /* Allow operation on mixed-revision WC */
svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
- const char *search_pattern; /* pattern argument for --search */
- svn_boolean_t case_insensitive_search; /* perform case-insensitive search */
+ apr_array_header_t* search_patterns; /* pattern arguments for --search */
svn_wc_conflict_resolver_func2_t conflict_func;
void *conflict_baton;
Modified: subversion/branches/master-passphrase/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/file-merge.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/file-merge.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/file-merge.c Wed Sep 12 14:43:54 2012
@@ -851,6 +851,7 @@ svn_cl__merge_file(const char *base_path
apr_file_t *merged_file;
const char *merged_file_name;
struct file_merge_baton fmb;
+ svn_boolean_t executable;
SVN_ERR(svn_cmdline_printf(
@@ -912,7 +913,9 @@ svn_cl__merge_file(const char *base_path
return SVN_NO_ERROR;
}
- SVN_ERR_W(svn_io_file_move(merged_file_name, merged_path, scratch_pool),
+ SVN_ERR(svn_io_is_file_executable(&executable, merged_path, scratch_pool));
+ SVN_ERR_W(svn_io_copy_file(merged_file_name, merged_path, FALSE,
+ scratch_pool),
apr_psprintf(scratch_pool,
_("Could not write merged result to '%s', saved "
"instead at '%s'.\n'%s' remains in conflict.\n"),
@@ -924,6 +927,9 @@ svn_cl__merge_file(const char *base_path
svn_dirent_local_style(
svn_dirent_skip_ancestor(path_prefix, wc_path),
scratch_pool)));
+ SVN_ERR(svn_io_set_file_executable(merged_path, executable, FALSE,
+ scratch_pool));
+ SVN_ERR(svn_io_remove_file2(merged_file_name, TRUE, scratch_pool));
/* The merge was not aborted and we could install the merged result. The
* file remains in conflict unless all conflicting sections were resolved. */
Modified: subversion/branches/master-passphrase/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/log-cmd.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/log-cmd.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/log-cmd.c Wed Sep 12 14:43:54 2012
@@ -71,10 +71,9 @@ struct log_receiver_baton
/* Stack which keeps track of merge revision nesting, using svn_revnum_t's */
apr_array_header_t *merge_stack;
- /* Log message search pattern. Log entries will only be shown if the author,
- * the log message, or a changed path matches this pattern. */
- const char *search_pattern;
- svn_boolean_t case_insensitive_search;
+ /* Log message search patterns. Log entries will only be shown if the author,
+ * the log message, or a changed path matches one of these patterns. */
+ apr_array_header_t *search_patterns;
/* Pool for persistent allocations. */
apr_pool_t *pool;
@@ -203,6 +202,51 @@ match_search_pattern(const char *search_
return FALSE;
}
+/* Match all search patterns in SEARCH_PATTERNS against AUTHOR, DATE, MESSAGE,
+ * and CHANGED_PATHS. Return TRUE if any pattern matches, else FALSE.
+ * SCRACH_POOL is used for temporary allocations. */
+static svn_boolean_t
+match_search_patterns(apr_array_header_t *search_patterns,
+ const char *author,
+ const char *date,
+ const char *message,
+ apr_hash_t *changed_paths,
+ apr_pool_t *scratch_pool)
+{
+ int i;
+ svn_boolean_t match = FALSE;
+ apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+ for (i = 0; i < search_patterns->nelts; i++)
+ {
+ apr_array_header_t *pattern_group;
+ int j;
+
+ pattern_group = APR_ARRAY_IDX(search_patterns, i, apr_array_header_t *);
+
+ /* All patterns within the group must match. */
+ for (j = 0; j < pattern_group->nelts; j++)
+ {
+ svn_cl__search_pattern_t p;
+
+ svn_pool_clear(iterpool);
+
+ p = APR_ARRAY_IDX(pattern_group, j, svn_cl__search_pattern_t);
+ match = match_search_pattern(p.pattern, author, date,
+ message, changed_paths,
+ p.case_insensitive, iterpool);
+ if (!match)
+ break;
+ }
+
+ match = (match && j == pattern_group->nelts);
+ if (match)
+ break;
+ }
+ svn_pool_destroy(iterpool);
+
+ return match;
+}
/* Implement `svn_log_entry_receiver_t', printing the logs in
* a human-readable and machine-parseable format.
@@ -320,10 +364,9 @@ log_entry_receiver(void *baton,
if (! lb->omit_log_message && message == NULL)
message = "";
- if (lb->search_pattern &&
- ! match_search_pattern(lb->search_pattern, author, date, message,
- log_entry->changed_paths2,
- lb->case_insensitive_search, pool))
+ if (lb->search_patterns &&
+ ! match_search_patterns(lb->search_patterns, author, date, message,
+ log_entry->changed_paths2, pool))
{
if (log_entry->has_children)
APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
@@ -505,10 +548,9 @@ log_entry_receiver_xml(void *baton,
}
/* Match search pattern before XML-escaping. */
- if (lb->search_pattern &&
- ! match_search_pattern(lb->search_pattern, author, date, message,
- log_entry->changed_paths2,
- lb->case_insensitive_search, pool))
+ if (lb->search_patterns &&
+ ! match_search_patterns(lb->search_patterns, author, date, message,
+ log_entry->changed_paths2, pool))
{
if (log_entry->has_children)
APR_ARRAY_PUSH(lb->merge_stack, svn_revnum_t) = log_entry->revision;
@@ -740,8 +782,7 @@ svn_cl__log(apr_getopt_t *os,
: opt_state->depth;
lb.diff_extensions = opt_state->extensions;
lb.merge_stack = apr_array_make(pool, 0, sizeof(svn_revnum_t));
- lb.search_pattern = opt_state->search_pattern;
- lb.case_insensitive_search = opt_state->case_insensitive_search;
+ lb.search_patterns = opt_state->search_patterns;
lb.pool = pool;
if (opt_state->xml)
Modified: subversion/branches/master-passphrase/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/main.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/main.c Wed Sep 12 14:43:54 2012
@@ -131,6 +131,8 @@ typedef enum svn_cl__longopt_t {
opt_include_externals,
opt_search,
opt_isearch,
+ opt_search_and,
+ opt_isearch_and,
} svn_cl__longopt_t;
@@ -376,9 +378,13 @@ const apr_getopt_option_t svn_cl__option
"fixed revision. (See the svn:externals property)")},
{"search", opt_search, 1,
N_("use ARG as search pattern (glob syntax)")},
-
{"isearch", opt_isearch, 1,
N_("like --search, but case-insensitive")},
+ {"search-and", opt_search_and, 1,
+ N_("combine ARG with the previous search pattern")},
+
+ {"isearch-and", opt_isearch_and, 1,
+ N_("like --search-and, but case-insensitive")},
/* Long-opt Aliases
*
@@ -504,8 +510,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
"history.\n"
"usage: copy SRC[@REV]... DST\n"
"\n"
- "When copying multiple sources, they will be added as children of DST,\n"
- "which must be a directory.\n"
+ " When copying multiple sources, they will be added as children of DST,\n"
+ " which must be a directory.\n"
"\n"
" SRC and DST can each be either a working copy (WC) path or URL:\n"
" WC -> WC: copy and schedule for addition (with history)\n"
@@ -514,11 +520,11 @@ const svn_opt_subcommand_desc2_t svn_cl_
" URL -> URL: complete server-side copy; used to branch and tag\n"
" All the SRCs must be of the same type.\n"
"\n"
- "WARNING: For compatibility with previous versions of Subversion,\n"
- "copies performed using two working copy paths (WC -> WC) will not\n"
- "contact the repository. As such, they may not, by default, be able\n"
- "to propagate merge tracking information from the source of the copy\n"
- "to the destination.\n"),
+ " WARNING: For compatibility with previous versions of Subversion,\n"
+ " copies performed using two working copy paths (WC -> WC) will not\n"
+ " contact the repository. As such, they may not, by default, be able\n"
+ " to propagate merge tracking information from the source of the copy\n"
+ " to the destination.\n"),
{'r', 'q', opt_ignore_externals, opt_parents, SVN_CL__LOG_MSG_OPTIONS} },
{ "delete", svn_cl__delete, {"del", "remove", "rm"}, N_
@@ -684,12 +690,18 @@ const svn_opt_subcommand_desc2_t svn_cl_
" and limits the scope of the displayed diff to the specified depth.\n"
"\n"
" If the --search option is used, log messages are displayed only if the\n"
- " provided search pattern matches the author, date, log message text,\n"
- " or, if the --verbose option is also provided, a changed path.\n"
- " The search pattern may include glob syntax wildcards:\n"
+ " provided search pattern matches any of the author, date, log message\n"
+ " text (unless --quiet is used), or, if the --verbose option is also\n"
+ " provided, a changed path.\n"
+ " The search pattern may include \"glob syntax\" wildcards:\n"
" ? matches any single character\n"
" * matches a sequence of arbitrary characters\n"
- " [...] matches any of the characters listed inside the brackets\n"
+ " [abc] matches any of the characters listed inside the brackets\n"
+ " If multiple --search options are provided, a log message is shown if\n"
+ " it matches any of the provided search patterns. If the --search-and\n"
+ " option is used, that option's argument is combined with the pattern\n"
+ " from the previous --search or --search-and option, and a log message\n"
+ " is shown only if it matches the combined search pattern.\n"
" If --limit is used in combination with --search, --limit restricts the\n"
" number of log messages searched, rather than restricting the output\n"
" to a particular number of matching log messages.\n"
@@ -722,7 +734,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
{'r', 'q', 'v', 'g', 'c', opt_targets, opt_stop_on_copy, opt_incremental,
opt_xml, 'l', opt_with_all_revprops, opt_with_no_revprops, opt_with_revprop,
opt_depth, opt_diff, opt_diff_cmd, opt_internal_diff, 'x', opt_search,
- opt_isearch},
+ opt_search_and, opt_isearch, opt_isearch_and},
{{opt_with_revprop, N_("retrieve revision property ARG")},
{'c', N_("the change made in revision ARG")}} },
@@ -732,19 +744,22 @@ const svn_opt_subcommand_desc2_t svn_cl_
* (with quotes and newlines removed). */
"Merge changes into a working copy.\n"
"usage: 1. merge SOURCE[@REV] [TARGET_WCPATH]\n"
-" (the 'sync' merge)\n"
+" (the 'automatic' merge)\n"
" 2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
" (the 'cherry-pick' merge)\n"
" 3. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
" (the '2-URL' merge)\n"
"\n"
-" 1. This form, with one source path and no revision range:\n"
+" 1. This form, with with one source path and no revision range, is called\n"
+" an 'automatic' merge:\n"
"\n"
" svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
"\n"
-" finds all the changes on the source branch that have not already been\n"
-" merged to the target branch, and merges them. Merge tracking is used\n"
-" to know which changes have already been merged.\n"
+" The automatic merge is used for the 'sync' and 'reintegrate' merges\n"
+" in the 'feature branch' pattern described below. It finds all the\n"
+" changes on the source branch that have not already been merged to the\n"
+" target branch, and merges them into the working copy. Merge tracking\n"
+" is used to know which changes have already been merged.\n"
"\n"
" SOURCE specifies the branch from where the changes will be pulled, and\n"
" TARGET_WCPATH specifies a working copy of the target branch to which\n"
@@ -766,43 +781,38 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" - The 'Feature Branch' Merging Pattern -\n"
"\n"
-" In this commonly used pattern of merging, a developer is working on\n"
-" a feature development branch, committing a series of changes that\n"
-" implement the feature. The developer periodically merges all the\n"
-" latest changes from the 'parent' branch (from which the feature branch\n"
-" is branched off). When the feature development is complete, the\n"
-" developer integrates the feature back into the parent branch by\n"
-" merging the other way, into a trunk working copy.\n"
-"\n"
-" trunk --+----------o------o-o-------------o--\n"
-" \\ \\ \\ /\n"
-" \\ merge merge merge\n"
-" \\ \\ \\ /\n"
+" In this commonly used work flow, known also as the 'development\n"
+" branch' pattern, a developer creates a branch and commits a series of\n"
+" changes that implement a new feature. The developer periodically\n"
+" merges all the latest changes from the parent branch so as to keep the\n"
+" development branch up to date with those changes. When the feature is\n"
+" complete, the developer performs a merge from the feature branch to\n"
+" the parent branch to re-integrate the changes.\n"
+"\n"
+" parent --+----------o------o-o-------------o--\n"
+" \\ \\ \\ /\n"
+" \\ merge merge merge\n"
+" \\ \\ \\ /\n"
" feature +--o-o-------o----o-o----o-------\n"
"\n"
-" In this pattern, a merge from the parent branch to the feature branch\n"
-" is known as a 'sync' merge (or 'catch-up' merge), and a merge from the\n"
-" feature branch to the parent branch may be called a 'reintegrate'\n"
-" merge. The 'sync' merges are normally low-risk because the parent\n"
-" branch is considered to be more 'stable' than the feature branch, in\n"
-" the sense of being less likely to contain incomplete or broken work.\n"
-" By syncing often, these merges can be kept small, avoiding the need\n"
-" for a difficult 'big bang' merge at reintegration time.\n"
+" A merge from the parent branch to the feature branch is called a\n"
+" 'sync' or 'catch-up' merge, and a merge from the feature branch to the\n"
+" parent branch is called a 'reintegrate' merge.\n"
"\n"
" - Sync Merge Example -\n"
" ............\n"
" . .\n"
" trunk --+------------L--------------R------\n"
-" \\ \\\n"
-" \\ |\n"
-" \\ v\n"
+" \\ \\\n"
+" \\ |\n"
+" \\ v\n"
" feature +------------------------o-----\n"
" r100 r200\n"
"\n"
" Subversion will locate all the changes on 'trunk' that have not yet\n"
" been merged into the 'feature' branch. In this case that is a single\n"
-" range, r100:200. In the diagram above, L marks the left side\n"
-" (trunk@100) and R marks the right side (trunk@200) of the merge. The\n"
+" range, r100:200. In the diagram above, L marks the left side (trunk@100)\n"
+" and R marks the right side (trunk@200) of the merge source. The\n"
" difference between L and R will be applied to the target working copy\n"
" path. In this case, the working copy is a clean checkout of the entire\n"
" 'feature' branch.\n"
@@ -817,7 +827,6 @@ const svn_opt_subcommand_desc2_t svn_cl_
" others. You can review the changes and you may have to resolve\n"
" conflicts before you commit the merge.\n"
"\n"
-"\n"
" - Reintegrate Merge Example -\n"
"\n"
" The feature branch was last synced with trunk up to revision X. So the\n"
@@ -827,9 +836,9 @@ const svn_opt_subcommand_desc2_t svn_cl_
"\n"
" rW rX\n"
" trunk ------+--------------------L------------------o\n"
-" \\ . ^\n"
-" \\ ............. /\n"
-" \\ . /\n"
+" \\ . ^\n"
+" \\ ............. /\n"
+" \\ . /\n"
" feature +--------------------------------R\n"
"\n"
" In the diagram above, L marks the left side (trunk@X) and R marks the\n"
@@ -1084,8 +1093,8 @@ const svn_opt_subcommand_desc2_t svn_cl_
("Move and/or rename something in working copy or repository.\n"
"usage: move SRC... DST\n"
"\n"
- "When moving multiple sources, they will be added as children of DST,\n"
- "which must be a directory.\n"
+ " When moving multiple sources, they will be added as children of DST,\n"
+ " which must be a directory.\n"
"\n"
" Note: this subcommand is equivalent to a 'copy' and 'delete'.\n"
" Note: the --revision option has no use and is deprecated.\n"
@@ -1162,7 +1171,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" 2. Edits unversioned remote prop on repos revision.\n"
" TARGET only determines which repository to access.\n"
"\n"
- "See 'svn help propset' for more on setting properties.\n"),
+ " See 'svn help propset' for more on setting properties.\n"),
{'r', opt_revprop, SVN_CL__LOG_MSG_OPTIONS, opt_force} },
{ "propget", svn_cl__propget, {"pget", "pg"}, N_
@@ -1579,6 +1588,53 @@ svn_cl__check_cancel(void *baton)
return SVN_NO_ERROR;
}
+/* Add a --search or --isearch argument to OPT_STATE.
+ * These options start a new search pattern group. */
+static void
+add_search_pattern_group(svn_cl__opt_state_t *opt_state,
+ const char *pattern,
+ svn_boolean_t case_insensitive,
+ apr_pool_t *result_pool)
+{
+ svn_cl__search_pattern_t p;
+ apr_array_header_t *group = NULL;
+
+ if (opt_state->search_patterns == NULL)
+ opt_state->search_patterns = apr_array_make(result_pool, 1,
+ sizeof(apr_array_header_t *));
+
+ group = apr_array_make(result_pool, 1, sizeof(svn_cl__search_pattern_t));
+ p.pattern = pattern;
+ p.case_insensitive = case_insensitive;
+ APR_ARRAY_PUSH(group, svn_cl__search_pattern_t) = p;
+ APR_ARRAY_PUSH(opt_state->search_patterns, apr_array_header_t *) = group;
+}
+
+/* Add a --search-and or --isearch-and argument to OPT_STATE.
+ * These patterns are added to an existing pattern group, if any. */
+static void
+add_search_pattern_to_latest_group(svn_cl__opt_state_t *opt_state,
+ const char *pattern,
+ svn_boolean_t case_insensitive,
+ apr_pool_t *result_pool)
+{
+ svn_cl__search_pattern_t p;
+ apr_array_header_t *group;
+
+ if (opt_state->search_patterns == NULL)
+ {
+ add_search_pattern_group(opt_state, pattern, case_insensitive,
+ result_pool);
+ return;
+ }
+
+ group = APR_ARRAY_IDX(opt_state->search_patterns,
+ opt_state->search_patterns->nelts - 1,
+ apr_array_header_t *);
+ p.pattern = pattern;
+ p.case_insensitive = case_insensitive;
+ APR_ARRAY_PUSH(group, svn_cl__search_pattern_t) = p;
+}
/*** Main. ***/
@@ -2130,11 +2186,15 @@ sub_main(int argc, const char *argv[], a
opt_state.diff.properties_only = TRUE;
break;
case opt_search:
- opt_state.search_pattern = opt_arg;
+ add_search_pattern_group(&opt_state, opt_arg, FALSE, pool);
break;
case opt_isearch:
- opt_state.search_pattern = opt_arg;
- opt_state.case_insensitive_search = TRUE;
+ add_search_pattern_group(&opt_state, opt_arg, TRUE, pool);
+ break;
+ case opt_search_and:
+ add_search_pattern_to_latest_group(&opt_state, opt_arg, FALSE, pool);
+ case opt_isearch_and:
+ add_search_pattern_to_latest_group(&opt_state, opt_arg, TRUE, pool);
break;
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
Modified: subversion/branches/master-passphrase/subversion/svn/tree-conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/tree-conflicts.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/tree-conflicts.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/tree-conflicts.c Wed Sep 12 14:43:54 2012
@@ -63,7 +63,6 @@ static const svn_token_map_t map_conflic
{ N_("replace"), svn_wc_conflict_reason_replaced },
{ N_("unversioned"), svn_wc_conflict_reason_unversioned },
{ N_("moved away"), svn_wc_conflict_reason_moved_away },
- { N_("moved away and edited"), svn_wc_conflict_reason_moved_away_and_edited },
{ N_("moved here"), svn_wc_conflict_reason_moved_here },
{ NULL, 0 }
};
@@ -79,7 +78,6 @@ static const svn_token_map_t map_conflic
{ "replace", svn_wc_conflict_reason_replaced },
{ "unversioned", svn_wc_conflict_reason_unversioned },
{ "moved-away", svn_wc_conflict_reason_moved_away },
- { "moved-away-and-edited", svn_wc_conflict_reason_moved_away_and_edited },
{ "moved-here", svn_wc_conflict_reason_moved_here },
{ NULL, 0 }
};
Modified: subversion/branches/master-passphrase/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn_private_config.hw?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn_private_config.hw (original)
+++ subversion/branches/master-passphrase/subversion/svn_private_config.hw Wed Sep 12 14:43:54 2012
@@ -83,6 +83,7 @@
#include <libintl.h>
#define _(x) dgettext(PACKAGE_NAME, x)
#define Q_(x1, x2, n) dngettext(PACKAGE_NAME, x1, x2, n)
+#define HAVE_BIND_TEXTDOMAIN_CODESET
#else
#define _(x) (x)
#define Q_(x1, x2, n) (((n) == 1) ? x1 : x2)
Modified: subversion/branches/master-passphrase/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnadmin/main.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnadmin/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnadmin/main.c Wed Sep 12 14:43:54 2012
@@ -150,6 +150,7 @@ static svn_opt_subcommand_t
subcommand_create,
subcommand_deltify,
subcommand_dump,
+ subcommand_freeze,
subcommand_help,
subcommand_hotcopy,
subcommand_load,
@@ -336,6 +337,11 @@ static const svn_opt_subcommand_desc2_t
"changed in those revisions.)\n"),
{'r', svnadmin__incremental, svnadmin__deltas, 'q', 'M'} },
+ {"freeze", subcommand_freeze, {0}, N_
+ ("usage: svnadmin freeze REPOS_PATH PROGRAM [ARG...]\n\n"
+ "Run PROGRAM passing ARGS while holding a write-lock on REPOS_PATH.\n"),
+ {0} },
+
{"help", subcommand_help, {"?", "h"}, N_
("usage: svnadmin help [SUBCOMMAND...]\n\n"
"Describe the usage of this program or its subcommands.\n"),
@@ -969,6 +975,66 @@ subcommand_dump(apr_getopt_t *os, void *
return SVN_NO_ERROR;
}
+struct freeze_baton_t {
+ const char *command;
+ const char **args;
+ int status;
+};
+
+static svn_error_t *
+freeze_body(void *baton,
+ apr_pool_t *pool)
+{
+ struct freeze_baton_t *b = baton;
+ apr_status_t apr_err;
+ apr_file_t *infile, *outfile, *errfile;
+
+ apr_err = apr_file_open_stdin(&infile, pool);
+ if (apr_err)
+ return svn_error_wrap_apr(apr_err, "Can't open stdin");
+ apr_err = apr_file_open_stdout(&outfile, pool);
+ if (apr_err)
+ return svn_error_wrap_apr(apr_err, "Can't open stdout");
+ apr_err = apr_file_open_stderr(&errfile, pool);
+ if (apr_err)
+ return svn_error_wrap_apr(apr_err, "Can't open stderr");
+
+ SVN_ERR(svn_io_run_cmd(NULL, b->command, b->args, &b->status,
+ NULL, TRUE,
+ infile, outfile, errfile, pool));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+subcommand_freeze(apr_getopt_t *os, void *baton, apr_pool_t *pool)
+{
+ struct svnadmin_opt_state *opt_state = baton;
+ apr_array_header_t *args;
+ int i;
+ struct freeze_baton_t b;
+
+ SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
+
+ if (!args->nelts)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0,
+ _("No program provided"));
+
+ b.command = APR_ARRAY_IDX(args, 0, const char *);
+ b.args = apr_palloc(pool, sizeof(char *) * args->nelts + 1);
+ for (i = 0; i < args->nelts; ++i)
+ b.args[i] = APR_ARRAY_IDX(args, i, const char *);
+ b.args[args->nelts] = NULL;
+
+ SVN_ERR(svn_repos_freeze(opt_state->repository_path, freeze_body, &b, pool));
+
+ /* Make any non-zero status visible to the user. */
+ if (b.status)
+ exit(b.status);
+
+ return SVN_NO_ERROR;
+}
+
/* This implements `svn_opt_subcommand_t'. */
static svn_error_t *
Modified: subversion/branches/master-passphrase/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnserve/serve.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnserve/serve.c (original)
+++ subversion/branches/master-passphrase/subversion/svnserve/serve.c Wed Sep 12 14:43:54 2012
@@ -2944,24 +2944,6 @@ repos_path_valid(const char *path)
return TRUE;
}
-/* Callback which receives hook environment variables from the hook
- * environment configuration section,
- * An implementation of svn_config_enumerator2_t. */
-static svn_boolean_t
-hooks_env_conf_cb(const char *name,
- const char *value,
- void *baton,
- apr_pool_t *pool)
-{
- apr_hash_t *hooks_env = baton;
- apr_pool_t *hash_pool = apr_hash_pool_get(hooks_env);
-
- apr_hash_set(hooks_env, apr_pstrdup(hash_pool, name),
- APR_HASH_KEY_STRING, apr_pstrdup(hash_pool, value));
-
- return TRUE;
-}
-
/* Look for the repository given by URL, using ROOT as the virtual
* repository root. If we find one, fill in the repos, fs, cfg,
* repos_url, and fs_path fields of B. Set B->repos's client
@@ -2974,7 +2956,7 @@ static svn_error_t *find_repos(const cha
const apr_array_header_t *capabilities,
apr_pool_t *pool)
{
- const char *path, *full_path, *repos_root, *fs_path;
+ const char *path, *full_path, *repos_root, *fs_path, *hooks_env;
svn_stringbuf_t *url_buf;
/* Skip past the scheme and authority part. */
@@ -3052,16 +3034,12 @@ static svn_error_t *find_repos(const cha
"No access allowed to this repository",
b, conn, pool);
- /* If a hook environment has been configured, set it up. */
- if (svn_config_has_section(b->cfg, SVN_CONFIG_SECTION_HOOKS_ENV))
- {
- apr_hash_t *hooks_env = apr_hash_make(pool);
-
- svn_config_enumerate2(b->cfg, SVN_CONFIG_SECTION_HOOKS_ENV,
- hooks_env_conf_cb, hooks_env, pool);
-
- svn_repos_hooks_setenv(b->repos, hooks_env);
- }
+ /* Configure hook script environment variables. */
+ svn_config_get(b->cfg, &hooks_env, SVN_CONFIG_SECTION_GENERAL,
+ SVN_CONFIG_OPTION_HOOKS_ENV, NULL);
+ if (hooks_env)
+ hooks_env = svn_dirent_internal_style(hooks_env, pool);
+ svn_repos_hooks_setenv(b->repos, hooks_env, pool, pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/svnversion/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnversion/main.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnversion/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svnversion/main.c Wed Sep 12 14:43:54 2012
@@ -57,19 +57,19 @@ help(const apr_getopt_option_t *options,
(svn_cmdline_fprintf
(stdout, pool,
_("usage: svnversion [OPTIONS] [WC_PATH [TRAIL_URL]]\n\n"
- " Produce a compact 'version number' for the working copy path\n"
+ " Produce a compact version identifier for the working copy path\n"
" WC_PATH. TRAIL_URL is the trailing portion of the URL used to\n"
" determine if WC_PATH itself is switched (detection of switches\n"
- " within WC_PATH does not rely on TRAIL_URL). The version number\n"
+ " within WC_PATH does not rely on TRAIL_URL). The version identifier\n"
" is written to standard output. For example:\n"
"\n"
" $ svnversion . /repos/svn/trunk\n"
" 4168\n"
"\n"
- " The version number will be a single number if the working\n"
+ " The version identifier will be a single number if the working\n"
" copy is single revision, unmodified, not switched and with\n"
" a URL that matches the TRAIL_URL argument. If the working\n"
- " copy is unusual the version number will be more complex:\n"
+ " copy is unusual the version identifier will be more complex:\n"
"\n"
" 4123:4168 mixed revision working copy\n"
" 4168M modified working copy\n"
Modified: subversion/branches/master-passphrase/subversion/svnversion/svnversion.1
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svnversion/svnversion.1?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svnversion/svnversion.1 (original)
+++ subversion/branches/master-passphrase/subversion/svnversion/svnversion.1 Wed Sep 12 14:43:54 2012
@@ -23,10 +23,10 @@
.\"
.TH svnversion 1
.SH NAME
-svnversion \- Produce a compact version number for a working copy.
+svnversion \- Produce a compact version identifier for a working copy.
.SH SYNOPSIS
.TP
-\fBsvnversion\fP [\fIwc_path\fP [\fItrail_url\fP]]
+\fBsvnversion\fP [\fIoptions\fP] [\fIwc_path\fP [\fItrail_url\fP]]
.SH OVERVIEW
Subversion is a version control system, which allows you to keep old
versions of files and directories (usually source code), keep a log of
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/davautocheck.sh Wed Sep 12 14:43:54 2012
@@ -323,44 +323,48 @@ say "Using directory '$HTTPD_ROOT'..."
if [ ${USE_SSL:+set} ]; then
say "Setting up SSL"
BASE_URL="https://localhost:$HTTPD_PORT"
-# A self-signed certifcate for localhost generated via:
-# openssl req -new -x509 -nodes -out cert.pem -keyout cert-key.pem
+# A self-signed certifcate for localhost that expires after 2039-12-30
+# generated via:
+# openssl req -new -x509 -nodes -days 10000 -out cert.pem -keyout cert-key.pem
+# This is embedded, rather than generated on-the-fly, to avoid consuming
+# system entropy.
SSL_CERTIFICATE_FILE="$HTTPD_ROOT/cert.pem"
cat > "$SSL_CERTIFICATE_FILE" <<__EOF__
-----BEGIN CERTIFICATE-----
-MIICrTCCAhagAwIBAgIJAN/ks6HqqeVKMA0GCSqGSIb3DQEBBQUAMEQxGjAYBgNV
-BAoTEUFwYWNoZSBTdWJ2ZXJzaW9uMRIwEAYDVQQLEwl0ZXN0c3VpdGUxEjAQBgNV
-BAMTCWxvY2FsaG9zdDAeFw0xMjA2MTIyMTIyNDlaFw0xMjA3MTIyMTIyNDlaMEQx
-GjAYBgNVBAoTEUFwYWNoZSBTdWJ2ZXJzaW9uMRIwEAYDVQQLEwl0ZXN0c3VpdGUx
-EjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
-pAIkUHZbKgb6n75AZu7YG3skAeFZRVCiu9K/KwLKxDlhDuXhAjrGUOyfwtvj0Ezw
-F6J1Ke6NJFNOMw9FKcp9BegUyWHQ0hTxQSbgIGCgZGG74LUO5kdHQBU9bu/3daF+
-TC0e08OO90RLAoNr/CADZOTDDPD1QYFS3Au49GZPtI8CAwEAAaOBpjCBozAdBgNV
-HQ4EFgQUKgls7+vC/CGZKNJUczUSo+ZL2wAwdAYDVR0jBG0wa4AUKgls7+vC/CGZ
-KNJUczUSo+ZL2wChSKRGMEQxGjAYBgNVBAoTEUFwYWNoZSBTdWJ2ZXJzaW9uMRIw
-EAYDVQQLEwl0ZXN0c3VpdGUxEjAQBgNVBAMTCWxvY2FsaG9zdIIJAN/ks6HqqeVK
-MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAFMkecdq3XuJaRaC+4G38
-RNzUFR5Mnv/Ue/43J5CEJ5g2RTxro8DnGcYw2Qbv8lCUDBhkQ8L/lwnLe5jd204D
-Ad9t+1LXNyrYYncOmoZyzKupbfR0m6qz2Q45tqEztHokVWLnchiBaOL0nnGY0rPM
-zyc9CVIgp7ivvAud6ja++CQ=
+MIIC7zCCAligAwIBAgIJALP1pLDiJRtuMA0GCSqGSIb3DQEBBQUAMFkxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMjA4MTMxNDA5
+MDRaFw0zOTEyMzAxNDA5MDRaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21l
+LVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNV
+BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA9kBx6trU
+WQnFNDrW+dU159zEbSWGts3ScITIMTLE4EclMh50SP2BnJDnetkNO8JhPXOm4KZi
+XdJugWAk0NmpawhAk3xVxHh5N8wwyPk3IMx7+Yu+sgcsd0Dj9YK1fIazgTUp/Dsk
+VGJvqu+kgNYxPvzWi/OsBLW/ZNp+spTzoAcCAwEAAaOBvjCBuzAdBgNVHQ4EFgQU
+f7OIDackB7zzPm10aiQgq9WzRdQwgYsGA1UdIwSBgzCBgIAUf7OIDackB7zzPm10
+aiQgq9WzRdShXaRbMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRl
+MSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMTCWxv
+Y2FsaG9zdIIJALP1pLDiJRtuMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
+gYEAD2rdgeVYCSEeseEfFCTNte//rDsT3coO9SbGOpmlCJ5TfbmXjs2YaQZH7NST
+mla3hw2Bf9ppTUw1ZWvOVgD3mpxAbYNBA/4HaxmK4GlS2kZsKiMr0xgcVGjmEIW/
+HS9q+PHwStDKNSyYc1+m+bUmeRGUKLgC4kuBF7JDK8A2WYc=
-----END CERTIFICATE-----
__EOF__
SSL_CERTIFICATE_KEY_FILE="$HTTPD_ROOT/cert-key.pem"
cat > "$SSL_CERTIFICATE_KEY_FILE" <<__EOF__
- -----BEGIN RSA PRIVATE KEY-----
-MIICXAIBAAKBgQCkAiRQdlsqBvqfvkBm7tgbeyQB4VlFUKK70r8rAsrEOWEO5eEC
-OsZQ7J/C2+PQTPAXonUp7o0kU04zD0Upyn0F6BTJYdDSFPFBJuAgYKBkYbvgtQ7m
-R0dAFT1u7/d1oX5MLR7Tw473REsCg2v8IANk5MMM8PVBgVLcC7j0Zk+0jwIDAQAB
-AoGAFU0x6kF1FcBSTO0o8DWVW/xicNwT/Cy89igpLCzwqQvKz2SMFP4NQ/V3ypdE
-v4k+pdMz5H5XVqB7R6Z0FTl3g1ecfZoxYuMYWgzaaS6nx1xWJUqMTUqHArt9Sl/K
-/k6H5cNPC3JxGv7Blz87a3ypi93ZgSOJZDixG0BoRClGegECQQDVLTMqH5pVeBH1
-kfY2O8initMhi1lluM7yREbvZtxm844P11m7V4sOX9XQtBaaW3qLjzIru0TBJCL6
-F1JF7mYlAkEAxPRsJuFtBtWpQvnFzX3uXtaJtKtBIHbyBhmzo4f+ed/JU4Kzu1Pk
-CMnKgglg8rzU8/0HIU0AiaV2ItlQwb6PowJATZkWds7qLxJ19x4ascMxV0uBb0R6
-Vjzfl/CioaKfuBoQLFQHpdpIFANuoXnsgGOsSADoEmMos+WjlcXHfQ06wQJBAJTe
-79Tftephm+QtKc9urbvvy/zNKZghcEUeLkOgqsByYBoIhFRHT+k4piJudmJkS071
-ZetM6eghMk+bFcisgqMCQDD3kQ8gYOS9GbHPuTF4dfFSBx51nvd+hWNna1wi3rl+
-7nYzmrRWOp4ZMUG7i6GwqYHZ9stwJ/xRup5oink5VoQ=
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQD2QHHq2tRZCcU0Otb51TXn3MRtJYa2zdJwhMgxMsTgRyUyHnRI
+/YGckOd62Q07wmE9c6bgpmJd0m6BYCTQ2alrCECTfFXEeHk3zDDI+TcgzHv5i76y
+Byx3QOP1grV8hrOBNSn8OyRUYm+q76SA1jE+/NaL86wEtb9k2n6ylPOgBwIDAQAB
+AoGBAJBzhV+rNl10qcXVrj2noJN+oYsVNE0Pt55hhb22dl7J3TvlOXmHm/xn1CHw
+KR8hC0GtEfs+Hv3CbyhdabtJs2L7QxO5VjgLO+onBmAOw1iPF9DjbMcAlFJnoOWI
+HYwANOWGp2jRxL5cHUfrBVCgUISen3VUZEnQkr4n/Zty/QEBAkEA/XIZ3oh5MiFA
+o4IaFaFQpBc6K/e6fnM0217scaPvfZiYS1k9Fx/UQTAGsxJOnhnsi04WgHPMS5wB
+RP4/PiIGIQJBAPi7yIKKS4E8hWBZL+79TI8Zm2uehGCB8V6m9k7e3I82To9Tgcow
+qZHsAPtN50fg85I94L3REg2FSQlDlzbMkScCQQC2pweLv/EQNrS94eJomkRirban
+vzYxMVfzjRp737iWXGXNT7feNXsjq7f4UAZGnMpDrvg6hLnD999WWKE9ZwnhAkBl
+c9p9/EB9zxyrxtT5StGuUIiHJdnirz2vGLTASMB3nXP/m9UFjkGr5jIkTos2Uzel
+/50qbxtI7oNyxuHnlRrjAkASfQ51kaBcABYRiacesQi94W/kE3MkgHWkCXNb6//u
+gxk/ezALZ8neJzJudzRkX3auGwH1ne9vCM1ED5dkM54H
-----END RSA PRIVATE KEY-----
__EOF__
SSL_MAKE_VAR="SSL_CERT=$SSL_CERTIFICATE_FILE"
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests.py?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests.py Wed Sep 12 14:43:54 2012
@@ -95,13 +95,41 @@ rep_lines_res = [
'Subversion command-line client, version X.Y.Z.'),
]
+# This is a trigger pattern that selects the secondary set of
+# delete/replace patterns
+switch_res_line = 'System information:'
+
+# This is a list of lines to delete after having seen switch_res_line.
+switched_del_lines_res = [
+ # In svn --version --verbose, dependent libs loaded
+ # shared libs are optional.
+ re.compile(r'^\* (loaded|linked)'),
+ # In svn --version --verbose, remove everything from
+ # the extended lists
+ re.compile(r'^ - '),
+ ]
+
+# This is a list of lines to search and replace text on after having
+# seen switch_res_line.
+switched_rep_lines_res = [
+ # We don't care about the actual canonical host
+ (re.compile('^\* running on.*$'), '* running on'),
+ ]
+
def process_lines(lines):
"delete lines that should not be compared and search and replace the rest"
output = [ ]
+ del_res = del_lines_res
+ rep_res = rep_lines_res
+
for line in lines:
+ if line.startswith(switch_res_line):
+ del_res = switched_del_lines_res
+ rep_res = switched_rep_lines_res
+
# Skip these lines from the output list.
delete_line = 0
- for delete_re in del_lines_res:
+ for delete_re in del_res:
if delete_re.match(line):
delete_line = 1
break
@@ -109,7 +137,7 @@ def process_lines(lines):
continue
# Search and replace text on the rest.
- for replace_re, replace_str in rep_lines_res:
+ for replace_re, replace_str in rep_res:
line = replace_re.sub(replace_str, line)
output.append(line)
@@ -179,6 +207,10 @@ def getopt__version__quiet(sbox):
"run svn --version --quiet"
run_one_test(sbox, 'svn--version--quiet', '--version', '--quiet')
+def getopt__version__verbose(sbox):
+ "run svn --version --verbose"
+ run_one_test(sbox, 'svn--version--verbose', '--version', '--verbose')
+
def getopt__help(sbox):
"run svn --help"
run_one_test(sbox, 'svn--help', '--help')
@@ -204,6 +236,7 @@ test_list = [ None,
getopt_no_args,
getopt__version,
getopt__version__quiet,
+ getopt__version__verbose,
getopt__help,
getopt_help,
getopt_help_bogus_cmd,
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn--version_stdout Wed Sep 12 14:43:54 2012
@@ -2,8 +2,8 @@ svn, version 0.16.0 (r3987)
compiled Dec 5 2002, 00:02:51
Copyright (C) 2010 The Apache Software Foundation.
-This software consists of contributions made by many people; see the NOTICE
-file for more information.
+This software consists of contributions made by many people;
+see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/
The following repository access (RA) modules are available:
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Wed Sep 12 14:43:54 2012
@@ -31,12 +31,18 @@ usage: 1. log [PATH][@REV]
and limits the scope of the displayed diff to the specified depth.
If the --search option is used, log messages are displayed only if the
- provided search pattern matches the author, date, log message text,
- or, if the --verbose option is also provided, a changed path.
- The search pattern may include glob syntax wildcards:
+ provided search pattern matches any of the author, date, log message
+ text (unless --quiet is used), or, if the --verbose option is also
+ provided, a changed path.
+ The search pattern may include "glob syntax" wildcards:
? matches any single character
* matches a sequence of arbitrary characters
- [...] matches any of the characters listed inside the brackets
+ [abc] matches any of the characters listed inside the brackets
+ If multiple --search options are provided, a log message is shown if
+ it matches any of the provided search patterns. If the --search-and
+ option is used, that option's argument is combined with the pattern
+ from the previous --search or --search-and option, and a log message
+ is shown only if it matches the combined search pattern.
If --limit is used in combination with --search, --limit restricts the
number of log messages searched, rather than restricting the output
to a particular number of matching log messages.
@@ -111,7 +117,9 @@ Valid options:
-p (--show-c-function):
Show C function name in diff output.
--search ARG : use ARG as search pattern (glob syntax)
+ --search-and ARG : combine ARG with the previous search pattern
--isearch ARG : like --search, but case-insensitive
+ --isearch-and ARG : like --search-and, but case-insensitive
Global options:
--username ARG : specify a username ARG
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py Wed Sep 12 14:43:54 2012
@@ -2304,6 +2304,43 @@ def log_search(sbox):
log_chain = parse_log_output(output)
check_log_chain(log_chain, [7, 6, 3])
+ # multi-pattern search
+ exit_code, output, err = svntest.actions.run_and_verify_svn(
+ None, None, [], 'log',
+ '--search', 'for revision 3',
+ '--search', 'for revision 6',
+ '--search', 'for revision 7')
+
+ log_chain = parse_log_output(output)
+ check_log_chain(log_chain, [7, 6, 3])
+
+ # combined pattern search
+ exit_code, output, err = svntest.actions.run_and_verify_svn(
+ None, None, [], 'log', '--verbose',
+ '--search', 'for revision 8',
+ '--search-and', 'test the code',
+ '--search', 'for revision 7',
+ '--search-and', 'this won\'t match ',
+ '--search', 'psi',
+ '--search-and', 'multiple lines',
+ '--search-and', 'revision 6') # don't match r4
+
+ log_chain = parse_log_output(output)
+ check_log_chain(log_chain, [8, 6])
+
+ exit_code, output, err = svntest.actions.run_and_verify_svn(
+ None, None, [], 'log', '--verbose',
+ '--search', 'for revision 8',
+ '--search-and', 'this won\'t match ',
+ '--search', 'for revision 7',
+ '--search', 'psi',
+ '--search-and', 'multiple lines',
+ '--search-and', 'revision 4') # don't match r6
+
+ log_chain = parse_log_output(output)
+ check_log_chain(log_chain, [7, 4])
+
+
@SkipUnless(server_has_mergeinfo)
def merge_sensitive_log_with_search(sbox):
"test 'svn log -g --search'"
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/merge_tests.py Wed Sep 12 14:43:54 2012
@@ -8019,7 +8019,9 @@ def merge_to_sparse_directories(sbox):
def merge_old_and_new_revs_from_renamed_dir(sbox):
"merge -rold(before rename):head renamed dir"
- ## See http://svn.haxx.se/dev/archive-2007-09/0706.shtml ##
+ # See the email on dev@ from Paul Burba, 2007-09-27, "RE: svn commit:
+ # r26803 - [...]", <http://svn.haxx.se/dev/archive-2007-09/0706.shtml> or
+ # <http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=927127>.
# Create a WC with a single branch
sbox.build()
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_subr/dirent_uri-test.c Wed Sep 12 14:43:54 2012
@@ -1364,6 +1364,9 @@ static const testcase_ancestor_t dirent_
{ "foo.", "foo./.bar", ".bar" },
{ "X:foo", "X:bar", NULL },
{ "../foo", "..", NULL },
+ { "/foo/bar/zig", "/foo", NULL },
+ { "/foo/bar/zig", "/foo/ba", NULL },
+ { "/foo/bar/zig", "/foo/bar/zi", NULL },
#ifdef SVN_USE_DOS_PATHS
{ "", "C:", NULL },
{ "", "C:foo", NULL },
@@ -1384,6 +1387,9 @@ static const testcase_ancestor_t dirent_
{ "X:/foo", "X:/", NULL },
{ "A:/foo", "A:/foo/bar", "bar" },
{ "A:/foo", "A:/foot", NULL },
+ { "A:/foo/bar/zig", "A:/foo", NULL },
+ { "A:/foo/bar/zig", "A:/foo/ba", NULL },
+ { "A:/foo/bar/zig", "A:/foo/bar/zi", NULL },
{ "//srv", "//srv/share", NULL },
{ "//srv", "//srv/shr/fld", NULL },
{ "//srv/shr", "//srv", NULL },
@@ -1393,6 +1399,7 @@ static const testcase_ancestor_t dirent_
{ "//srv/s r", "//srv/s r/fld", "fld" },
{ "//srv/shr/fld", "//srv/shr", NULL },
{ "//srv/shr/fld", "//srv2/shr/fld", NULL },
+ { "//srv/shr/fld", "//srv/shr/f", NULL },
{ "/", "//srv/share", NULL },
#else /* !SVN_USE_DOS_PATHS */
{ "", "C:", "C:" },
@@ -1458,6 +1465,8 @@ static const testcase_ancestor_t uri_anc
{ "http://", "http://test", NULL },
{ "http://server", "http://server/q", "q" },
{ "svn://server", "http://server/q", NULL },
+ { "http://foo/bar", "http://foo", NULL },
+ { "http://foo/bar", "http://foo/ba", NULL },
};
static svn_error_t *
Modified: subversion/branches/master-passphrase/subversion/tests/libsvn_subr/string-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/libsvn_subr/string-test.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/libsvn_subr/string-test.c (original)
+++ subversion/branches/master-passphrase/subversion/tests/libsvn_subr/string-test.c Wed Sep 12 14:43:54 2012
@@ -540,6 +540,78 @@ test24(apr_pool_t *pool)
return test_stringbuf_unequal("abc", "abb", pool);
}
+static svn_error_t *
+expect_stringbuf_equal(const svn_stringbuf_t* str1,
+ const char* str2,
+ apr_pool_t *pool)
+{
+ if (svn_stringbuf_compare(str1, svn_stringbuf_create(str2, pool)))
+ return SVN_NO_ERROR;
+ else
+ return fail(pool, "test failed");
+}
+
+static svn_error_t *
+test_stringbuf_insert(apr_pool_t *pool)
+{
+ a = svn_stringbuf_create("st , ", pool);
+
+ svn_stringbuf_insert(a, 0, "teflon", 2);
+ SVN_TEST_STRING_ASSERT(a->data, "test , ");
+
+ svn_stringbuf_insert(a, 5, "hllo", 4);
+ SVN_TEST_STRING_ASSERT(a->data, "test hllo, ");
+
+ svn_stringbuf_insert(a, 6, a->data + 1, 1);
+ SVN_TEST_STRING_ASSERT(a->data, "test hello, ");
+
+ svn_stringbuf_insert(a, 12, "world class", 5);
+ SVN_TEST_STRING_ASSERT(a->data, "test hello, world");
+
+ svn_stringbuf_insert(a, 1200, "!", 1);
+ return expect_stringbuf_equal(a, "test hello, world!", pool);
+}
+
+static svn_error_t *
+test_stringbuf_remove(apr_pool_t *pool)
+{
+ a = svn_stringbuf_create("test hello, world!", pool);
+
+ svn_stringbuf_remove(a, 0, 2);
+ SVN_TEST_STRING_ASSERT(a->data, "st hello, world!");
+
+ svn_stringbuf_remove(a, 2, 2);
+ SVN_TEST_STRING_ASSERT(a->data, "stello, world!");
+
+ svn_stringbuf_remove(a, 5, 200);
+ SVN_TEST_STRING_ASSERT(a->data, "stell");
+
+ svn_stringbuf_remove(a, 1200, 393);
+ return expect_stringbuf_equal(a, "stell", pool);
+}
+
+static svn_error_t *
+test_stringbuf_replace(apr_pool_t *pool)
+{
+ a = svn_stringbuf_create("odd with some world?", pool);
+
+ svn_stringbuf_replace(a, 0, 3, "tester", 4);
+ SVN_TEST_STRING_ASSERT(a->data, "test with some world?");
+
+ svn_stringbuf_replace(a, 5, 10, "hllo, coder", 6);
+ SVN_TEST_STRING_ASSERT(a->data, "test hllo, world?");
+
+ svn_stringbuf_replace(a, 6, 0, a->data + 1, 1);
+ SVN_TEST_STRING_ASSERT(a->data, "test hello, world?");
+
+ svn_stringbuf_replace(a, 17, 10, "!", 1);
+ SVN_TEST_STRING_ASSERT(a->data, "test hello, world!");
+
+ svn_stringbuf_replace(a, 1200, 199, "!!", 2);
+
+ return expect_stringbuf_equal(a, "test hello, world!!!", pool);
+}
+
/*
====================================================================
If you add a new test to this file, update this array.
@@ -599,5 +671,11 @@ struct svn_test_descriptor_t test_funcs[
"compare stringbufs; same length, different content"),
SVN_TEST_PASS2(test24,
"verify i64toa"),
+ SVN_TEST_PASS2(test_stringbuf_insert,
+ "check inserting into svn_stringbuf_t"),
+ SVN_TEST_PASS2(test_stringbuf_remove,
+ "check deletion from svn_stringbuf_t"),
+ SVN_TEST_PASS2(test_stringbuf_replace,
+ "check replacement in svn_stringbuf_t"),
SVN_TEST_NULL
};
Modified: subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn (original)
+++ subversion/branches/master-passphrase/tools/dev/unix-build/Makefile.svn Wed Sep 12 14:43:54 2012
@@ -862,6 +862,8 @@ endif
> $(CYRUS_SASL_SRCDIR)/lib/dlopen.c.patched
mv $(CYRUS_SASL_SRCDIR)/lib/dlopen.c.patched \
$(CYRUS_SASL_SRCDIR)/lib/dlopen.c
+ # Fix a weird autotools error about missing cmulocal dir
+ (cd $(CYRUS_SASL_SRCDIR)/saslauthd/ && ln -sf ../cmulocal)
touch $@
# configure cyrus-sasl
@@ -1447,6 +1449,13 @@ svn-check-svn: svn-check-prepare-ramdisk
svn-check-bindings: svn-check-swig-pl svn-check-swig-py svn-check-swig-rb \
svn-check-javahl
+# OpenBSD requires an LD_PRELOAD hack to dlopen() libraries linked to
+# libpthread into executables that aren't linked to libpthread.
+ifeq ($(UNAME),OpenBSD)
+LIB_PTHREAD_HACK=LD_PRELOAD=libpthread.so
+endif
+
+
RUBYLIB=$(SVN_PREFIX)/lib/ruby/site_ruby$(shell grep \
^svn_cv_ruby_sitedir_archsuffix $(svn_builddir)/config.log | \
cut -d'=' -f2):$(SVN_PREFIX)/lib/ruby/site_ruby$(shell \
@@ -1456,6 +1465,7 @@ svn-check-swig-pl:
-if [ $(ENABLE_PERL_BINDINGS) = yes ]; then \
(cd $(svn_builddir) && \
env LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
+ $(LIB_PTHREAD_HACK) \
make check-swig-pl 2>&1) | \
tee $(svn_builddir)/tests.log.bindings.pl; \
fi
@@ -1473,6 +1483,7 @@ svn-check-swig-rb:
env RUBYLIB=$(RUBYLIB) \
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
PATH=$(SVN_PREFIX)/bin:$$PATH \
+ $(LIB_PTHREAD_HACK) \
make check-swig-rb 2>&1) | \
tee $(svn_builddir)/tests.log.bindings.rb
Modified: subversion/branches/master-passphrase/tools/server-side/svnauthz-validate.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/svnauthz-validate.c?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/svnauthz-validate.c (original)
+++ subversion/branches/master-passphrase/tools/server-side/svnauthz-validate.c Wed Sep 12 14:43:54 2012
@@ -28,32 +28,56 @@
*
*/
+#include "svn_cmdline.h"
+#include "svn_dirent_uri.h"
+#include "svn_opt.h"
#include "svn_pools.h"
#include "svn_repos.h"
-#include "svn_cmdline.h"
+#include "svn_utf.h"
+
+enum {
+ OPT_USERNAME = SVN_OPT_FIRST_LONGOPT_ID,
+ OPT_PATH,
+ OPT_REPOS
+};
+
+static int
+usage(const char *argv0)
+{
+ printf("Usage: %s FILE [--username USER [--path FSPATH] [--repository REPOS_NAME]]\n\n", argv0);
+ printf("Loads the authz file at FILE and validates its syntax.\n"
+ "Optionally prints the access available to USER for FSPATH in\n"
+ "repository with authz name REPOS_NAME. If FSPATH is omitted, reports\n"
+ "whether USER has any access at all.\n"
+ "Returns:\n"
+ " 0 when syntax is OK.\n"
+ " 1 when syntax is invalid.\n"
+ " 2 operational error\n");
+ return 2;
+}
int
main(int argc, const char **argv)
{
apr_pool_t *pool;
svn_error_t *err;
+ apr_status_t apr_err;
svn_authz_t *authz;
- const char *authz_file;
-
- if (argc != 2 && argc != 4 && argc != 5)
+ apr_getopt_t *os;
+ const apr_getopt_option_t options[] =
{
- printf("Usage: %s FILE [USER PATH [REPOS_NAME]]\n\n", argv[0]);
- printf("Loads the authz file at FILE and validates its syntax.\n"
- "Optionally reports the access available to USER for PATH in\n"
- "repository REPOS_NAME.\n"
- "Returns:\n"
- " 0 when syntax is OK.\n"
- " 1 when syntax is invalid.\n"
- " 2 operational error\n");
- return 2;
- }
-
- authz_file = argv[1];
+ {"username", OPT_USERNAME, 1, ("the authenticated username")},
+ {"path", OPT_PATH, 1, ("path within the repository")},
+ {"repository", OPT_REPOS, 1, ("repository authz name")},
+ {0, 0, 0, 0}
+ };
+ struct {
+ const char *authz_file;
+ const char *username;
+ const char *fspath;
+ const char *repos_name;
+ } opts;
+ opts.username = opts.fspath = opts.repos_name = NULL;
/* Initialize the app. Send all error messages to 'stderr'. */
if (svn_cmdline_init(argv[0], stderr) != EXIT_SUCCESS)
@@ -61,16 +85,69 @@ main(int argc, const char **argv)
pool = svn_pool_create(NULL);
+ /* Repeat svn_cmdline__getopt_init() inline. */
+ apr_err = apr_getopt_init(&os, pool, argc, argv);
+ if (apr_err)
+ return svn_cmdline_handle_exit_error(
+ svn_error_wrap_apr(apr_err,
+ ("Error initializing command line arguments")),
+ pool, "svn-rep-sharing-stats: ");
+
+ os->interleave = 1;
+ while (1)
+ {
+ int opt;
+ const char *arg;
+ apr_status_t status = apr_getopt_long(os, options, &opt, &arg);
+ if (APR_STATUS_IS_EOF(status))
+ break;
+ if (status != APR_SUCCESS)
+ {
+ return usage(argv[0]);
+ }
+ switch (opt)
+ {
+ case OPT_USERNAME:
+ /* ### TODO: UTF-8? */
+ opts.username = arg;
+ break;
+ case OPT_PATH:
+ /* ### TODO: UTF-8? */
+ opts.fspath = arg;
+ break;
+ case OPT_REPOS:
+ opts.repos_name = arg;
+ break;
+ default:
+ return usage(argv[0]);
+ }
+ }
+
+ /* Exactly 1 non-option argument, and no --repository/--path
+ unless --username. */
+ if (os->ind + 1 != argc || (!opts.username && (opts.fspath || opts.repos_name)))
+ {
+ return usage(argv[0]);
+ }
+
+ /* Grab AUTHZ_FILE from argv. */
+ SVN_INT_ERR(svn_utf_cstring_to_utf8(&opts.authz_file, os->argv[os->ind],
+ pool));
+ opts.authz_file = svn_dirent_internal_style(opts.authz_file, pool);
+
/* Read the access file and validate it. */
- err = svn_repos_authz_read(&authz, authz_file, TRUE, pool);
+ err = svn_repos_authz_read(&authz, opts.authz_file, TRUE, pool);
- if (!err && (argc == 4 || argc == 5))
+ /* Optionally, print the access a USER has to a given PATH in REPOS.
+ PATH and REPOS may be NULL. */
+ if (!err && opts.username)
{
- const char *user = argv[2], *path = argv[3];
- const char *repos = argc == 5 ? argv[4] : "";
+ const char *user = opts.username;
+ const char *path = opts.fspath;
+ const char *repos = opts.repos_name;
svn_boolean_t read_access, write_access;
- if (path[0] != '/')
+ if (path && path[0] != '/')
path = apr_pstrcat(pool, "/", path, NULL);
err = svn_repos_authz_check_access(authz, repos, path, user,
@@ -81,12 +158,9 @@ main(int argc, const char **argv)
svn_authz_read, &read_access,
pool);
if (!err)
- printf("user '%s' has %s access to '%s'%s%s\n",
- user,
- write_access ? "rw" : read_access ? "r" : "no",
- path,
- repos[0] ? "in repository " : "",
- repos);
+ printf("%s\n",
+ write_access ? "rw" : read_access ? "r" : "no"
+ );
}
svn_pool_destroy(pool);
Modified: subversion/branches/master-passphrase/tools/server-side/svnpubsub/README.txt
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/svnpubsub/README.txt?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/svnpubsub/README.txt (original)
+++ subversion/branches/master-passphrase/tools/server-side/svnpubsub/README.txt Wed Sep 12 14:43:54 2012
@@ -14,3 +14,29 @@ TODO:
- add support for SIGHUP to reread the config and reinitialize working copies
- joes will write documentation for svnpubsub as these items become fulfilled
- make LOGLEVEL configurable
+
+
+Installation instructions:
+
+1. Set up an svnpubsub service.
+
+ This directory should be checked out to /usr/local/svnpubsub (or /opt/svnpubsub
+ on Debian).
+
+ There are init scripts for several OSes in the rc.d/ directory; add them
+ to your OS boot process in the usual way for your OS. (For example, via
+ rc.conf(5) or update-rc.d(8).)
+
+2. Run "commit-hook.py $REPOS $REV" from your post-commit hook.
+
+ (As of 1.7, these are the same ordered arguments the post-commmit hook
+ itself receives, so you can just symlink commit-hook.py as hooks/post-commit
+ hook if you don't need any other hooks to run in the server process. (This
+ isn't as insane as it sounds --- post-commit email hooks could also feed of
+ svnpubsub, and thus not be run within the committing server thread, but on
+ any other process or box that listens to the svnpubsub stream!))
+
+3. Set up svnpubsub clients.
+
+ (eg svnwcsub.py, svnpubsub/client.py,
+ 'curl -i http://${hostname}:2069/commits/json')
Modified: subversion/branches/master-passphrase/tools/server-side/svnpubsub/example.conf
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/svnpubsub/example.conf?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/svnpubsub/example.conf (original)
+++ subversion/branches/master-passphrase/tools/server-side/svnpubsub/example.conf Wed Sep 12 14:43:54 2012
@@ -3,6 +3,7 @@
[DEFAULT]
svnbin: /usr/local/bin/svn
streams: http://svn.example.org:2069/commits/xml
+hook: /usr/bin/true
## The values below are used by ConfigParser's interpolation syntax.
## See http://docs.python.org/library/configparser
Modified: subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnpubsub.debian
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnpubsub.debian?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnpubsub.debian (original)
+++ subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnpubsub.debian Wed Sep 12 14:43:54 2012
@@ -19,7 +19,7 @@ svnpubsub_pidfile=${svnpubsub_pidfile-"/
pidfile="${svnpubsub_pidfile}"
TWSITD_CMD="/usr/bin/twistd -y /opt/svnpubsub/svnpubsub.tac \
- --logfile=/var/bwlog/svnpubsub/svnpubsub.log \
+ --logfile=/var/log/svnpubsub/svnpubsub.log \
--pidfile=${pidfile} \
--uid=${svnpubsub_user} --gid=${svnpubsub_user} \
-r${svnpubsub_reactor}"
Modified: subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.debian
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.debian?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.debian (original)
+++ subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.debian Wed Sep 12 14:43:54 2012
@@ -16,7 +16,7 @@ svnwcsub_user=${svnwcsub_user-"svnwc"}
svnwcsub_group=${svnwcsub_group-"svnwc"}
svnwcsub_pidfile=${svnwcsub_pidfile-"/var/run/svnwcsub.pid"}
svnwcsub_config=${svnwcsub_config-"/etc/svnwcsub.conf"}
-svnwcsub_logfile=${svnwcsub_logfile-"/var/bwlog/svnwcsub/svnwcsub.log"}
+svnwcsub_logfile=${svnwcsub_logfile-"/var/log/svnwcsub/svnwcsub.log"}
pidfile="${svnwcsub_pidfile}"
SVNWCSUB_CMD="/opt/svnpubsub/svnwcsub.py \
@@ -24,6 +24,7 @@ SVNWCSUB_CMD="/opt/svnpubsub/svnwcsub.py
--logfile=${svnwcsub_logfile} \
--pidfile=${pidfile} \
--uid=${svnwcsub_user} --gid=${svnwcsub_group} \
+ --umask=002 \
${svnwcsub_config} "
RETVAL=0
Modified: subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris (original)
+++ subversion/branches/master-passphrase/tools/server-side/svnpubsub/rc.d/svnwcsub.solaris Wed Sep 12 14:43:54 2012
@@ -14,8 +14,8 @@ SVNWCSUB_CMD="/usr/local/svnpubsub/svnwc
--daemon \
--logfile=${svnwcsub_logfile} \
--pidfile=${pidfile} \
- --umask=002 \
--uid=${svnwcsub_user} --gid=${svnwcsub_group} \
+ --umask=002 \
${svnwcsub_config}"
RETVAL=0
Modified: subversion/branches/master-passphrase/tools/server-side/svnpubsub/svnwcsub.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/tools/server-side/svnpubsub/svnwcsub.py?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/tools/server-side/svnpubsub/svnwcsub.py (original)
+++ subversion/branches/master-passphrase/tools/server-side/svnpubsub/svnwcsub.py Wed Sep 12 14:43:54 2012
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# encoding: UTF-8
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@@ -29,6 +30,7 @@
# See svnwcsub.conf for more information on its contents.
#
+import errno
import subprocess
import threading
import sys
@@ -71,6 +73,22 @@ def svn_info(svnbin, env, path):
info[line[:idx]] = line[idx+1:].strip()
return info
+try:
+ import glob
+ glob.iglob
+ def is_emptydir(path):
+ # ### If the directory contains only dotfile children, this will readdir()
+ # ### the entire directory. But os.readdir() is not exposed to us...
+ for x in glob.iglob('%s/*' % path):
+ return False
+ for x in glob.iglob('%s/.*' % path):
+ return False
+ return True
+except (ImportError, AttributeError):
+ # Python â¤2.4
+ def is_emptydir(path):
+ # This will read the entire directory list to memory.
+ return not os.listdir(path)
class WorkingCopy(object):
def __init__(self, bdec, path, url):
@@ -106,7 +124,7 @@ class WorkingCopy(object):
def _get_match(self, svnbin, env):
### quick little hack to auto-checkout missing working copies
- if not os.path.isdir(self.path):
+ if not os.path.isdir(self.path) or is_emptydir(self.path):
logging.info("autopopulate %s from %s" % (self.path, self.url))
subprocess.check_call([svnbin, 'co', '-q',
'--non-interactive',
@@ -131,7 +149,8 @@ class BigDoEverythingClasss(object):
self.svnbin = config.get_value('svnbin')
self.env = config.get_env()
self.tracking = config.get_track()
- self.worker = BackgroundWorker(self.svnbin, self.env)
+ self.hook = config.get_value('hook')
+ self.worker = BackgroundWorker(self.svnbin, self.env, self.hook)
self.watch = [ ]
self.hostports = [ ]
@@ -150,7 +169,7 @@ class BigDoEverythingClasss(object):
# Add it to our watchers, and trigger an svn update.
logging.info("Watching WC at %s <-> %s" % (wc.path, wc.url))
self.watch.append(wc)
- self.worker.add_work(OP_UPDATE, wc)
+ self.worker.add_work(OP_BOOT, wc)
def _normalize_path(self, path):
if path[0] != '/':
@@ -182,11 +201,12 @@ class BigDoEverythingClasss(object):
# Start logging warnings if the work backlog reaches this many items
BACKLOG_TOO_HIGH = 20
+OP_BOOT = 'boot'
OP_UPDATE = 'update'
OP_CLEANUP = 'cleanup'
class BackgroundWorker(threading.Thread):
- def __init__(self, svnbin, env):
+ def __init__(self, svnbin, env, hook):
threading.Thread.__init__(self)
# The main thread/process should not wait for this thread to exit.
@@ -195,6 +215,7 @@ class BackgroundWorker(threading.Thread)
self.svnbin = svnbin
self.env = env
+ self.hook = hook
self.q = Queue.Queue()
self.has_started = False
@@ -209,6 +230,8 @@ class BackgroundWorker(threading.Thread)
try:
if operation == OP_UPDATE:
self._update(wc)
+ elif operation == OP_BOOT:
+ self._update(wc, boot=True)
elif operation == OP_CLEANUP:
self._cleanup(wc)
else:
@@ -228,7 +251,7 @@ class BackgroundWorker(threading.Thread)
self.q.put((operation, wc))
- def _update(self, wc):
+ def _update(self, wc, boot=False):
"Update the specified working copy."
# For giggles, let's clean up the working copy in case something
@@ -253,6 +276,15 @@ class BackgroundWorker(threading.Thread)
info = svn_info(self.svnbin, self.env, wc.path)
logging.info("updated: %s now at r%s", wc.path, info['Revision'])
+ ## Run the hook
+ if self.hook:
+ hook_mode = ['post-update', 'boot'][boot]
+ logging.info('running hook: %s at revision %s due to %s',
+ wc.path, info['Revision'], hook_mode)
+ args = [self.hook, hook_mode,
+ wc.path, info['Revision'], wc.url]
+ subprocess.check_call(args, env=self.env)
+
def _cleanup(self, wc):
"Run a cleanup on the specified working copy."
Modified: subversion/branches/master-passphrase/win-tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/win-tests.py?rev=1383980&r1=1383979&r2=1383980&view=diff
==============================================================================
--- subversion/branches/master-passphrase/win-tests.py (original)
+++ subversion/branches/master-passphrase/win-tests.py Wed Sep 12 14:43:54 2012
@@ -81,6 +81,7 @@ def _usage_exit():
print(" --http-short-circuit : Use SVNPathAuthz short_circuit on HTTP server")
print(" --disable-http-v2 : Do not advertise support for HTTPv2 on server")
print(" --disable-bulk-updates : Disable bulk updates on HTTP server")
+ print(" --ssl-cert : Path to SSL server certificate to trust.")
print(" --javahl : Run the javahl tests instead of the normal tests")
print(" --list : print test doc strings only")
print(" --milestone-filter=RE : RE is a regular expression pattern that (when")
@@ -131,7 +132,8 @@ opts, args = my_getopt(sys.argv[1:], 'hr
'fsfs-packing', 'fsfs-sharding=', 'javahl',
'list', 'enable-sasl', 'bin=', 'parallel',
'config-file=', 'server-minor-version=', 'log-level=',
- 'log-to-stdout', 'mode-filter=', 'milestone-filter='])
+ 'log-to-stdout', 'mode-filter=', 'milestone-filter=',
+ 'ssl-cert='])
if len(args) > 1:
print('Warning: non-option arguments after the first one will be ignored')
@@ -163,6 +165,7 @@ log_to_stdout = None
mode_filter=None
tests_to_run = []
log_level = None
+ssl_cert = None
for opt, val in opts:
if opt in ('-h', '--help'):
@@ -230,6 +233,8 @@ for opt, val in opts:
log_to_stdout = 1
elif opt == '--log-level':
log_level = val
+ elif opt == '--ssl-cert':
+ ssl_cert = val
# Calculate the source and test directory names
abs_srcdir = os.path.abspath("")
@@ -742,7 +747,7 @@ if not test_javahl:
fsfs_sharding, fsfs_packing,
list_tests, svn_bin, mode_filter,
milestone_filter,
- set_log_level=log_level)
+ set_log_level=log_level, ssl_cert=ssl_cert)
old_cwd = os.getcwd()
try:
os.chdir(abs_builddir)