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/25 21:06:52 UTC
svn commit: r1390054 [2/3] - in /subversion/branches/master-passphrase: ./
build/ build/generator/templates/ subversion/bindings/swig/
subversion/bindings/swig/perl/native/
subversion/bindings/swig/python/libsvn_swig_py/
subversion/bindings/swig/python...
Modified: subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_wcroot.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/master-passphrase/subversion/libsvn_wc/wc_db_wcroot.c Tue Sep 25 19:06:49 2012
@@ -599,11 +599,22 @@ try_symlink_as_dir:
inside the wcroot, but we know the abspath is this directory
(ie. where we found it). */
- SVN_ERR(svn_wc__db_pdh_create_wcroot(wcroot,
+ err = svn_wc__db_pdh_create_wcroot(wcroot,
apr_pstrdup(db->state_pool, local_abspath),
sdb, wc_id, FORMAT_FROM_SDB,
db->auto_upgrade, db->enforce_empty_wq,
- db->state_pool, scratch_pool));
+ db->state_pool, scratch_pool);
+ if (err && err->apr_err == SVN_ERR_WC_UNSUPPORTED_FORMAT &&
+ kind == svn_kind_symlink)
+ {
+ /* We found an unsupported WC after traversing upwards from a
+ * symlink. Fall through to code below to check if the symlink
+ * points at a supported WC. */
+ svn_error_clear(err);
+ *wcroot = NULL;
+ }
+ else
+ SVN_ERR(err);
}
else
{
@@ -615,16 +626,17 @@ try_symlink_as_dir:
db->state_pool, scratch_pool));
}
- {
- const char *dir_relpath;
+ if (*wcroot)
+ {
+ const char *dir_relpath;
+
+ /* The subdirectory's relpath is easily computed relative to the
+ wcroot that we just found. */
+ dir_relpath = compute_relpath(*wcroot, local_dir_abspath, NULL);
- /* The subdirectory's relpath is easily computed relative to the
- wcroot that we just found. */
- dir_relpath = compute_relpath(*wcroot, local_dir_abspath, NULL);
-
- /* And the result local_relpath may include a filename. */
- *local_relpath = svn_relpath_join(dir_relpath, build_relpath, result_pool);
- }
+ /* And the result local_relpath may include a filename. */
+ *local_relpath = svn_relpath_join(dir_relpath, build_relpath, result_pool);
+ }
if (kind == svn_kind_symlink)
{
@@ -638,33 +650,38 @@ try_symlink_as_dir:
* points to a directory, try to find a wcroot in that directory
* instead. */
- err = svn_wc__db_read_info_internal(&status, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, &conflicted, NULL, NULL, NULL,
- NULL, NULL, NULL,
- *wcroot, *local_relpath,
- scratch_pool, scratch_pool);
- if (err)
+ if (*wcroot)
{
- if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
- && !SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
- return svn_error_trace(err);
+ err = svn_wc__db_read_info_internal(&status, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, &conflicted,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, *wcroot, *local_relpath,
+ scratch_pool, scratch_pool);
+ if (err)
+ {
+ if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
+ && !SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
+ return svn_error_trace(err);
- svn_error_clear(err);
- retry_if_dir = TRUE; /* The symlink is unversioned. */
+ svn_error_clear(err);
+ retry_if_dir = TRUE; /* The symlink is unversioned. */
+ }
+ else
+ {
+ /* The symlink is versioned, or obstructs a versioned node.
+ * Ignore non-conflicted not-present/excluded nodes.
+ * This allows the symlink to redirect the wcroot query to a
+ * directory, regardless of 'invisible' nodes in this WC. */
+ retry_if_dir = ((status == svn_wc__db_status_not_present ||
+ status == svn_wc__db_status_excluded ||
+ status == svn_wc__db_status_server_excluded)
+ && !conflicted);
+ }
}
else
- {
- /* The symlink is versioned, or obstructs a versioned node.
- * Ignore non-conflicted not-present/excluded nodes.
- * This allows the symlink to redirect the wcroot query to a
- * directory, regardless of 'invisible' nodes in this WC. */
- retry_if_dir = ((status == svn_wc__db_status_not_present ||
- status == svn_wc__db_status_excluded ||
- status == svn_wc__db_status_server_excluded)
- && !conflicted);
- }
+ retry_if_dir = TRUE;
if (retry_if_dir)
{
Modified: subversion/branches/master-passphrase/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/mod_authz_svn/mod_authz_svn.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/master-passphrase/subversion/mod_authz_svn/mod_authz_svn.c Tue Sep 25 19:06:49 2012
@@ -44,6 +44,7 @@
#include "svn_config.h"
#include "svn_string.h"
#include "svn_repos.h"
+#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "private/svn_fspath.h"
@@ -164,7 +165,8 @@ static const command_rec authz_svn_cmds[
* Get the, possibly cached, svn_authz_t for this request.
*/
static svn_authz_t *
-get_access_conf(request_rec *r, authz_svn_config_rec *conf)
+get_access_conf(request_rec *r, authz_svn_config_rec *conf,
+ apr_pool_t *scratch_pool)
{
const char *cache_key = NULL;
const char *access_file;
@@ -182,7 +184,7 @@ get_access_conf(request_rec *r, authz_sv
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "%s", dav_err->desc);
return NULL;
}
- access_file = svn_dirent_join_many(r->pool, repos_path, "conf",
+ access_file = svn_dirent_join_many(scratch_pool, repos_path, "conf",
conf->repo_relative_access_file,
NULL);
}
@@ -194,7 +196,7 @@ get_access_conf(request_rec *r, authz_sv
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
"Path to authz file is %s", access_file);
- cache_key = apr_pstrcat(r->pool, "mod_authz_svn:",
+ cache_key = apr_pstrcat(scratch_pool, "mod_authz_svn:",
access_file, (char *)NULL);
apr_pool_userdata_get(&user_data, cache_key, r->connection->pool);
access_conf = user_data;
@@ -243,12 +245,13 @@ convert_case(char *text, svn_boolean_t t
/* Return the username to authorize, with case-conversion performed if
CONF->force_username_case is set. */
static char *
-get_username_to_authorize(request_rec *r, authz_svn_config_rec *conf)
+get_username_to_authorize(request_rec *r, authz_svn_config_rec *conf,
+ apr_pool_t *pool)
{
char *username_to_authorize = r->user;
if (username_to_authorize && conf->force_username_case)
{
- username_to_authorize = apr_pstrdup(r->pool, r->user);
+ username_to_authorize = apr_pstrdup(pool, r->user);
convert_case(username_to_authorize,
strcasecmp(conf->force_username_case, "upper") == 0);
}
@@ -283,7 +286,8 @@ req_check_access(request_rec *r,
svn_authz_t *access_conf = NULL;
svn_error_t *svn_err;
char errbuf[256];
- const char *username_to_authorize = get_username_to_authorize(r, conf);
+ const char *username_to_authorize = get_username_to_authorize(r, conf,
+ r->pool);
switch (r->method_number)
{
@@ -419,7 +423,7 @@ req_check_access(request_rec *r,
}
/* Retrieve/cache authorization file */
- access_conf = get_access_conf(r,conf);
+ access_conf = get_access_conf(r,conf, r->pool);
if (access_conf == NULL)
return DECLINED;
@@ -577,14 +581,13 @@ log_access_verdict(LOG_ARGS_SIGNATURE,
}
/*
- * This function is used as a provider to allow mod_dav_svn to bypass the
- * generation of an apache request when checking GET access from
- * "mod_dav_svn/authz.c" .
+ * Implementation of subreq_bypass with scratch_pool parameter.
*/
static int
-subreq_bypass(request_rec *r,
- const char *repos_path,
- const char *repos_name)
+subreq_bypass2(request_rec *r,
+ const char *repos_path,
+ const char *repos_name,
+ apr_pool_t *scratch_pool)
{
svn_error_t *svn_err = NULL;
svn_authz_t *access_conf = NULL;
@@ -595,7 +598,7 @@ subreq_bypass(request_rec *r,
conf = ap_get_module_config(r->per_dir_config,
&authz_svn_module);
- username_to_authorize = get_username_to_authorize(r, conf);
+ username_to_authorize = get_username_to_authorize(r, conf, scratch_pool);
/* If configured properly, this should never be true, but just in case. */
if (!conf->anonymous
@@ -606,7 +609,7 @@ subreq_bypass(request_rec *r,
}
/* Retrieve authorization file */
- access_conf = get_access_conf(r, conf);
+ access_conf = get_access_conf(r, conf, scratch_pool);
if (access_conf == NULL)
return HTTP_FORBIDDEN;
@@ -620,7 +623,7 @@ subreq_bypass(request_rec *r,
username_to_authorize,
svn_authz_none|svn_authz_read,
&authz_access_granted,
- r->pool);
+ scratch_pool);
if (svn_err)
{
ap_log_rerror(APLOG_MARK, APLOG_ERR,
@@ -650,6 +653,26 @@ subreq_bypass(request_rec *r,
}
/*
+ * This function is used as a provider to allow mod_dav_svn to bypass the
+ * generation of an apache request when checking GET access from
+ * "mod_dav_svn/authz.c" .
+ */
+static int
+subreq_bypass(request_rec *r,
+ const char *repos_path,
+ const char *repos_name)
+{
+ int status;
+ apr_pool_t *scratch_pool;
+
+ scratch_pool = svn_pool_create(r->pool);
+ status = subreq_bypass2(r, repos_path, repos_name, scratch_pool);
+ svn_pool_destroy(scratch_pool);
+
+ return status;
+}
+
+/*
* Hooks
*/
Modified: subversion/branches/master-passphrase/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/mod_dav_svn/repos.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/master-passphrase/subversion/mod_dav_svn/repos.c Tue Sep 25 19:06:49 2012
@@ -1149,8 +1149,11 @@ create_private_resource(const dav_resour
comb->res.collection = TRUE; /* ### always true? */
/* versioned = baselined = working = FALSE */
- comb->res.uri = apr_pstrcat(base->pool, base->info->repos->root_path,
- path->data, (char *)NULL);
+ if (base->info->repos->root_path[1])
+ comb->res.uri = apr_pstrcat(base->pool, base->info->repos->root_path,
+ path->data, (char *)NULL);
+ else
+ comb->res.uri = path->data;
comb->res.info = &comb->priv;
comb->res.hooks = &dav_svn__hooks_repository;
comb->res.pool = base->pool;
@@ -1908,9 +1911,11 @@ parse_querystring(request_rec *r, const
only use a temporary redirect. */
apr_table_setn(r->headers_out, "Location",
ap_construct_url(r->pool,
- apr_psprintf(r->pool, "%s%s?p=%ld",
- comb->priv.repos->root_path,
- newpath, working_rev),
+ apr_psprintf(r->pool, "%s%s?p=%ld",
+ (comb->priv.repos->root_path[1]
+ ? comb->priv.repos->root_path
+ : ""),
+ newpath, working_rev),
r));
return dav_svn__new_error(r->pool,
prevstr ? HTTP_MOVED_PERMANENTLY
@@ -4346,8 +4351,11 @@ dav_svn__create_working_resource(dav_res
res->baselined = base->baselined;
/* collection = FALSE. ### not necessarily correct */
- res->uri = apr_pstrcat(base->pool, base->info->repos->root_path,
- path, (char *)NULL);
+ if (base->info->repos->root_path[1])
+ res->uri = apr_pstrcat(base->pool, base->info->repos->root_path,
+ path, (char *)NULL);
+ else
+ res->uri = path;
res->hooks = &dav_svn__hooks_repository;
res->pool = base->pool;
Modified: subversion/branches/master-passphrase/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/cl.h?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/cl.h (original)
+++ subversion/branches/master-passphrase/subversion/svn/cl.h Tue Sep 25 19:06:49 2012
@@ -108,12 +108,6 @@ 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. ***/
Modified: subversion/branches/master-passphrase/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/conflict-callbacks.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/conflict-callbacks.c Tue Sep 25 19:06:49 2012
@@ -265,6 +265,347 @@ launch_resolver(svn_boolean_t *performed
return SVN_NO_ERROR;
}
+/* Ask the user what to do about the text conflict described by DESC.
+ * Return the answer in RESULT. B is the conflict baton for this
+ * conflict resolution session.
+ * SCRATCH_POOL is used for temporary allocations. */
+static svn_error_t *
+handle_text_conflict(svn_wc_conflict_result_t *result,
+ const svn_wc_conflict_description2_t *desc,
+ svn_cl__conflict_baton_t *b,
+ apr_pool_t *scratch_pool)
+{
+ const char *answer;
+ char *prompt;
+ svn_boolean_t diff_allowed = FALSE;
+ /* Have they done something that might have affected the merged
+ file (so that we need to save a .edited copy)? */
+ svn_boolean_t performed_edit = FALSE;
+ /* Have they done *something* (edit, look at diff, etc) to
+ give them a rational basis for choosing (r)esolved? */
+ svn_boolean_t knows_something = FALSE;
+
+ SVN_ERR_ASSERT(desc->kind == svn_wc_conflict_kind_text);
+
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Conflict discovered in file '%s'.\n"),
+ svn_cl__local_style_skip_ancestor(
+ b->path_prefix, desc->local_abspath,
+ scratch_pool)));
+
+ /* Diffing can happen between base and merged, to show conflict
+ markers to the user (this is the typical 3-way merge
+ scenario), or if no base is available, we can show a diff
+ between mine and theirs. */
+ if ((desc->merged_file && desc->base_abspath)
+ || (!desc->base_abspath && desc->my_abspath && desc->their_abspath))
+ diff_allowed = TRUE;
+
+ while (TRUE)
+ {
+ svn_pool_clear(scratch_pool);
+
+ prompt = apr_pstrdup(scratch_pool, _("Select: (p) postpone"));
+
+ if (diff_allowed)
+ {
+ prompt = apr_pstrcat(scratch_pool, prompt,
+ _(", (df) diff-full, (e) edit, (m) merge"),
+ (char *)NULL);
+
+ if (knows_something)
+ prompt = apr_pstrcat(scratch_pool, prompt, _(", (r) resolved"),
+ (char *)NULL);
+
+ if (! desc->is_binary)
+ prompt = apr_pstrcat(scratch_pool, prompt,
+ _(",\n (mc) mine-conflict, "
+ "(tc) theirs-conflict"),
+ (char *)NULL);
+ }
+ else
+ {
+ if (knows_something)
+ prompt = apr_pstrcat(scratch_pool, prompt, _(", (r) resolved"),
+ (char *)NULL);
+ prompt = apr_pstrcat(scratch_pool, prompt,
+ _(",\n "
+ "(mf) mine-full, (tf) theirs-full"),
+ (char *)NULL);
+ }
+
+ prompt = apr_pstrcat(scratch_pool, prompt, ",\n ", (char *)NULL);
+ prompt = apr_pstrcat(scratch_pool, prompt,
+ _("(s) show all options: "),
+ (char *)NULL);
+
+ SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, scratch_pool));
+
+ if (strcmp(answer, "s") == 0)
+ {
+ /* These are used in svn_cl__accept_from_word(). */
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("\n"
+ " (e) edit - change merged file in an editor\n"
+ " (df) diff-full - show all changes made to merged "
+ "file\n"
+ " (r) resolved - accept merged version of file\n"
+ "\n"
+ " (dc) display-conflict - show all conflicts "
+ "(ignoring merged version)\n"
+ " (mc) mine-conflict - accept my version for all "
+ "conflicts (same)\n"
+ " (tc) theirs-conflict - accept their version for all "
+ "conflicts (same)\n"
+ "\n"
+ " (mf) mine-full - accept my version of entire file "
+ "(even non-conflicts)\n"
+ " (tf) theirs-full - accept their version of entire "
+ "file (same)\n"
+ "\n"
+ " (p) postpone - mark the conflict to be "
+ "resolved later\n"
+ " (m) merge - use internal merge tool to "
+ "resolve conflict\n"
+ " (l) launch - launch external tool to "
+ "resolve conflict\n"
+ " (s) show all - show this list\n\n")));
+ }
+ else if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
+ {
+ /* Do nothing, let file be marked conflicted. */
+ result->choice = svn_wc_conflict_choose_postpone;
+ break;
+ }
+ else if (strcmp(answer, "mc") == 0 || strcmp(answer, "X-)") == 0)
+ {
+ if (desc->is_binary)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option; cannot choose "
+ "based on conflicts in a "
+ "binary file.\n\n")));
+ continue;
+ }
+ result->choice = svn_wc_conflict_choose_mine_conflict;
+ if (performed_edit)
+ result->save_merged = TRUE;
+ break;
+ }
+ else if (strcmp(answer, "tc") == 0 || strcmp(answer, "X-(") == 0)
+ {
+ if (desc->is_binary)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option; cannot choose "
+ "based on conflicts in a "
+ "binary file.\n\n")));
+ continue;
+ }
+ result->choice = svn_wc_conflict_choose_theirs_conflict;
+ if (performed_edit)
+ result->save_merged = TRUE;
+ break;
+ }
+ else if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
+ {
+ result->choice = svn_wc_conflict_choose_mine_full;
+ if (performed_edit)
+ result->save_merged = TRUE;
+ break;
+ }
+ else if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
+ {
+ result->choice = svn_wc_conflict_choose_theirs_full;
+ if (performed_edit)
+ result->save_merged = TRUE;
+ break;
+ }
+ else if (strcmp(answer, "dc") == 0)
+ {
+ if (desc->is_binary)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option; cannot "
+ "display conflicts for a "
+ "binary file.\n\n")));
+ continue;
+ }
+ else if (! (desc->my_abspath && desc->base_abspath &&
+ desc->their_abspath))
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option; original "
+ "files not available.\n\n")));
+ continue;
+ }
+ SVN_ERR(show_conflicts(desc, scratch_pool));
+ knows_something = TRUE;
+ }
+ else if (strcmp(answer, "df") == 0)
+ {
+ if (! diff_allowed)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option; there's no "
+ "merged version to diff.\n\n")));
+ continue;
+ }
+
+ SVN_ERR(show_diff(desc, scratch_pool));
+ knows_something = TRUE;
+ }
+ else if (strcmp(answer, "e") == 0 || strcmp(answer, ":-E") == 0)
+ {
+ SVN_ERR(open_editor(&performed_edit, desc, b, scratch_pool));
+ if (performed_edit)
+ knows_something = TRUE;
+ }
+ else if (strcmp(answer, "m") == 0 || strcmp(answer, ":-M") == 0)
+ {
+ if (desc->kind != svn_wc_conflict_kind_text)
+ {
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option; can only "
+ "resolve text conflicts with "
+ "the internal merge tool."
+ "\n\n")));
+ continue;
+ }
+
+ if (desc->base_abspath && desc->their_abspath &&
+ desc->my_abspath && desc->merged_file)
+ {
+ svn_boolean_t remains_in_conflict;
+
+ SVN_ERR(svn_cl__merge_file(desc->base_abspath,
+ desc->their_abspath,
+ desc->my_abspath,
+ desc->merged_file,
+ desc->local_abspath,
+ b->path_prefix,
+ b->editor_cmd,
+ b->config,
+ &remains_in_conflict,
+ scratch_pool));
+ knows_something = !remains_in_conflict;
+ }
+ else
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option.\n\n")));
+ }
+ else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
+ {
+ if (desc->base_abspath && desc->their_abspath &&
+ desc->my_abspath && desc->merged_file)
+ {
+ SVN_ERR(launch_resolver(&performed_edit, desc, b, scratch_pool));
+ if (performed_edit)
+ knows_something = TRUE;
+ }
+ else
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option.\n\n")));
+ }
+ else if (strcmp(answer, "r") == 0)
+ {
+ /* We only allow the user accept the merged version of
+ the file if they've edited it, or at least looked at
+ the diff. */
+ if (knows_something)
+ {
+ result->choice = svn_wc_conflict_choose_merged;
+ break;
+ }
+ else
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Invalid option.\n\n")));
+ }
+ }
+
+ return SVN_NO_ERROR;
+}
+
+/* Ask the user what to do about the property conflict described by DESC.
+ * Return the answer in RESULT. B is the conflict baton for this
+ * conflict resolution session.
+ * SCRATCH_POOL is used for temporary allocations. */
+static svn_error_t *
+handle_prop_conflict(svn_wc_conflict_result_t *result,
+ const svn_wc_conflict_description2_t *desc,
+ svn_cl__conflict_baton_t *b,
+ apr_pool_t *scratch_pool)
+{
+ const char *answer;
+ const char *prompt;
+ svn_stringbuf_t *prop_reject;
+ apr_pool_t *iterpool;
+
+ SVN_ERR_ASSERT(desc->kind == svn_wc_conflict_kind_property);
+
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ _("Conflict for property '%s' discovered"
+ " on '%s'.\n"),
+ desc->property_name,
+ svn_cl__local_style_skip_ancestor(
+ b->path_prefix, desc->local_abspath,
+ scratch_pool)));
+
+ /* ### Currently, the only useful information in a prop conflict
+ * ### description is the .prej file path, which, possibly due to
+ * ### deceitful interference from outer space, is stored in the
+ * ### 'their_abspath' field of the description.
+ * ### This needs to be fixed so we can present better options here. */
+ if (desc->their_abspath)
+ {
+ /* ### The library dumps an svn_string_t into a temp file, and
+ * ### we read it back from the file into an svn_stringbuf_t here.
+ * ### That's rather silly. We should be passed svn_string_t's
+ * ### containing the old/mine/theirs values instead. */
+ SVN_ERR(svn_stringbuf_from_file2(&prop_reject,
+ desc->their_abspath,
+ scratch_pool));
+ /* Print reject file contents. */
+ SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool,
+ "%s\n", prop_reject->data));
+ }
+ else
+ {
+ /* Nothing much we can do without a prej file... */
+ result->choice = svn_wc_conflict_choose_postpone;
+ return SVN_NO_ERROR;
+ }
+
+ iterpool = svn_pool_create(scratch_pool);
+ while (TRUE)
+ {
+ svn_pool_clear(iterpool);
+
+ prompt = _("Select: (p) postpone, (mf) mine-full, (tf) theirs-full: ");
+
+ SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, iterpool));
+
+ if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
+ {
+ /* Do nothing, let property be marked conflicted. */
+ result->choice = svn_wc_conflict_choose_postpone;
+ break;
+ }
+ else if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
+ {
+ result->choice = svn_wc_conflict_choose_mine_full;
+ break;
+ }
+ else if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
+ {
+ result->choice = svn_wc_conflict_choose_theirs_full;
+ break;
+ }
+ }
+ svn_pool_destroy(iterpool);
+
+ return SVN_NO_ERROR;
+}
/* Implement svn_wc_conflict_resolver_func2_t; resolves based on
--accept option if given, else by prompting. */
@@ -409,333 +750,11 @@ svn_cl__conflict_handler(svn_wc_conflict
*/
if (((desc->node_kind == svn_node_file)
&& (desc->action == svn_wc_conflict_action_edit)
- && (desc->reason == svn_wc_conflict_reason_edited))
- || (desc->kind == svn_wc_conflict_kind_property))
- {
- const char *answer;
- char *prompt;
- svn_boolean_t diff_allowed = FALSE;
- /* Have they done something that might have affected the merged
- file (so that we need to save a .edited copy)? */
- svn_boolean_t performed_edit = FALSE;
- /* Have they done *something* (edit, look at diff, etc) to
- give them a rational basis for choosing (r)esolved? */
- svn_boolean_t knows_something = FALSE;
-
- if (desc->kind == svn_wc_conflict_kind_text)
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Conflict discovered in file '%s'.\n"),
- svn_cl__local_style_skip_ancestor(
- b->path_prefix, desc->local_abspath,
- subpool)));
- else if (desc->kind == svn_wc_conflict_kind_property)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Conflict for property '%s' discovered"
- " on '%s'.\n"),
- desc->property_name,
- svn_cl__local_style_skip_ancestor(
- b->path_prefix, desc->local_abspath,
- subpool)));
-
- if ((!desc->my_abspath && desc->their_abspath)
- || (desc->my_abspath && !desc->their_abspath))
- {
- /* One agent wants to change the property, one wants to
- delete it. This is not something we can diff, so we
- just tell the user. */
- svn_stringbuf_t *myval = NULL, *theirval = NULL;
-
- if (desc->my_abspath)
- {
- SVN_ERR(svn_stringbuf_from_file2(&myval, desc->my_abspath,
- subpool));
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("They want to delete the property, "
- "you want to change the value to '%s'.\n"),
- myval->data));
- }
- else
- {
- SVN_ERR(svn_stringbuf_from_file2(&theirval,
- desc->their_abspath,
- subpool));
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("They want to change the property value to '%s', "
- "you want to delete the property.\n"),
- theirval->data));
- }
- }
- }
- else
- /* We don't recognize any other sort of conflict yet */
- return SVN_NO_ERROR;
-
- /* Diffing can happen between base and merged, to show conflict
- markers to the user (this is the typical 3-way merge
- scenario), or if no base is available, we can show a diff
- between mine and theirs. */
- if ((desc->merged_file && desc->base_abspath)
- || (!desc->base_abspath && desc->my_abspath && desc->their_abspath))
- diff_allowed = TRUE;
-
- while (TRUE)
- {
- svn_pool_clear(subpool);
+ && (desc->reason == svn_wc_conflict_reason_edited)))
+ SVN_ERR(handle_text_conflict(*result, desc, b, subpool));
+ else if (desc->kind == svn_wc_conflict_kind_property)
+ SVN_ERR(handle_prop_conflict(*result, desc, b, subpool));
- prompt = apr_pstrdup(subpool, _("Select: (p) postpone"));
-
- if (diff_allowed)
- {
- prompt = apr_pstrcat(subpool, prompt,
- _(", (df) diff-full, (e) edit, (m) merge"),
- (char *)NULL);
-
- if (knows_something)
- prompt = apr_pstrcat(subpool, prompt, _(", (r) resolved"),
- (char *)NULL);
-
- if (! desc->is_binary &&
- desc->kind != svn_wc_conflict_kind_property)
- prompt = apr_pstrcat(subpool, prompt,
- _(",\n (mc) mine-conflict, "
- "(tc) theirs-conflict"),
- (char *)NULL);
- }
- else
- {
- if (knows_something)
- prompt = apr_pstrcat(subpool, prompt, _(", (r) resolved"),
- (char *)NULL);
- prompt = apr_pstrcat(subpool, prompt,
- _(",\n "
- "(mf) mine-full, (tf) theirs-full"),
- (char *)NULL);
- }
-
- prompt = apr_pstrcat(subpool, prompt, ",\n ", (char *)NULL);
- prompt = apr_pstrcat(subpool, prompt,
- _("(s) show all options: "),
- (char *)NULL);
-
- SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, subpool));
-
- if (strcmp(answer, "s") == 0)
- {
- /* These are used in svn_cl__accept_from_word(). */
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("\n"
- " (e) edit - change merged file in an editor\n"
- " (df) diff-full - show all changes made to merged "
- "file\n"
- " (r) resolved - accept merged version of file\n"
- "\n"
- " (dc) display-conflict - show all conflicts "
- "(ignoring merged version)\n"
- " (mc) mine-conflict - accept my version for all "
- "conflicts (same)\n"
- " (tc) theirs-conflict - accept their version for all "
- "conflicts (same)\n"
- "\n"
- " (mf) mine-full - accept my version of entire file "
- "(even non-conflicts)\n"
- " (tf) theirs-full - accept their version of entire "
- "file (same)\n"
- "\n"
- " (p) postpone - mark the conflict to be "
- "resolved later\n"
- " (m) merge - use internal merge tool to "
- "resolve conflict\n"
- " (l) launch - launch external tool to "
- "resolve conflict\n"
- " (s) show all - show this list\n\n")));
- }
- else if (strcmp(answer, "p") == 0 || strcmp(answer, ":-P") == 0)
- {
- /* Do nothing, let file be marked conflicted. */
- (*result)->choice = svn_wc_conflict_choose_postpone;
- break;
- }
- else if (strcmp(answer, "mc") == 0 || strcmp(answer, "X-)") == 0)
- {
- if (desc->is_binary)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; cannot choose "
- "based on conflicts in a "
- "binary file.\n\n")));
- continue;
- }
- else if (desc->kind == svn_wc_conflict_kind_property)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; cannot choose "
- "based on conflicts for "
- "properties.\n\n")));
- continue;
- }
-
- (*result)->choice = svn_wc_conflict_choose_mine_conflict;
- if (performed_edit)
- (*result)->save_merged = TRUE;
- break;
- }
- else if (strcmp(answer, "tc") == 0 || strcmp(answer, "X-(") == 0)
- {
- if (desc->is_binary)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; cannot choose "
- "based on conflicts in a "
- "binary file.\n\n")));
- continue;
- }
- else if (desc->kind == svn_wc_conflict_kind_property)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; cannot choose "
- "based on conflicts for "
- "properties.\n\n")));
- continue;
- }
- (*result)->choice = svn_wc_conflict_choose_theirs_conflict;
- if (performed_edit)
- (*result)->save_merged = TRUE;
- break;
- }
- else if (strcmp(answer, "mf") == 0 || strcmp(answer, ":-)") == 0)
- {
- (*result)->choice = svn_wc_conflict_choose_mine_full;
- if (performed_edit)
- (*result)->save_merged = TRUE;
- break;
- }
- else if (strcmp(answer, "tf") == 0 || strcmp(answer, ":-(") == 0)
- {
- (*result)->choice = svn_wc_conflict_choose_theirs_full;
- if (performed_edit)
- (*result)->save_merged = TRUE;
- break;
- }
- else if (strcmp(answer, "dc") == 0)
- {
- if (desc->is_binary)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; cannot "
- "display conflicts for a "
- "binary file.\n\n")));
- continue;
- }
- else if (desc->kind == svn_wc_conflict_kind_property)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; cannot "
- "display conflicts for "
- "properties.\n\n")));
- continue;
- }
- else if (! (desc->my_abspath && desc->base_abspath &&
- desc->their_abspath))
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; original "
- "files not available.\n\n")));
- continue;
- }
- SVN_ERR(show_conflicts(desc, subpool));
- knows_something = TRUE;
- }
- else if (strcmp(answer, "df") == 0)
- {
- if (! diff_allowed)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; there's no "
- "merged version to diff.\n\n")));
- continue;
- }
-
- SVN_ERR(show_diff(desc, subpool));
- knows_something = TRUE;
- }
- else if (strcmp(answer, "e") == 0 || strcmp(answer, ":-E") == 0)
- {
- SVN_ERR(open_editor(&performed_edit, desc, b, subpool));
- if (performed_edit)
- knows_something = TRUE;
- }
- else if (strcmp(answer, "m") == 0 || strcmp(answer, ":-M") == 0)
- {
- if (desc->kind != svn_wc_conflict_kind_text)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; can only "
- "resolve text conflicts with "
- "the internal merge tool."
- "\n\n")));
- continue;
- }
-
- if (desc->base_abspath && desc->their_abspath &&
- desc->my_abspath && desc->merged_file)
- {
- svn_boolean_t remains_in_conflict;
-
- SVN_ERR(svn_cl__merge_file(desc->base_abspath,
- desc->their_abspath,
- desc->my_abspath,
- desc->merged_file,
- desc->local_abspath,
- b->path_prefix,
- b->editor_cmd,
- b->config,
- &remains_in_conflict,
- subpool));
- knows_something = !remains_in_conflict;
- }
- else
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option.\n\n")));
- }
- else if (strcmp(answer, "l") == 0 || strcmp(answer, ":-l") == 0)
- {
- if (desc->kind == svn_wc_conflict_kind_property)
- {
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option; cannot "
- "resolve property conflicts "
- "with an external merge tool."
- "\n\n")));
- continue;
- }
- if (desc->base_abspath && desc->their_abspath &&
- desc->my_abspath && desc->merged_file)
- {
- SVN_ERR(launch_resolver(&performed_edit, desc, b, subpool));
- if (performed_edit)
- knows_something = TRUE;
- }
- else
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option.\n\n")));
- }
- else if (strcmp(answer, "r") == 0)
- {
- /* We only allow the user accept the merged version of
- the file if they've edited it, or at least looked at
- the diff. */
- if (knows_something)
- {
- (*result)->choice = svn_wc_conflict_choose_merged;
- break;
- }
- else
- SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
- _("Invalid option.\n\n")));
- }
- }
- }
/*
Dealing with obstruction of additions can be tricky. The
obstructing item could be unversioned, versioned, or even
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=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/file-merge.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/file-merge.c Tue Sep 25 19:06:49 2012
@@ -596,7 +596,7 @@ merge_chunks(apr_array_header_t **merged
prompt = svn_stringbuf_create(
apr_psprintf(scratch_pool, "%s\n%s|%s\n%s",
- _("Conflicting section found during merge."),
+ _("Conflicting section found during merge:"),
prepare_line_for_display(
apr_psprintf(scratch_pool,
_("(1) their version (at line %lu)"),
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=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/log-cmd.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/log-cmd.c Tue Sep 25 19:06:49 2012
@@ -155,12 +155,11 @@ match_search_pattern(const char *search_
const char *date,
const char *log_message,
apr_hash_t *changed_paths,
- svn_boolean_t case_insensitive_search,
apr_pool_t *pool)
{
/* Match any substring containing the pattern, like UNIX 'grep' does. */
const char *pattern = apr_psprintf(pool, "*%s*", search_pattern);
- int flags = (case_insensitive_search ? APR_FNM_CASE_BLIND : 0);
+ int flags = APR_FNM_CASE_BLIND;
/* Does the author match the search pattern? */
if (author && apr_fnmatch(pattern, author, flags) == APR_SUCCESS)
@@ -227,14 +226,13 @@ match_search_patterns(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;
+ const char *pattern;
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);
+ pattern = APR_ARRAY_IDX(pattern_group, j, const char *);
+ match = match_search_pattern(pattern, author, date, message,
+ changed_paths, iterpool);
if (!match)
break;
}
Modified: subversion/branches/master-passphrase/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/main.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/main.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/main.c Tue Sep 25 19:06:49 2012
@@ -130,9 +130,7 @@ typedef enum svn_cl__longopt_t {
opt_allow_mixed_revisions,
opt_include_externals,
opt_search,
- opt_isearch,
opt_search_and,
- opt_isearch_and,
} svn_cl__longopt_t;
@@ -186,37 +184,23 @@ const apr_getopt_option_t svn_cl__option
{"username", opt_auth_username, 1, N_("specify a username ARG")},
{"password", opt_auth_password, 1, N_("specify a password ARG")},
{"extensions", 'x', 1,
- N_("Default: '-u'. When Subversion is invoking an\n"
+ N_("Specify differencing options for external diff or\n"
" "
- "external diff program, ARG is simply passed along\n"
+ "internal diff or blame. Default: '-u'. Options are\n"
" "
- "to the program. But when Subversion is using its\n"
+ "separated by spaces. Internal diff and blame take:\n"
" "
- "default internal diff implementation, or when\n"
+ " -u, --unified: Show 3 lines of unified context\n"
" "
- "Subversion is displaying blame annotations, ARG\n"
+ " -b, --ignore-space-change: Ignore changes in\n"
" "
- "could be any of the following:\n"
+ " amount of white space\n"
" "
- " -u (--unified):\n"
+ " -w, --ignore-all-space: Ignore all white space\n"
" "
- " Output 3 lines of unified context.\n"
+ " --ignore-eol-style: Ignore changes in EOL style\n"
" "
- " -b (--ignore-space-change):\n"
- " "
- " Ignore changes in the amount of white space.\n"
- " "
- " -w (--ignore-all-space):\n"
- " "
- " Ignore all white space.\n"
- " "
- " --ignore-eol-style:\n"
- " "
- " Ignore changes in EOL style.\n"
- " "
- " -p (--show-c-function):\n"
- " "
- " Show C function name in diff output.")},
+ " -p, --show-c-function: Show C function name")},
{"targets", opt_targets, 1,
N_("pass contents of file ARG as additional args")},
{"depth", opt_depth, 1,
@@ -378,14 +362,9 @@ 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
*
* These have NULL desriptions, but an option code that matches some
@@ -734,7 +713,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_search_and, opt_isearch, opt_isearch_and},
+ opt_search_and, },
{{opt_with_revprop, N_("retrieve revision property ARG")},
{'c', N_("the change made in revision ARG")}} },
@@ -750,7 +729,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" 3. merge SOURCE1[@N] SOURCE2[@M] [TARGET_WCPATH]\n"
" (the '2-URL' merge)\n"
"\n"
-" 1. This form, with with one source path and no revision range, is called\n"
+" 1. This form, with one source path and no revision range, is called\n"
" an 'automatic' merge:\n"
"\n"
" svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
@@ -1057,13 +1036,19 @@ const svn_opt_subcommand_desc2_t svn_cl_
{ "mergeinfo", svn_cl__mergeinfo, {0}, N_
("Display merge-related information.\n"
- "usage: mergeinfo SOURCE[@REV] [TARGET[@REV]]\n"
- "\n"
- " Display information related to merges (or potential merges) between\n"
- " SOURCE and TARGET (default: '.'). Display the type of information\n"
- " specified by the --show-revs option. If --show-revs isn't passed,\n"
- " it defaults to --show-revs='merged'.\n"
+ "usage: 1. mergeinfo SOURCE[@REV] [TARGET[@REV]]\n"
+ " 2. mergeinfo --show-revs=merged SOURCE[@REV] [TARGET[@REV]]\n"
+ " 3. mergeinfo --show-revs=eligible SOURCE[@REV] [TARGET[@REV]]\n"
+ "\n"
+ " 1. Display the following information about merges between SOURCE and\n"
+ " TARGET:\n"
+ " the youngest common ancestor;\n"
+ " the latest full merge in either direction, and thus the\n"
+ " base that will be used for the next full merge.\n"
+ " 2. Print the revision numbers on SOURCE that have been merged to TARGET.\n"
+ " 3. Print the revision numbers on SOURCE that have NOT been merged to TARGET.\n"
"\n"
+ " The default TARGET is the current working directory ('.').\n"
" If --revision (-r) is provided, filter the displayed information to\n"
" show only that which is associated with the revisions within the\n"
" specified range. Revision numbers, dates, and the 'HEAD' keyword are\n"
@@ -1588,52 +1573,43 @@ svn_cl__check_cancel(void *baton)
return SVN_NO_ERROR;
}
-/* Add a --search or --isearch argument to OPT_STATE.
+/* Add a --search 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;
+ group = apr_array_make(result_pool, 1, sizeof(const char *));
+ APR_ARRAY_PUSH(group, const char *) = pattern;
APR_ARRAY_PUSH(opt_state->search_patterns, apr_array_header_t *) = group;
}
-/* Add a --search-and or --isearch-and argument to OPT_STATE.
+/* Add a --search-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);
+ add_search_pattern_group(opt_state, pattern, 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;
+ APR_ARRAY_PUSH(group, const char *) = pattern;
}
@@ -1700,7 +1676,7 @@ sub_main(int argc, const char *argv[], a
opt_state.depth = svn_depth_unknown;
opt_state.set_depth = svn_depth_unknown;
opt_state.accept_which = svn_cl__accept_unspecified;
- opt_state.show_revs = svn_cl__show_revs_merged;
+ opt_state.show_revs = svn_cl__show_revs_invalid;
/* No args? Show usage. */
if (argc <= 1)
@@ -2186,16 +2162,10 @@ sub_main(int argc, const char *argv[], a
opt_state.diff.properties_only = TRUE;
break;
case opt_search:
- add_search_pattern_group(&opt_state, opt_arg, FALSE, pool);
- break;
- case opt_isearch:
- add_search_pattern_group(&opt_state, opt_arg, TRUE, pool);
+ add_search_pattern_group(&opt_state, opt_arg, 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;
+ add_search_pattern_to_latest_group(&opt_state, opt_arg, pool);
default:
/* Hmmm. Perhaps this would be a good place to squirrel away
opts that commands like svn diff might need. Hmmm indeed. */
Modified: subversion/branches/master-passphrase/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/merge-cmd.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/merge-cmd.c Tue Sep 25 19:06:49 2012
@@ -121,7 +121,6 @@ symmetric_merge(const char *source_path_
apr_pool_t *scratch_pool)
{
svn_client__symmetric_merge_t *merge;
- svn_boolean_t reintegrate_like;
/* Find the 3-way merges needed (and check suitability of the WC). */
SVN_ERR(svn_client__find_symmetric_merge(&merge,
@@ -130,9 +129,7 @@ symmetric_merge(const char *source_path_
allow_local_mods, allow_switched_subtrees,
ctx, scratch_pool, scratch_pool));
- reintegrate_like = (merge->mid != NULL);
-
- if (reintegrate_like)
+ if (svn_client__symmetric_merge_is_reintegrate_like(merge))
{
if (record_only)
return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
Modified: subversion/branches/master-passphrase/subversion/svn/mergeinfo-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/mergeinfo-cmd.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/mergeinfo-cmd.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/mergeinfo-cmd.c Tue Sep 25 19:06:49 2012
@@ -37,6 +37,7 @@
#include "cl.h"
#include "svn_private_config.h"
+#include "private/svn_client_private.h"
/*** Code. ***/
@@ -55,6 +56,194 @@ print_log_rev(void *baton,
return SVN_NO_ERROR;
}
+/* Draw a diagram (by printing text to the console) summarizing the state
+ * of merging between two branches, given the merge description
+ * indicated by YCA, BASE, RIGHT, TARGET, REINTEGRATE_LIKE. */
+static svn_error_t *
+mergeinfo_diagram(svn_client__pathrev_t *yca,
+ svn_client__pathrev_t *base,
+ svn_client__pathrev_t *right,
+ svn_client__pathrev_t *target,
+ svn_boolean_t target_is_wc,
+ svn_boolean_t reintegrate_like,
+ apr_pool_t *pool)
+{
+ /* The graph occupies 4 rows of text, and the annotations occupy
+ * another 2 rows above and 2 rows below. The graph is constructed
+ * from left to right in discrete sections ("columns"), each of which
+ * can have a different width (measured in characters). Each element in
+ * the array is either a text string of the appropriate width, or can
+ * be NULL to draw a blank cell. */
+#define ROWS 8
+#define COLS 4
+ const char *g[ROWS][COLS] = {{0}};
+ int col_width[COLS];
+ int row, col;
+
+ /* The YCA (that is, the branching point) */
+ g[0][0] = apr_psprintf(pool, " %-8ld", yca->rev);
+ g[1][0] = " | ";
+ if (strcmp(yca->url, right->url) == 0)
+ {
+ g[2][0] = "----------";
+ g[3][0] = " \\ ";
+ g[4][0] = " \\ ";
+ g[5][0] = " -----";
+ }
+ else if (strcmp(yca->url, target->url) == 0)
+ {
+ g[2][0] = " -----";
+ g[3][0] = " / ";
+ g[4][0] = " / ";
+ g[5][0] = "----------";
+ }
+ else
+ {
+ g[2][0] = " -----";
+ g[3][0] = "... / ";
+ g[4][0] = " \\ ";
+ g[5][0] = " -----";
+ }
+
+ /* An ellipsis, because we don't show information about earlier merges */
+ {
+ g[2][1] = "| ... |---";
+ g[3][1] = " ";
+ g[4][1] = " ";
+ g[5][1] = "| ... |---";
+ }
+
+ /* The last full merge */
+ if ((base->rev > yca->rev) && reintegrate_like)
+ {
+ g[2][2] = "---------";
+ g[3][2] = " / ";
+ g[4][2] = " / ";
+ g[5][2] = "---------";
+ g[6][2] = "| ";
+ g[7][2] = apr_psprintf(pool, "%-8ld ", base->rev);
+ }
+ else if (base->rev > yca->rev)
+ {
+ g[0][2] = apr_psprintf(pool, "%-8ld ", base->rev);
+ g[1][2] = "| ";
+ g[2][2] = "---------";
+ g[3][2] = " \\ ";
+ g[4][2] = " \\ ";
+ g[5][2] = "---------";
+ }
+ else
+ {
+ g[2][2] = "---------";
+ g[3][2] = " ";
+ g[4][2] = " ";
+ g[5][2] = "---------";
+ }
+
+ /* The tips of the branches */
+ {
+ g[0][3] = apr_psprintf(pool, "%-8ld", right->rev);
+ g[1][3] = "| ";
+ g[2][3] = "- ";
+ g[3][3] = " ";
+ g[4][3] = " ";
+ g[5][3] = "- ";
+ g[6][3] = "| ";
+ g[7][3] = target_is_wc ? apr_psprintf(pool, "%-8ld", target->rev)
+ : "WC ";
+ }
+
+ /* Find the width of each column, so we know how to print blank cells */
+ for (col = 0; col < COLS; col++)
+ {
+ col_width[col] = 0;
+ for (row = 0; row < ROWS; row++)
+ {
+ if (g[row][col] && (strlen(g[row][col]) > col_width[col]))
+ col_width[col] = strlen(g[row][col]);
+ }
+ }
+
+ /* Column headings */
+ SVN_ERR(svn_cmdline_fputs(
+ _(" youngest last repos.\n"
+ " common full tip of path of\n"
+ " ancestor merge branch branch\n"
+ "\n"),
+ stdout, pool));
+
+ /* Print the diagram, row by row */
+ for (row = 0; row < ROWS; row++)
+ {
+ SVN_ERR(svn_cmdline_fputs(" ", stdout, pool));
+ for (col = 0; col < COLS; col++)
+ {
+ if (g[row][col])
+ {
+ SVN_ERR(svn_cmdline_fputs(g[row][col], stdout, pool));
+ }
+ else
+ {
+ /* Print <column-width> spaces */
+ SVN_ERR(svn_cmdline_printf(pool, "%*s", col_width[col], ""));
+ }
+ }
+ if (row == 2)
+ SVN_ERR(svn_cmdline_printf(pool, " %s",
+ svn_client__pathrev_relpath(right, pool)));
+ if (row == 5)
+ SVN_ERR(svn_cmdline_printf(pool, " %s",
+ svn_client__pathrev_relpath(target, pool)));
+ SVN_ERR(svn_cmdline_fputs("\n", stdout, pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
+/* Display a summary of the state of merging between the two branches
+ * SOURCE_PATH_OR_URL@SOURCE_REVISION and
+ * TARGET_PATH_OR_URL@TARGET_REVISION. */
+static svn_error_t *
+mergeinfo_summary(
+ const char *source_path_or_url,
+ const svn_opt_revision_t *source_revision,
+ const char *target_path_or_url,
+ const svn_opt_revision_t *target_revision,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ svn_client__symmetric_merge_t *the_merge;
+ svn_client__pathrev_t *yca, *base, *right, *target;
+ svn_boolean_t target_is_wc, reintegrate_like;
+
+ target_is_wc = svn_path_is_url(target_path_or_url)
+ && (target_revision->kind == svn_opt_revision_unspecified
+ || target_revision->kind == svn_opt_revision_working);
+ if (target_is_wc)
+ SVN_ERR(svn_client__find_symmetric_merge(
+ &the_merge,
+ source_path_or_url, source_revision,
+ target_path_or_url,
+ TRUE, TRUE, TRUE, /* allow_* */
+ ctx, pool, pool));
+ else
+ SVN_ERR(svn_client__find_symmetric_merge_no_wc(
+ &the_merge,
+ source_path_or_url, source_revision,
+ target_path_or_url, target_revision,
+ ctx, pool, pool));
+
+ SVN_ERR(svn_client__symmetric_merge_get_locations(
+ &yca, &base, &right, &target, the_merge, pool));
+ reintegrate_like = svn_client__symmetric_merge_is_reintegrate_like(the_merge);
+
+ SVN_ERR(mergeinfo_diagram(yca, base, right, target,
+ target_is_wc, reintegrate_like,
+ pool));
+
+ return SVN_NO_ERROR;
+}
+
/* This implements the `svn_opt_subcommand_t' interface. */
svn_error_t *
svn_cl__mergeinfo(apr_getopt_t *os,
@@ -140,5 +329,11 @@ svn_cl__mergeinfo(apr_getopt_t *os,
TRUE, depth, NULL, ctx,
pool));
}
+ else
+ {
+ SVN_ERR(mergeinfo_summary(source, &src_peg_revision,
+ target, &tgt_peg_revision,
+ ctx, pool));
+ }
return SVN_NO_ERROR;
}
Modified: subversion/branches/master-passphrase/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/svn/status-cmd.c?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/svn/status-cmd.c (original)
+++ subversion/branches/master-passphrase/subversion/svn/status-cmd.c Tue Sep 25 19:06:49 2012
@@ -377,7 +377,7 @@ svn_cl__status(apr_getopt_t *os,
### non-changelist entries. */
if (opt_state->xml)
{
- svn_stringbuf_set(buf, "");
+ svn_stringbuf_setempty(buf);
svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_normal,
"changelist", "name", changelist_name,
NULL);
@@ -398,7 +398,7 @@ svn_cl__status(apr_getopt_t *os,
if (opt_state->xml)
{
- svn_stringbuf_set(buf, "");
+ svn_stringbuf_setempty(buf);
svn_xml_make_close_tag(&buf, scratch_pool, "changelist");
SVN_ERR(svn_cl__error_checked_fputs(buf->data, stdout));
}
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=1390054&r1=1390053&r2=1390054&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 Tue Sep 25 19:06:49 2012
@@ -100,26 +100,17 @@ Valid options:
--diff : produce diff output
--diff-cmd ARG : use ARG as diff command
--internal-diff : override diff-cmd specified in config file
- -x [--extensions] ARG : Default: '-u'. When Subversion is invoking an
- external diff program, ARG is simply passed along
- to the program. But when Subversion is using its
- default internal diff implementation, or when
- Subversion is displaying blame annotations, ARG
- could be any of the following:
- -u (--unified):
- Output 3 lines of unified context.
- -b (--ignore-space-change):
- Ignore changes in the amount of white space.
- -w (--ignore-all-space):
- Ignore all white space.
- --ignore-eol-style:
- Ignore changes in EOL style.
- -p (--show-c-function):
- Show C function name in diff output.
+ -x [--extensions] ARG : Specify differencing options for external diff or
+ internal diff or blame. Default: '-u'. Options are
+ separated by spaces. Internal diff and blame take:
+ -u, --unified: Show 3 lines of unified context
+ -b, --ignore-space-change: Ignore changes in
+ amount of white space
+ -w, --ignore-all-space: Ignore all white space
+ --ignore-eol-style: Ignore changes in EOL style
+ -p, --show-c-function: Show C function name
--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=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/log_tests.py Tue Sep 25 19:06:49 2012
@@ -2296,9 +2296,9 @@ def log_search(sbox):
log_chain = parse_log_output(output)
check_log_chain(log_chain, [7, 6, 3])
- # case-insensitive search
+ # search is case-insensitive
exit_code, output, err = svntest.actions.run_and_verify_svn(
- None, None, [], 'log', '--isearch',
+ None, None, [], 'log', '--search',
'FOR REVISION [367]')
log_chain = parse_log_output(output)
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/mergeinfo_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/mergeinfo_tests.py?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/mergeinfo_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/mergeinfo_tests.py Tue Sep 25 19:06:49 2012
@@ -70,7 +70,21 @@ def no_mergeinfo(sbox):
sbox.build(create_wc=False)
sbox.simple_repo_copy('A', 'A2')
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
- [],
+ "\n".join(
+[" youngest last repos."] +
+[" common full tip of path of"] +
+[" ancestor merge branch branch"] +
+[""] +
+[" 1 2 "] +
+[" | | "] +
+[" ----------| ... |------------- A"] +
+[" \ "] +
+[" \ "] +
+[" -----| ... |------------- A2"] +
+[" | "] +
+[" WC "] +
+[""]
+ ),
sbox.repo_url + '/A',
sbox.repo_url + '/A2')
@@ -94,7 +108,8 @@ def mergeinfo(sbox):
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
['3'],
sbox.repo_url + '/A',
- sbox.ospath('A2'))
+ sbox.ospath('A2'),
+ "--show-revs=merged")
@SkipUnless(server_has_mergeinfo)
def explicit_mergeinfo_source(sbox):
@@ -132,13 +147,17 @@ def explicit_mergeinfo_source(sbox):
# Check using each of our recorded merge sources (as paths and URLs).
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
- ['2', '4'], url(B2), path(B))
+ ['2', '4'], url(B2), path(B),
+ "--show-revs=merged")
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
- ['2', '4'], path(B2), path(B))
+ ['2', '4'], path(B2), path(B),
+ "--show-revs=merged")
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
- ['3', '5'], url(B3), path(B))
+ ['3', '5'], url(B3), path(B),
+ "--show-revs=merged")
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
- ['3', '5'], path(B3), path(B))
+ ['3', '5'], path(B3), path(B),
+ "--show-revs=merged")
@SkipUnless(server_has_mergeinfo)
def mergeinfo_non_source(sbox):
@@ -162,7 +181,8 @@ def mergeinfo_non_source(sbox):
# Check on a source we haven't "merged" from.
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
- [], H2_url, H_path)
+ [], H2_url, H_path,
+ "--show-revs=merged")
#----------------------------------------------------------------------
# Issue #3138
@@ -238,7 +258,8 @@ def non_inheritable_mergeinfo(sbox):
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
['4','6*'],
sbox.repo_url + '/A',
- A_COPY_path)
+ A_COPY_path,
+ '--show-revs', 'merged')
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
['3','5','6*'],
sbox.repo_url + '/A',
@@ -249,7 +270,8 @@ def non_inheritable_mergeinfo(sbox):
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
['4'],
sbox.repo_url + '/A/D',
- D_COPY_path)
+ D_COPY_path,
+ '--show-revs', 'merged')
svntest.actions.run_and_verify_mergeinfo(adjust_error_for_server_version(""),
['3','6'],
sbox.repo_url + '/A/D',
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/patch_tests.py?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/patch_tests.py Tue Sep 25 19:06:49 2012
@@ -4099,6 +4099,61 @@ def patch_add_and_delete(sbox):
1, # check-props
1) # dry-run
+
+def patch_git_with_index_line(sbox):
+ "apply git patch with 'index' line"
+
+ sbox.build(read_only = True)
+ wc_dir = sbox.wc_dir
+ patch_file_path = make_patch_path(sbox)
+
+ unidiff_patch = [
+ "diff --git a/src/tools/ConsoleRunner/hi.txt b/src/tools/ConsoleRunner/hi.txt\n",
+ "new file mode 100644\n",
+ "index 0000000..c82a38f\n",
+ "--- /dev/null\n",
+ "+++ b/src/tools/ConsoleRunner/hi.txt\n",
+ "@@ -0,0 +1 @@\n",
+ "+hihihihihihi\n",
+ "\ No newline at end of file\n",
+ ]
+
+ svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
+
+ expected_output = [
+ 'A %s\n' % sbox.ospath('src'),
+ 'A %s\n' % sbox.ospath('src/tools'),
+ 'A %s\n' % sbox.ospath('src/tools/ConsoleRunner'),
+ 'A %s\n' % sbox.ospath('src/tools/ConsoleRunner/hi.txt'),
+ ]
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'src/' : Item(status='A ', wc_rev=0),
+ 'src/tools' : Item(status='A ', wc_rev=0),
+ 'src/tools/ConsoleRunner/' : Item(status='A ', wc_rev=0),
+ 'src/tools/ConsoleRunner/hi.txt' : Item(status='A ', wc_rev=0),
+ })
+
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({'src' : Item(),
+ 'src/tools' : Item(),
+ 'src/tools/ConsoleRunner' : Item(),
+ 'src/tools/ConsoleRunner/hi.txt' :
+ Item(contents="hihihihihihi")
+ })
+
+ 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
+
########################################################################
#Run the tests
@@ -4143,6 +4198,7 @@ test_list = [ None,
patch_delete_and_skip,
patch_target_no_eol_at_eof,
patch_add_and_delete,
+ patch_git_with_index_line,
]
if __name__ == '__main__':
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/prop_tests.py?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/prop_tests.py Tue Sep 25 19:06:49 2012
@@ -2047,7 +2047,7 @@ def atomic_over_ra(sbox):
sbox.build(create_wc=False)
repo_url = sbox.repo_url
- # From this point on, similar to ../libsvn_fs-fs-test.c:revision_props().
+ # From this point on, similar to ../libsvn_fs/fs-test.c:revision_props().
s1 = "violet"
s2 = "wrong value"
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/resolve_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/resolve_tests.py?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/resolve_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/resolve_tests.py Tue Sep 25 19:06:49 2012
@@ -106,7 +106,6 @@ def automatic_conflict_resolution(sbox):
# Test for issue #3707 'property conflicts not handled correctly by
# svn resolve'.
@Issue(3707)
-@XFail()
def prop_conflict_resolution(sbox):
"resolving prop conflicts"
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/stat_tests.py Tue Sep 25 19:06:49 2012
@@ -989,22 +989,17 @@ def status_ignored_dir(sbox):
@Issue(2030)
def status_unversioned_dir(sbox):
"status on unversioned dir"
- sbox.build(read_only = True, create_wc = False)
- dir = sbox.wc_dir
- svntest.main.safe_rmtree(sbox.wc_dir)
- os.mkdir(dir)
-
- # Depending on whether you run the tests below a working copy
- # or not, the error message might either be something like
- # svn: warning: W155007: '...copies/stat_tests-19' is not a working copy
- # or
- # svn: warning: W155010: The node '...copies/stat_tests-19' was not found.
+ sbox.build(read_only = True)
+
+ # Create two unversioned directories within the test working copy
+ path = sbox.ospath('1/2')
+ os.makedirs(path)
expected_err = "svn: warning: W1550(07|10): .*'.*(/|\\\\)" + \
- os.path.basename(dir) + \
- "' (is not a working copy|was not found)"
+ os.path.basename(path) + \
+ "' was not found"
svntest.actions.run_and_verify_svn2(None, [], expected_err, 0,
- "status", dir, dir)
+ "status", path)
#----------------------------------------------------------------------
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/actions.py Tue Sep 25 19:06:49 2012
@@ -1266,9 +1266,9 @@ def run_and_verify_mergeinfo(error_re_st
expected_output = [],
*args):
"""Run 'svn mergeinfo ARGS', and compare the result against
- EXPECTED_OUTPUT, a list of string representations of revisions
- expected in the output. Raise an exception if an unexpected
- output is encountered."""
+ EXPECTED_OUTPUT, which is either a list of string representations
+ of revisions expected in the output, or a plain string.
+ Raise an exception if an unexpected output is encountered."""
mergeinfo_command = ["mergeinfo"]
mergeinfo_command.extend(args)
@@ -1281,23 +1281,36 @@ def run_and_verify_mergeinfo(error_re_st
verify.verify_outputs(None, None, err, None, expected_err)
return
- out = [_f for _f in [x.rstrip()[1:] for x in out] if _f]
- expected_output.sort()
- extra_out = []
- if out != expected_output:
- exp_hash = dict.fromkeys(expected_output)
- for rev in out:
- if rev in exp_hash:
- del(exp_hash[rev])
- else:
- extra_out.append(rev)
- extra_exp = list(exp_hash.keys())
- raise Exception("Unexpected 'svn mergeinfo' output:\n"
- " expected but not found: %s\n"
- " found but not expected: %s"
- % (', '.join([str(x) for x in extra_exp]),
- ', '.join([str(x) for x in extra_out])))
-
+ if isinstance(expected_output, list):
+ out = [_f for _f in [x.rstrip()[1:] for x in out] if _f]
+ expected_output.sort()
+ extra_out = []
+ if out != expected_output:
+ exp_hash = dict.fromkeys(expected_output)
+ for rev in out:
+ if rev in exp_hash:
+ del(exp_hash[rev])
+ else:
+ extra_out.append(rev)
+ extra_exp = list(exp_hash.keys())
+ raise Exception("Unexpected 'svn mergeinfo' output:\n"
+ " expected but not found: %s\n"
+ " found but not expected: %s"
+ % (', '.join([str(x) for x in extra_exp]),
+ ', '.join([str(x) for x in extra_out])))
+ elif isinstance(expected_output, str):
+ out = "".join(out)
+ if out != expected_output:
+ raise Exception("Unexpected 'svn mergeinfo' output:\n"
+ " expected:\n%s\n"
+ " found:\n%s\n"
+ " diff:\n%s\n"
+ % (expected_output, out,
+ '\n'.join(difflib.unified_diff(
+ expected_output.splitlines(),
+ out.splitlines()))))
+ else:
+ raise Exception("expected_output has unexpected type")
def run_and_verify_switch(wc_dir_name,
wc_target,
Modified: subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py?rev=1390054&r1=1390053&r2=1390054&view=diff
==============================================================================
--- subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/master-passphrase/subversion/tests/cmdline/svntest/main.py Tue Sep 25 19:06:49 2012
@@ -1229,10 +1229,12 @@ class TestSpawningThread(threading.Threa
"""A thread that runs test cases in their own processes.
Receives test numbers to run from the queue, and saves results into
the results field."""
- def __init__(self, queue):
+ def __init__(self, queue, progress_func, tests_total):
threading.Thread.__init__(self)
self.queue = queue
self.results = []
+ self.progress_func = progress_func
+ self.tests_total = tests_total
def run(self):
while True:
@@ -1243,6 +1245,11 @@ class TestSpawningThread(threading.Threa
self.run_one(next_index)
+ # signal progress
+ if self.progress_func:
+ self.progress_func(self.tests_total - self.queue.qsize(),
+ self.tests_total)
+
def run_one(self, index):
command = os.path.abspath(sys.argv[0])
@@ -1499,7 +1506,8 @@ def _internal_run_tests(test_list, testn
for num in testnums:
number_queue.put(num)
- threads = [ TestSpawningThread(number_queue) for i in range(parallel) ]
+ threads = [ TestSpawningThread(number_queue, progress_func,
+ len(testnums)) for i in range(parallel) ]
for t in threads:
t.start()
@@ -1512,10 +1520,6 @@ def _internal_run_tests(test_list, testn
results += t.results
results.sort()
- # signal some kind of progress
- if progress_func:
- progress_func(len(testnums), len(testnums))
-
# terminate the line of dots
print("")