You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/12/19 19:49:43 UTC
svn commit: r1220893 [15/19] - in /subversion/branches/fs-py: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/ build/win32/
contrib/client-side/emacs/ contrib/server-side/mod_dontdothat/ notes/
subversion/bindings/javahl/native/ s...
Modified: subversion/branches/fs-py/subversion/svn/mkdir-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/mkdir-cmd.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/mkdir-cmd.c (original)
+++ subversion/branches/fs-py/subversion/svn/mkdir-cmd.c Mon Dec 19 18:49:34 2011
@@ -78,7 +78,8 @@ svn_cl__mkdir(apr_getopt_t *os,
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
err = svn_client_mkdir4(targets, opt_state->parents,
- opt_state->revprop_table, svn_cl__print_commit_info,
+ opt_state->revprop_table,
+ (opt_state->quiet ? NULL : svn_cl__print_commit_info),
NULL, ctx, pool);
if (ctx->log_msg_func3)
Modified: subversion/branches/fs-py/subversion/svn/move-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/move-cmd.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/move-cmd.c (original)
+++ subversion/branches/fs-py/subversion/svn/move-cmd.c Mon Dec 19 18:49:34 2011
@@ -86,7 +86,8 @@ svn_cl__move(apr_getopt_t *os,
err = svn_client_move6(targets, dst_path,
TRUE, opt_state->parents, opt_state->revprop_table,
- svn_cl__print_commit_info, NULL, ctx, pool);
+ (opt_state->quiet ? NULL : svn_cl__print_commit_info),
+ NULL, ctx, pool);
if (err)
err = svn_cl__may_need_force(err);
Modified: subversion/branches/fs-py/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/notify.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/notify.c (original)
+++ subversion/branches/fs-py/subversion/svn/notify.c Mon Dec 19 18:49:34 2011
@@ -47,7 +47,6 @@ struct notify_baton
svn_boolean_t is_checkout;
svn_boolean_t is_export;
svn_boolean_t is_wc_to_repos_copy;
- svn_boolean_t suppress_summary_lines;
svn_boolean_t sent_first_txdelta;
svn_boolean_t in_external;
svn_boolean_t had_print_error; /* Used to not keep printing error messages
@@ -583,8 +582,7 @@ notify(void *baton, const svn_wc_notify_
break;
case svn_wc_notify_update_started:
- if (! (nb->suppress_summary_lines ||
- nb->in_external ||
+ if (! (nb->in_external ||
nb->is_checkout ||
nb->is_export))
{
@@ -596,77 +594,74 @@ notify(void *baton, const svn_wc_notify_
case svn_wc_notify_update_completed:
{
- if (! nb->suppress_summary_lines)
+ if (SVN_IS_VALID_REVNUM(n->revision))
{
- if (SVN_IS_VALID_REVNUM(n->revision))
+ if (nb->is_export)
{
- if (nb->is_export)
+ if ((err = svn_cmdline_printf
+ (pool, nb->in_external
+ ? _("Exported external at revision %ld.\n")
+ : _("Exported revision %ld.\n"),
+ n->revision)))
+ goto print_error;
+ }
+ else if (nb->is_checkout)
+ {
+ if ((err = svn_cmdline_printf
+ (pool, nb->in_external
+ ? _("Checked out external at revision %ld.\n")
+ : _("Checked out revision %ld.\n"),
+ n->revision)))
+ goto print_error;
+ }
+ else
+ {
+ if (nb->received_some_change)
{
+ nb->received_some_change = FALSE;
if ((err = svn_cmdline_printf
(pool, nb->in_external
- ? _("Exported external at revision %ld.\n")
- : _("Exported revision %ld.\n"),
+ ? _("Updated external to revision %ld.\n")
+ : _("Updated to revision %ld.\n"),
n->revision)))
goto print_error;
}
- else if (nb->is_checkout)
+ else
{
if ((err = svn_cmdline_printf
(pool, nb->in_external
- ? _("Checked out external at revision %ld.\n")
- : _("Checked out revision %ld.\n"),
+ ? _("External at revision %ld.\n")
+ : _("At revision %ld.\n"),
n->revision)))
goto print_error;
}
- else
- {
- if (nb->received_some_change)
- {
- nb->received_some_change = FALSE;
- if ((err = svn_cmdline_printf
- (pool, nb->in_external
- ? _("Updated external to revision %ld.\n")
- : _("Updated to revision %ld.\n"),
- n->revision)))
- goto print_error;
- }
- else
- {
- if ((err = svn_cmdline_printf
- (pool, nb->in_external
- ? _("External at revision %ld.\n")
- : _("At revision %ld.\n"),
- n->revision)))
- goto print_error;
- }
- }
}
- else /* no revision */
+ }
+ else /* no revision */
+ {
+ if (nb->is_export)
{
- if (nb->is_export)
- {
- if ((err = svn_cmdline_printf
- (pool, nb->in_external
- ? _("External export complete.\n")
- : _("Export complete.\n"))))
- goto print_error;
- }
- else if (nb->is_checkout)
- {
- if ((err = svn_cmdline_printf
- (pool, nb->in_external
- ? _("External checkout complete.\n")
- : _("Checkout complete.\n"))))
- goto print_error;
- }
- else
- {
- if ((err = svn_cmdline_printf
- (pool, nb->in_external
- ? _("External update complete.\n")
- : _("Update complete.\n"))))
- goto print_error;
- }
+ if ((err = svn_cmdline_printf
+ (pool, nb->in_external
+ ? _("External export complete.\n")
+ : _("Export complete.\n"))))
+ goto print_error;
+ }
+ else if (nb->is_checkout)
+ {
+ if ((err = svn_cmdline_printf
+ (pool, nb->in_external
+ ? _("External checkout complete.\n")
+ : _("Checkout complete.\n"))))
+ goto print_error;
+ }
+ else
+ {
+ if ((err = svn_cmdline_printf
+ (pool, nb->in_external
+ ? _("External update complete.\n")
+ : _("Update complete.\n"))))
+ goto print_error;
}
}
}
@@ -1016,7 +1011,6 @@ notify(void *baton, const svn_wc_notify_
svn_error_t *
svn_cl__get_notifier(svn_wc_notify_func2_t *notify_func_p,
void **notify_baton_p,
- svn_boolean_t suppress_summary_lines,
apr_pool_t *pool)
{
struct notify_baton *nb = apr_pcalloc(pool, sizeof(*nb));
@@ -1026,7 +1020,6 @@ svn_cl__get_notifier(svn_wc_notify_func2
nb->is_checkout = FALSE;
nb->is_export = FALSE;
nb->is_wc_to_repos_copy = FALSE;
- nb->suppress_summary_lines = suppress_summary_lines;
nb->in_external = FALSE;
nb->had_print_error = FALSE;
nb->text_conflicts = 0;
Modified: subversion/branches/fs-py/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/propedit-cmd.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/fs-py/subversion/svn/propedit-cmd.c Mon Dec 19 18:49:34 2011
@@ -39,8 +39,6 @@
#include "svn_props.h"
#include "cl.h"
-#include "private/svn_wc_private.h"
-
#include "svn_private_config.h"
@@ -122,7 +120,7 @@ svn_cl__propedit(apr_getopt_t *os,
if (! propval)
{
- propval = svn_string_create("", pool);
+ propval = svn_string_create_empty(pool);
/* This is how we signify to svn_client_revprop_set2() that
we want it to check that the original value hasn't
changed, but that that original value was non-existent: */
@@ -239,7 +237,7 @@ svn_cl__propedit(apr_getopt_t *os,
/* Get the property value. */
propval = apr_hash_get(props, abspath_or_url, APR_HASH_KEY_STRING);
if (! propval)
- propval = svn_string_create("", subpool);
+ propval = svn_string_create_empty(subpool);
if (svn_path_is_url(target))
{
Modified: subversion/branches/fs-py/subversion/svn/proplist-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/proplist-cmd.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/proplist-cmd.c (original)
+++ subversion/branches/fs-py/subversion/svn/proplist-cmd.c Mon Dec 19 18:49:34 2011
@@ -112,6 +112,8 @@ svn_cl__proplist(apr_getopt_t *os,
svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
apr_array_header_t *targets;
+ apr_array_header_t *errors = apr_array_make(scratch_pool, 0,
+ sizeof(apr_status_t));
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
@@ -168,7 +170,6 @@ svn_cl__proplist(apr_getopt_t *os,
int i;
apr_pool_t *iterpool;
svn_proplist_receiver_t pl_receiver;
- svn_boolean_t had_errors = FALSE;
if (opt_state->xml)
{
@@ -190,7 +191,6 @@ svn_cl__proplist(apr_getopt_t *os,
proplist_baton_t pl_baton;
const char *truepath;
svn_opt_revision_t peg_revision;
- svn_boolean_t success;
svn_pool_clear(iterpool);
SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
@@ -209,13 +209,10 @@ svn_cl__proplist(apr_getopt_t *os,
opt_state->changelists,
pl_receiver, &pl_baton,
ctx, iterpool),
- &success, opt_state->quiet,
+ errors, opt_state->quiet,
SVN_ERR_UNVERSIONED_RESOURCE,
SVN_ERR_ENTRY_NOT_FOUND,
SVN_NO_ERROR));
-
- if (!success)
- had_errors = TRUE;
}
svn_pool_destroy(iterpool);
@@ -223,10 +220,29 @@ svn_cl__proplist(apr_getopt_t *os,
SVN_ERR(svn_cl__xml_print_footer("properties", scratch_pool));
/* Error out *after* we closed the XML element */
- if (had_errors)
- return svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("Could not display info for all targets "
- "because some targets don't exist"));
+ if (errors->nelts > 0)
+ {
+ svn_error_t *err;
+
+ err = svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL, NULL);
+ for (i = 0; i < errors->nelts; i++)
+ {
+ apr_status_t status = APR_ARRAY_IDX(errors, i, apr_status_t);
+
+ if (status == SVN_ERR_ENTRY_NOT_FOUND)
+ err = svn_error_quick_wrap(err,
+ _("Could not display properties "
+ "of all targets because some "
+ "targets don't exist"));
+ else if (status == SVN_ERR_UNVERSIONED_RESOURCE)
+ err = svn_error_quick_wrap(err,
+ _("Could not display properties "
+ "of all targets because some "
+ "targets are not versioned"));
+ }
+
+ return svn_error_trace(err);
+ }
}
return SVN_NO_ERROR;
Modified: subversion/branches/fs-py/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/props.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/props.c (original)
+++ subversion/branches/fs-py/subversion/svn/props.c Mon Dec 19 18:49:34 2011
@@ -156,7 +156,7 @@ svn_cl__print_xml_prop_hash(svn_stringbu
apr_hash_index_t *hi;
if (*outstr == NULL)
- *outstr = svn_stringbuf_create("", pool);
+ *outstr = svn_stringbuf_create_empty(pool);
for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi))
{
Modified: subversion/branches/fs-py/subversion/svn/relocate-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/relocate-cmd.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/relocate-cmd.c (original)
+++ subversion/branches/fs-py/subversion/svn/relocate-cmd.c Mon Dec 19 18:49:34 2011
@@ -50,7 +50,7 @@ svn_cl__relocate(apr_getopt_t *os,
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
svn_boolean_t ignore_externals = opt_state->ignore_externals;
apr_array_header_t *targets;
- const char *from = NULL, *to = NULL, *path;
+ const char *from, *to, *path;
/* We've got two different syntaxes to support:
Modified: subversion/branches/fs-py/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/status-cmd.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/status-cmd.c (original)
+++ subversion/branches/fs-py/subversion/svn/status-cmd.c Mon Dec 19 18:49:34 2011
@@ -50,6 +50,8 @@ struct status_baton
{
/* These fields all correspond to the ones in the
svn_cl__print_status() interface. */
+ const char *cwd_abspath;
+ svn_boolean_t suppress_externals_placeholders;
svn_boolean_t detailed;
svn_boolean_t show_last_committed;
svn_boolean_t skip_unrecognized;
@@ -106,7 +108,7 @@ print_conflict_stats(struct status_baton
static svn_error_t *
print_start_target_xml(const char *target, apr_pool_t *pool)
{
- svn_stringbuf_t *sb = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "target",
"path", target, NULL);
@@ -122,7 +124,7 @@ static svn_error_t *
print_finish_target_xml(svn_revnum_t repos_rev,
apr_pool_t *pool)
{
- svn_stringbuf_t *sb = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
if (SVN_IS_VALID_REVNUM(repos_rev))
{
@@ -149,9 +151,12 @@ print_status_normal_or_xml(void *baton,
struct status_baton *sb = baton;
if (sb->xml_mode)
- return svn_cl__print_status_xml(path, status, sb->ctx, pool);
+ return svn_cl__print_status_xml(sb->cwd_abspath, path, status,
+ sb->ctx, pool);
else
- return svn_cl__print_status(path, status, sb->detailed,
+ return svn_cl__print_status(sb->cwd_abspath, path, status,
+ sb->suppress_externals_placeholders,
+ sb->detailed,
sb->show_last_committed,
sb->skip_unrecognized,
sb->repos_locks,
@@ -298,6 +303,9 @@ svn_cl__status(apr_getopt_t *os,
"mode"));
}
+ SVN_ERR(svn_dirent_get_absolute(&(sb.cwd_abspath), "", scratch_pool));
+ sb.suppress_externals_placeholders = (opt_state->quiet
+ && (! opt_state->verbose));
sb.detailed = (opt_state->verbose || opt_state->update);
sb.show_last_committed = opt_state->verbose;
sb.skip_unrecognized = opt_state->quiet;
@@ -355,7 +363,7 @@ svn_cl__status(apr_getopt_t *os,
svn_stringbuf_t *buf;
if (opt_state->xml)
- buf = svn_stringbuf_create("", scratch_pool);
+ buf = svn_stringbuf_create_empty(scratch_pool);
for (hi = apr_hash_first(scratch_pool, master_cl_hash); hi;
hi = apr_hash_next(hi))
Modified: subversion/branches/fs-py/subversion/svn/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/status.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/status.c (original)
+++ subversion/branches/fs-py/subversion/svn/status.c Mon Dec 19 18:49:34 2011
@@ -187,7 +187,7 @@ make_relpath(const char *relative_to_pat
/* Print STATUS and PATH in a format determined by DETAILED and
SHOW_LAST_COMMITTED. */
static svn_error_t *
-print_status(const char *path,
+print_status(const char *cwd_abspath, const char *path,
svn_boolean_t detailed,
svn_boolean_t show_last_committed,
svn_boolean_t repos_locks,
@@ -205,6 +205,8 @@ print_status(const char *path,
const char *moved_from_line = "";
const char *moved_to_line = "";
+ path = make_relpath(cwd_abspath, path, pool, pool);
+
/* For historic reasons svn ignores the property status for added nodes, even
if these nodes were copied and have local property changes.
@@ -277,13 +279,12 @@ print_status(const char *path,
* move info for in 'svn status'. See also comments in svn_wc_status3_t. */
if (status->moved_from_abspath || status->moved_to_abspath)
{
- const char *cwd;
const char *relpath;
- SVN_ERR(svn_dirent_get_absolute(&cwd, "", pool));
if (status->moved_from_abspath)
{
- relpath = make_relpath(cwd, status->moved_from_abspath, pool, pool);
+ relpath = make_relpath(cwd_abspath, status->moved_from_abspath,
+ pool, pool);
relpath = svn_dirent_local_style(relpath, pool);
moved_from_line = apr_pstrcat(pool, "\n > ",
apr_psprintf(pool, _("moved from %s"),
@@ -293,7 +294,8 @@ print_status(const char *path,
if (status->moved_to_abspath)
{
- relpath = make_relpath(cwd, status->moved_to_abspath, pool, pool);
+ relpath = make_relpath(cwd_abspath, status->moved_to_abspath,
+ pool, pool);
relpath = svn_dirent_local_style(relpath, pool);
moved_to_line = apr_pstrcat(pool, "\n > ",
apr_psprintf(pool, _("moved to %s"),
@@ -419,12 +421,13 @@ print_status(const char *path,
svn_error_t *
-svn_cl__print_status_xml(const char *path,
+svn_cl__print_status_xml(const char *cwd_abspath,
+ const char *path,
const svn_client_status_t *status,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
- svn_stringbuf_t *sb = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
apr_hash_t *att_hash;
const char *local_abspath = status->local_abspath;
svn_boolean_t tree_conflicted = FALSE;
@@ -436,6 +439,8 @@ svn_cl__print_status_xml(const char *pat
SVN_ERR(svn_wc_conflicted_p3(NULL, NULL, &tree_conflicted,
ctx->wc_ctx, local_abspath, pool));
+ path = make_relpath(cwd_abspath, path, pool, pool);
+
svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "entry",
"path", svn_dirent_local_style(path, pool), NULL);
@@ -464,18 +469,19 @@ svn_cl__print_status_xml(const char *pat
"true");
if (status->moved_from_abspath || status->moved_to_abspath)
{
- const char *cwd;
const char *relpath;
- SVN_ERR(svn_dirent_get_absolute(&cwd, "", pool));
+
if (status->moved_from_abspath)
{
- relpath = make_relpath(cwd, status->moved_from_abspath, pool, pool);
+ relpath = make_relpath(cwd_abspath, status->moved_from_abspath,
+ pool, pool);
relpath = svn_dirent_local_style(relpath, pool);
apr_hash_set(att_hash, "moved-from", APR_HASH_KEY_STRING, relpath);
}
if (status->moved_to_abspath)
{
- relpath = make_relpath(cwd, status->moved_to_abspath, pool, pool);
+ relpath = make_relpath(cwd_abspath, status->moved_to_abspath,
+ pool, pool);
relpath = svn_dirent_local_style(relpath, pool);
apr_hash_set(att_hash, "moved-to", APR_HASH_KEY_STRING, relpath);
}
@@ -519,8 +525,10 @@ svn_cl__print_status_xml(const char *pat
/* Called by status-cmd.c */
svn_error_t *
-svn_cl__print_status(const char *path,
+svn_cl__print_status(const char *cwd_abspath,
+ const char *path,
const svn_client_status_t *status,
+ svn_boolean_t suppress_externals_placeholders,
svn_boolean_t detailed,
svn_boolean_t show_last_committed,
svn_boolean_t skip_unrecognized,
@@ -540,7 +548,33 @@ svn_cl__print_status(const char *path,
&& status->repos_node_status == svn_wc_status_none))
return SVN_NO_ERROR;
- return print_status(svn_dirent_local_style(path, pool),
+ /* If we're trying not to print boring "X /path/to/external"
+ lines..." */
+ if (suppress_externals_placeholders)
+ {
+ /* ... skip regular externals unmodified in the repository. */
+ if ((status->node_status == svn_wc_status_external)
+ && (status->repos_node_status == svn_wc_status_none)
+ && (! status->conflicted))
+ return SVN_NO_ERROR;
+
+ /* ... skip file externals that aren't modified locally or
+ remotely, changelisted, or locked (in either sense of the
+ word). */
+ if ((status->file_external)
+ && (status->repos_node_status == svn_wc_status_none)
+ && ((status->node_status == svn_wc_status_normal)
+ || (status->node_status == svn_wc_status_none))
+ && ((status->prop_status == svn_wc_status_normal)
+ || (status->prop_status == svn_wc_status_none))
+ && (! status->changelist)
+ && (! status->lock)
+ && (! status->wc_is_locked)
+ && (! status->conflicted))
+ return SVN_NO_ERROR;
+ }
+
+ return print_status(cwd_abspath, svn_dirent_local_style(path, pool),
detailed, show_last_committed, repos_locks, status,
text_conflicts, prop_conflicts, tree_conflicts,
ctx, pool);
Modified: subversion/branches/fs-py/subversion/svn/tree-conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/tree-conflicts.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/tree-conflicts.c (original)
+++ subversion/branches/fs-py/subversion/svn/tree-conflicts.c Mon Dec 19 18:49:34 2011
@@ -63,6 +63,7 @@ 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 }
};
@@ -78,6 +79,7 @@ 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/fs-py/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svn/util.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svn/util.c (original)
+++ subversion/branches/fs-py/subversion/svn/util.c Mon Dec 19 18:49:34 2011
@@ -326,7 +326,7 @@ svn_cl__edit_string_externally(svn_strin
SVN_ERR(svn_subst_translate_cstring2(contents->data, &translated,
APR_EOL_STR, FALSE,
NULL, FALSE, pool));
- translated_contents = svn_string_create("", pool);
+ translated_contents = svn_string_create_empty(pool);
if (encoding)
SVN_ERR(svn_utf_cstring_from_utf8_ex2(&translated_contents->data,
translated, encoding, pool));
@@ -737,7 +737,7 @@ svn_cl__get_log_message(const char **log
int i;
svn_stringbuf_t *tmp_message = svn_stringbuf_dup(default_msg, pool);
svn_error_t *err = SVN_NO_ERROR;
- svn_string_t *msg_string = svn_string_create("", pool);
+ svn_string_t *msg_string = svn_string_create_empty(pool);
for (i = 0; i < commit_items->nelts; i++)
{
@@ -876,7 +876,7 @@ svn_cl__get_log_message(const char **log
{
SVN_ERR(svn_io_remove_file2(lmb->tmpfile_left, FALSE, pool));
*tmp_file = lmb->tmpfile_left = NULL;
- message = svn_stringbuf_create("", pool);
+ message = svn_stringbuf_create_empty(pool);
}
/* If the user chooses anything else, the loop will
@@ -937,7 +937,7 @@ svn_cl__error_checked_fputs(const char *
svn_error_t *
svn_cl__try(svn_error_t *err,
- svn_boolean_t *success,
+ apr_array_header_t *errors_seen,
svn_boolean_t quiet,
...)
{
@@ -946,12 +946,27 @@ svn_cl__try(svn_error_t *err,
apr_status_t apr_err;
va_list ap;
- if (success)
- *success = FALSE;
-
va_start(ap, quiet);
while ((apr_err = va_arg(ap, apr_status_t)) != SVN_NO_ERROR)
{
+ if (errors_seen)
+ {
+ int i;
+ svn_boolean_t add = TRUE;
+
+ /* Don't report duplicate error codes. */
+ for (i = 0; i < errors_seen->nelts; i++)
+ {
+ if (APR_ARRAY_IDX(errors_seen, i,
+ apr_status_t) == err->apr_err)
+ {
+ add = FALSE;
+ break;
+ }
+ }
+ if (add)
+ APR_ARRAY_PUSH(errors_seen, apr_status_t) = err->apr_err;
+ }
if (err->apr_err == apr_err)
{
if (! quiet)
@@ -962,10 +977,6 @@ svn_cl__try(svn_error_t *err,
}
va_end(ap);
}
- else if (success)
- {
- *success = TRUE;
- }
return svn_error_trace(err);
}
@@ -1047,7 +1058,7 @@ svn_error_t *
svn_cl__xml_print_header(const char *tagname,
apr_pool_t *pool)
{
- svn_stringbuf_t *sb = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
/* <?xml version="1.0" encoding="UTF-8"?> */
svn_xml_make_header2(&sb, "UTF-8", pool);
@@ -1063,7 +1074,7 @@ svn_error_t *
svn_cl__xml_print_footer(const char *tagname,
apr_pool_t *pool)
{
- svn_stringbuf_t *sb = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool);
/* "</TAGNAME>" */
svn_xml_make_close_tag(&sb, pool, tagname);
@@ -1292,7 +1303,7 @@ svn_cl__indent_string(const char *str,
const char *indent,
apr_pool_t *pool)
{
- svn_stringbuf_t *out = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *out = svn_stringbuf_create_empty(pool);
const char *line;
while ((line = next_line(&str, pool)))
@@ -1347,10 +1358,14 @@ svn_cl__eat_peg_revisions(apr_array_head
for (i = 0; i < targets->nelts; i++)
{
const char *target = APR_ARRAY_IDX(targets, i, const char *);
- const char *true_target;
+ const char *true_target, *peg;
- SVN_ERR(svn_opt__split_arg_at_peg_revision(&true_target, NULL,
+ SVN_ERR(svn_opt__split_arg_at_peg_revision(&true_target, &peg,
target, pool));
+ if (peg[0] && peg[1])
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("'%s': a peg revision is not allowed here"),
+ target);
APR_ARRAY_PUSH(true_targets, const char *) = true_target;
}
@@ -1408,3 +1423,43 @@ svn_cl__local_style_skip_ancestor(const
return svn_dirent_local_style(relpath ? relpath : path, pool);
}
+
+/* Return a string of the form "PATH_OR_URL@REVISION". */
+static const char *
+path_for_display(const char *path_or_url,
+ const svn_opt_revision_t *revision,
+ apr_pool_t *pool)
+{
+ const char *rev_str = svn_opt__revision_to_string(revision, pool);
+
+ if (! svn_path_is_url(path_or_url))
+ path_or_url = svn_dirent_local_style(path_or_url, pool);
+ return apr_psprintf(pool, "%s@%s", path_or_url, rev_str);
+}
+
+svn_error_t *
+svn_cl__check_related_source_and_target(const char *path_or_url1,
+ const svn_opt_revision_t *revision1,
+ const char *path_or_url2,
+ const svn_opt_revision_t *revision2,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ const char *ancestor_url;
+ svn_revnum_t ancestor_rev;
+
+ SVN_ERR(svn_client__youngest_common_ancestor(
+ &ancestor_url, &ancestor_rev,
+ path_or_url1, revision1, path_or_url2, revision2,
+ ctx, pool, pool));
+
+ if (ancestor_url == NULL)
+ {
+ return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Source and target have no common ancestor: "
+ "'%s' and '%s'"),
+ path_for_display(path_or_url1, revision1, pool),
+ path_for_display(path_or_url2, revision2, pool));
+ }
+ return SVN_NO_ERROR;
+}
Modified: subversion/branches/fs-py/subversion/svnadmin/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnadmin/main.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnadmin/main.c (original)
+++ subversion/branches/fs-py/subversion/svnadmin/main.c Mon Dec 19 18:49:34 2011
@@ -208,7 +208,7 @@ static const apr_getopt_option_t options
N_("specify revision number ARG (or X:Y range)")},
{"incremental", svnadmin__incremental, 0,
- N_("dump incrementally")},
+ N_("dump or hotcopy incrementally")},
{"deltas", svnadmin__deltas, 0,
N_("use deltas in dump output")},
@@ -332,8 +332,10 @@ static const svn_opt_subcommand_desc2_t
{"hotcopy", subcommand_hotcopy, {0}, N_
("usage: svnadmin hotcopy REPOS_PATH NEW_REPOS_PATH\n\n"
- "Makes a hot copy of a repository.\n"),
- {svnadmin__clean_logs} },
+ "Makes a hot copy of a repository.\n"
+ "If --incremental is passed, data which already exists at the destination\n"
+ "is not copied again. Incremental mode is implemented for FSFS repositories.\n"),
+ {svnadmin__clean_logs, svnadmin__incremental} },
{"list-dblogs", subcommand_list_dblogs, {0}, N_
("usage: svnadmin list-dblogs REPOS_PATH\n\n"
@@ -352,8 +354,10 @@ static const svn_opt_subcommand_desc2_t
"Read a 'dumpfile'-formatted stream from stdin, committing\n"
"new revisions into the repository's filesystem. If the repository\n"
"was previously empty, its UUID will, by default, be changed to the\n"
- "one specified in the stream. Progress feedback is sent to stdout.\n"),
- {'q', svnadmin__ignore_uuid, svnadmin__force_uuid,
+ "one specified in the stream. Progress feedback is sent to stdout.\n"
+ "If --revision is specified, limit the loaded revisions to only those\n"
+ "in the dump stream whose revision numbers match the specified range.\n"),
+ {'q', 'r', svnadmin__ignore_uuid, svnadmin__force_uuid,
svnadmin__use_pre_commit_hook, svnadmin__use_post_commit_hook,
svnadmin__parent_dir, svnadmin__bypass_prop_validation, 'M'} },
@@ -790,6 +794,12 @@ repos_notify_handler(void *baton,
notify->old_revision));
return;
+ case svn_repos_notify_load_skipped_rev:
+ svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ _("<<< Skipped original revision %ld\n"),
+ notify->old_revision));
+ return;
+
case svn_repos_notify_load_normalized_mergeinfo:
svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
_(" removing '\\r' from %s ..."),
@@ -947,6 +957,32 @@ subcommand_help(apr_getopt_t *os, void *
}
+/* Set *REVNUM to the revision number of a numeric REV, or to
+ SVN_INVALID_REVNUM if REV is unspecified. */
+static svn_error_t *
+optrev_to_revnum(svn_revnum_t *revnum, const svn_opt_revision_t *opt_rev)
+{
+ if (opt_rev->kind == svn_opt_revision_number)
+ {
+ *revnum = opt_rev->value.number;
+ if (! SVN_IS_VALID_REVNUM(*revnum))
+ return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Invalid revision number (%ld) specified"),
+ *revnum);
+ }
+ else if (opt_rev->kind == svn_opt_revision_unspecified)
+ {
+ *revnum = SVN_INVALID_REVNUM;
+ }
+ else
+ {
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Non-numeric revision specified"));
+ }
+ return SVN_NO_ERROR;
+}
+
+
/* This implements `svn_opt_subcommand_t'. */
static svn_error_t *
subcommand_load(apr_getopt_t *os, void *baton, apr_pool_t *pool)
@@ -954,11 +990,34 @@ subcommand_load(apr_getopt_t *os, void *
svn_error_t *err;
struct svnadmin_opt_state *opt_state = baton;
svn_repos_t *repos;
+ svn_revnum_t lower = SVN_INVALID_REVNUM, upper = SVN_INVALID_REVNUM;
svn_stream_t *stdin_stream, *stdout_stream = NULL;
/* Expect no more arguments. */
SVN_ERR(parse_args(NULL, os, 0, 0, pool));
+ /* Find the revision numbers at which to start and end. We only
+ support a limited set of revision kinds: number and unspecified. */
+ SVN_ERR(optrev_to_revnum(&lower, &opt_state->start_revision));
+ SVN_ERR(optrev_to_revnum(&upper, &opt_state->end_revision));
+
+ /* Fill in implied revisions if necessary. */
+ if ((upper == SVN_INVALID_REVNUM) && (lower != SVN_INVALID_REVNUM))
+ {
+ upper = lower;
+ }
+ else if ((upper != SVN_INVALID_REVNUM) && (lower == SVN_INVALID_REVNUM))
+ {
+ lower = upper;
+ }
+
+ /* Ensure correct range ordering. */
+ if (lower > upper)
+ {
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("First revision cannot be higher than second"));
+ }
+
SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
/* Read the stream from STDIN. Users can redirect a file. */
@@ -968,7 +1027,7 @@ subcommand_load(apr_getopt_t *os, void *
if (! opt_state->quiet)
stdout_stream = recode_stream_create(stdout, pool);
- err = svn_repos_load_fs3(repos, stdin_stream,
+ err = svn_repos_load_fs4(repos, stdin_stream, lower, upper,
opt_state->uuid_action, opt_state->parent_dir,
opt_state->use_pre_commit_hook,
opt_state->use_post_commit_hook,
@@ -1197,7 +1256,7 @@ set_revprop(const char *prop_name, const
struct svnadmin_opt_state *opt_state, apr_pool_t *pool)
{
svn_repos_t *repos;
- svn_string_t *prop_value = svn_string_create("", pool);
+ svn_string_t *prop_value = svn_string_create_empty(pool);
svn_stringbuf_t *file_contents;
SVN_ERR(svn_stringbuf_from_file2(&file_contents, filename, pool));
@@ -1374,8 +1433,9 @@ subcommand_hotcopy(apr_getopt_t *os, voi
new_repos_path = APR_ARRAY_IDX(targets, 0, const char *);
SVN_ERR(target_arg_to_dirent(&new_repos_path, new_repos_path, pool));
- return svn_repos_hotcopy(opt_state->repository_path, new_repos_path,
- opt_state->clean_logs, pool);
+ return svn_repos_hotcopy2(opt_state->repository_path, new_repos_path,
+ opt_state->clean_logs, opt_state->incremental,
+ check_cancel, NULL, pool);
}
Modified: subversion/branches/fs-py/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svndumpfilter/main.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/fs-py/subversion/svndumpfilter/main.c Mon Dec 19 18:49:34 2011
@@ -271,7 +271,7 @@ new_revision_record(void **revision_bato
rb->has_props = FALSE;
rb->had_dropped_nodes = FALSE;
rb->writing_begun = FALSE;
- rb->header = svn_stringbuf_create("", pool);
+ rb->header = svn_stringbuf_create_empty(pool);
rb->props = apr_hash_make(pool);
header_stream = svn_stream_from_stringbuf(rb->header, pool);
@@ -322,7 +322,7 @@ output_revision(struct revision_baton_t
char buf[SVN_KEYLINE_MAXLEN];
apr_hash_index_t *hi;
apr_pool_t *hash_pool = apr_hash_pool_get(rb->props);
- svn_stringbuf_t *props = svn_stringbuf_create("", hash_pool);
+ svn_stringbuf_t *props = svn_stringbuf_create_empty(hash_pool);
apr_pool_t *subpool = svn_pool_create(hash_pool);
rb->writing_begun = TRUE;
@@ -551,8 +551,8 @@ new_node_record(void **node_baton,
nb->has_text = FALSE;
nb->writing_begun = FALSE;
nb->tcl = tcl ? svn__atoui64(tcl) : 0;
- nb->header = svn_stringbuf_create("", pool);
- nb->props = svn_stringbuf_create("", pool);
+ nb->header = svn_stringbuf_create_empty(pool);
+ nb->props = svn_stringbuf_create_empty(pool);
/* Now we know for sure that we have a node that will not be
skipped, flush the revision if it has not already been done. */
Modified: subversion/branches/fs-py/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnlook/main.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnlook/main.c (original)
+++ subversion/branches/fs-py/subversion/svnlook/main.c Mon Dec 19 18:49:34 2011
@@ -784,18 +784,25 @@ generate_label(const char **label,
If TOKEN is empty, or is already terminated by an EOL marker,
return TOKEN unmodified. Else, return a new string consisting
of the concatenation of TOKEN and the system's default EOL marker.
- The new string is allocated from POOL. */
+ The new string is allocated from POOL.
+ If HAD_EOL is not NULL, indicate in *HAD_EOL if the token had a EOL. */
static const svn_string_t *
-maybe_append_eol(const svn_string_t *token, apr_pool_t *pool)
+maybe_append_eol(const svn_string_t *token, svn_boolean_t *had_eol,
+ apr_pool_t *pool)
{
const char *curp;
+ if (had_eol)
+ *had_eol = FALSE;
+
if (token->len == 0)
return token;
curp = token->data + token->len - 1;
if (*curp == '\r')
{
+ if (had_eol)
+ *had_eol = TRUE;
return token;
}
else if (*curp != '\n')
@@ -804,6 +811,8 @@ maybe_append_eol(const svn_string_t *tok
}
else
{
+ if (had_eol)
+ *had_eol = TRUE;
return token;
}
}
@@ -860,19 +869,20 @@ display_prop_diffs(const apr_array_heade
const svn_string_t *tmp;
const svn_string_t *orig;
const svn_string_t *val;
+ svn_boolean_t val_has_eol;
SVN_ERR(svn_stream_for_stdout(&out, pool));
/* The last character in a property is often not a newline.
- Since the diff is not useful anyway for patching properties an
- eol character is appended when needed to remove those pescious
- ' \ No newline at end of file' lines. */
- tmp = orig_value ? orig_value : svn_string_create("", pool);
- orig = maybe_append_eol(tmp, pool);
+ An eol character is appended to prevent the diff API to add a
+ ' \ No newline at end of file' line. We add
+ ' \ No newline at end of property' manually if needed. */
+ tmp = orig_value ? orig_value : svn_string_create_empty(pool);
+ orig = maybe_append_eol(tmp, NULL, pool);
tmp = pc->value ? pc->value :
- svn_string_create("", pool);
- val = maybe_append_eol(tmp, pool);
+ svn_string_create_empty(pool);
+ val = maybe_append_eol(tmp, &val_has_eol, pool);
SVN_ERR(svn_diff_mem_string_diff(&diff, orig, val, &options, pool));
@@ -888,6 +898,12 @@ display_prop_diffs(const apr_array_heade
svn_dirent_local_style(path, pool),
svn_cmdline_output_encoding(pool),
orig, val, pool));
+ if (!val_has_eol)
+ {
+ const char *s = "\\ No newline at end of property" APR_EOL_STR;
+ apr_size_t len = strlen(s);
+ SVN_ERR(svn_stream_write(out, s, &len));
+ }
}
}
return svn_cmdline_fflush(stdout);
@@ -921,7 +937,7 @@ print_diff_tree(svn_fs_root_t *root,
if (! node)
return SVN_NO_ERROR;
- header = svn_stringbuf_create("", pool);
+ header = svn_stringbuf_create_empty(pool);
/* Print copyfrom history for the top node of a copied tree. */
if ((SVN_IS_VALID_REVNUM(node->copyfrom_rev))
Modified: subversion/branches/fs-py/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnrdump/dump_editor.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/fs-py/subversion/svnrdump/dump_editor.c Mon Dec 19 18:49:34 2011
@@ -383,7 +383,7 @@ open_root(void *edit_baton,
eb->props = apr_hash_make(eb->pool);
eb->deleted_props = apr_hash_make(eb->pool);
- eb->propstring = svn_stringbuf_create("", eb->pool);
+ eb->propstring = svn_stringbuf_create_empty(eb->pool);
*root_baton = make_dir_baton(NULL, NULL, SVN_INVALID_REVNUM,
edit_baton, NULL, FALSE, eb->pool);
@@ -856,6 +856,8 @@ svn_rdump__get_dump_editor(const svn_del
{
struct dump_edit_baton *eb;
svn_delta_editor_t *de;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
eb = apr_pcalloc(pool, sizeof(struct dump_edit_baton));
eb->stream = stream;
@@ -892,7 +894,7 @@ svn_rdump__get_dump_editor(const svn_del
de, eb, editor, edit_baton, pool));
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- NULL, NULL, NULL, NULL, pool, pool));
+ shim_callbacks, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/fs-py/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnrdump/load_editor.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/fs-py/subversion/svnrdump/load_editor.c Mon Dec 19 18:49:34 2011
@@ -312,8 +312,8 @@ renumber_mergeinfo_revs(svn_string_t **f
if (predates_stream_mergeinfo)
{
- SVN_ERR(svn_mergeinfo_merge(final_mergeinfo, predates_stream_mergeinfo,
- subpool));
+ SVN_ERR(svn_mergeinfo_merge2(final_mergeinfo, predates_stream_mergeinfo,
+ subpool, subpool));
}
SVN_ERR(svn_mergeinfo_sort(final_mergeinfo, subpool));
Modified: subversion/branches/fs-py/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnrdump/svnrdump.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/fs-py/subversion/svnrdump/svnrdump.c Mon Dec 19 18:49:34 2011
@@ -80,7 +80,7 @@ enum svn_svnrdump__longopt_t
opt_non_interactive,
opt_incremental,
opt_trust_server_cert,
- opt_version,
+ opt_version
};
#define SVN_SVNRDUMP__BASE_OPTIONS opt_config_dir, \
@@ -311,7 +311,7 @@ dump_revision_header(svn_ra_session_t *s
": %ld\n", revision));
prophash = apr_hash_make(pool);
- propstring = svn_stringbuf_create("", pool);
+ propstring = svn_stringbuf_create_empty(pool);
SVN_ERR(svn_ra_rev_proplist(session, revision, &prophash, pool));
propstream = svn_stream_from_stringbuf(propstring, pool);
Modified: subversion/branches/fs-py/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnserve/serve.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnserve/serve.c (original)
+++ subversion/branches/fs-py/subversion/svnserve/serve.c Mon Dec 19 18:49:34 2011
@@ -243,6 +243,7 @@ svn_error_t *load_configs(svn_config_t *
*pwdb = NULL;
if (pwdb_path)
{
+ pwdb_path = svn_dirent_canonicalize(pwdb_path, pool);
pwdb_path = svn_dirent_join(base, pwdb_path, pool);
err = svn_config_read2(pwdb, pwdb_path, TRUE, FALSE, pool);
@@ -290,6 +291,7 @@ svn_error_t *load_configs(svn_config_t *
{
const char *case_force_val;
+ authzdb_path = svn_dirent_canonicalize(authzdb_path, pool);
authzdb_path = svn_dirent_join(base, authzdb_path, pool);
err = svn_repos_authz_read(authzdb, authzdb_path, TRUE, pool);
if (err)
@@ -3072,7 +3074,7 @@ svn_error_t *serve(svn_ra_svn_conn_t *co
apr_array_header_t *caplist, *cap_words;
server_baton_t b;
fs_warning_baton_t warn_baton;
- svn_stringbuf_t *cap_log = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *cap_log = svn_stringbuf_create_empty(pool);
b.tunnel = params->tunnel;
b.tunnel_user = get_tunnel_user(params, pool);
Modified: subversion/branches/fs-py/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnsync/main.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnsync/main.c (original)
+++ subversion/branches/fs-py/subversion/svnsync/main.c Mon Dec 19 18:49:34 2011
@@ -67,7 +67,7 @@ enum svnsync__opt {
svnsync_opt_version,
svnsync_opt_trust_server_cert,
svnsync_opt_allow_non_empty,
- svnsync_opt_steal_lock,
+ svnsync_opt_steal_lock
};
#define SVNSYNC_OPTS_DEFAULT svnsync_opt_non_interactive, \
@@ -760,7 +760,7 @@ do_initialize(svn_ra_session_t *to_sessi
/* If we're doing a partial replay, we have to check first if the server
supports this. */
- if (svn_uri__is_child(root_url, baton->from_url, pool))
+ if (strcmp(root_url, baton->from_url) != 0)
{
svn_boolean_t server_supports_partial_replay;
svn_error_t *err = svn_ra_has_capability(from_session,
@@ -1051,6 +1051,8 @@ replay_rev_started(svn_revnum_t revision
apr_hash_t *filtered;
int filtered_count;
int normalized_count;
+ svn_delta_shim_callbacks_t *shim_callbacks =
+ svn_delta_shim_callbacks_default(pool);
/* We set this property so that if we error out for some reason
we can later determine where we were in the process of
@@ -1087,7 +1089,7 @@ replay_rev_started(svn_revnum_t revision
replay_rev_finished callback. */
if (! apr_hash_get(filtered, SVN_PROP_REVISION_LOG, APR_HASH_KEY_STRING))
apr_hash_set(filtered, SVN_PROP_REVISION_LOG, APR_HASH_KEY_STRING,
- svn_string_create("", pool));
+ svn_string_create_empty(pool));
/* If necessary, normalize encoding and line ending style. Add the number
of properties that required EOL normalization to the overall count
@@ -1119,7 +1121,7 @@ replay_rev_started(svn_revnum_t revision
*edit_baton = cancel_baton;
SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
- NULL, NULL, NULL, NULL, pool, pool));
+ shim_callbacks, pool, pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/fs-py/subversion/svnsync/sync.c
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/svnsync/sync.c?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/svnsync/sync.c (original)
+++ subversion/branches/fs-py/subversion/svnsync/sync.c Mon Dec 19 18:49:34 2011
@@ -33,9 +33,6 @@
#include "svn_subst.h"
#include "svn_string.h"
-#include "private/svn_opt_private.h"
-#include "private/svn_cmdline_private.h"
-
#include "sync.h"
#include "svn_private_config.h"
@@ -461,7 +458,7 @@ change_dir_prop(void *dir_baton,
are relative URLs, whereas svn:mergeinfo uses relative
paths (not URI-encoded). */
svn_error_t *err;
- svn_stringbuf_t *mergeinfo_buf = svn_stringbuf_create("", pool);
+ svn_stringbuf_t *mergeinfo_buf = svn_stringbuf_create_empty(pool);
svn_mergeinfo_t mergeinfo;
int i;
apr_array_header_t *sources =
Modified: subversion/branches/fs-py/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/authz_tests.py?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/authz_tests.py Mon Dec 19 18:49:34 2011
@@ -33,6 +33,9 @@ import svntest
from svntest.main import write_restrictive_svnserve_conf
from svntest.main import write_authz_file
from svntest.main import server_authz_has_aliases
+from upgrade_tests import (replace_sbox_with_tarfile,
+ replace_sbox_repo_with_tarfile,
+ wc_is_too_old_regex)
# (abbreviation)
Item = svntest.wc.StateItem
@@ -1354,6 +1357,41 @@ def wc_commit_error_handling(sbox):
'ci', wc_dir, '-m', '')
+@Skip(svntest.main.is_ra_type_file)
+def upgrade_absent(sbox):
+ "upgrade absent nodes to server-excluded"
+
+ # Install wc and repos
+ replace_sbox_with_tarfile(sbox, 'upgrade_absent.tar.bz2')
+ replace_sbox_repo_with_tarfile(sbox, 'upgrade_absent_repos.tar.bz2')
+
+ # Update config for authz
+ svntest.main.write_restrictive_svnserve_conf(sbox.repo_dir)
+ svntest.main.write_authz_file(sbox, { "/" : "*=rw",
+ "/A/B" : "*=",
+ "/A/B/E" : "jrandom = rw"})
+
+ # Attempt to use the working copy, this should give an error
+ expected_stderr = wc_is_too_old_regex
+ svntest.actions.run_and_verify_svn(None, None, expected_stderr,
+ 'info', sbox.wc_dir)
+
+ # Now upgrade the working copy
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'upgrade', sbox.wc_dir)
+
+ # Relocate to allow finding the repository
+ svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
+ 'svn://127.0.0.1/authz_tests-2',
+ sbox.repo_url, sbox.wc_dir)
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ })
+
+ # Expect no changes and certainly no errors
+ svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output,
+ None, None)
+
########################################################################
# Run the tests
@@ -1382,6 +1420,7 @@ test_list = [ None,
authz_tree_conflict,
wc_delete,
wc_commit_error_handling,
+ upgrade_absent,
]
serial_only = True
Modified: subversion/branches/fs-py/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/basic_tests.py?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/basic_tests.py Mon Dec 19 18:49:34 2011
@@ -999,6 +999,7 @@ def verify_dir_deleted(path):
return 1
+@Issue(687,4074)
def basic_delete(sbox):
"basic delete command"
@@ -1190,6 +1191,12 @@ def basic_delete(sbox):
'rm', '-m', 'delete iota URL',
iota_URL)
+ # Issue 4074, deleting a root url SEGV.
+ expected_error = 'svn: E170000: .*not within a repository'
+ svntest.actions.run_and_verify_svn(None, [], expected_error,
+ 'rm', sbox.repo_url,
+ '--message', 'delete root')
+
#----------------------------------------------------------------------
def basic_checkout_deleted(sbox):
@@ -1614,6 +1621,12 @@ def basic_add_parents(sbox):
None,
wc_dir)
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'rm', X_path, '--keep-local')
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'add', '--parents', zeta_path)
+
#----------------------------------------------------------------------
def uri_syntax(sbox):
'make sure URI syntaxes are parsed correctly'
@@ -2815,6 +2828,63 @@ def add_multiple_targets(sbox):
'status', wc_dir)
+def quiet_commits(sbox):
+ "commits with --quiet"
+
+ sbox.build()
+
+ svntest.main.file_append(sbox.ospath('A/mu'), 'xxx')
+
+ svntest.actions.run_and_verify_svn(None, [], [],
+ 'commit', sbox.wc_dir,
+ '--message', 'commit', '--quiet')
+
+ svntest.actions.run_and_verify_svn(None, [], [],
+ 'mkdir', sbox.repo_url + '/X',
+ '--message', 'mkdir URL', '--quiet')
+
+ svntest.actions.run_and_verify_svn(None, [], [],
+ 'import', sbox.ospath('A/mu'),
+ sbox.repo_url + '/f',
+ '--message', 'import', '--quiet')
+
+ svntest.actions.run_and_verify_svn(None, [], [],
+ 'rm', sbox.repo_url + '/f',
+ '--message', 'rm URL', '--quiet')
+
+ svntest.actions.run_and_verify_svn(None, [], [],
+ 'copy', sbox.repo_url + '/X',
+ sbox.repo_url + '/Y',
+ '--message', 'cp URL URL', '--quiet')
+
+ svntest.actions.run_and_verify_svn(None, [], [],
+ 'move', sbox.repo_url + '/Y',
+ sbox.repo_url + '/Z',
+ '--message', 'mv URL URL', '--quiet')
+
+ # Not fully testing each command, just that they all commit and
+ # produce no output.
+ expected_output = wc.State(sbox.wc_dir, {
+ 'X' : Item(status='A '),
+ 'Z' : Item(status='A '),
+ })
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 7)
+ expected_status.add({
+ 'X' : Item(status=' ', wc_rev=7),
+ 'Z' : Item(status=' ', wc_rev=7),
+ })
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.tweak('A/mu',
+ contents=expected_disk.desc['A/mu'].contents
+ + 'xxx')
+ expected_disk.add({
+ 'X' : Item(),
+ 'Z' : Item()
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status)
########################################################################
# Run the tests
@@ -2879,6 +2949,7 @@ test_list = [ None,
ls_url_special_characters,
ls_multiple_and_non_existent_targets,
add_multiple_targets,
+ quiet_commits,
]
if __name__ == '__main__':
Modified: subversion/branches/fs-py/subversion/tests/cmdline/cat_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/cat_tests.py?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/cat_tests.py (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/cat_tests.py Mon Dec 19 18:49:34 2011
@@ -159,8 +159,7 @@ def cat_skip_uncattable(sbox):
'cat', rho_path, new_file_path)
expected_err3 = expected_err1 + expected_err2 + \
- ".*svn: E200009: Could not cat all targets because some targets " + \
- "don't exist\n"
+ ".*svn: E200009: Could not cat all targets because some targets"
expected_err_re = re.compile(expected_err3, re.DOTALL)
exit_code, output, error = svntest.main.run_svn(1, 'cat', rho_path, G_path, new_file_path)
Modified: subversion/branches/fs-py/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/commit_tests.py?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/commit_tests.py Mon Dec 19 18:49:34 2011
@@ -2803,6 +2803,63 @@ def commit_multiple_nested_deletes(sbox)
svntest.main.run_svn(None, 'ci', A, A_B, '-m', 'Q')
+@Issue(4042)
+def commit_incomplete(sbox):
+ "commit an incomplete dir"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ sbox.simple_propset('pname', 'pval', 'A/B')
+ svntest.actions.set_incomplete(sbox.ospath('A/B'), 1)
+
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B' : Item(verb='Sending'),
+ })
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/B', status='! ', wc_rev=2)
+
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status,
+ None,
+ wc_dir)
+
+#----------------------------------------------------------------------
+# Reported here:
+# Message-ID: <4E...@gmail.com>
+# Date: Sun, 13 Nov 2011 13:31:05 +1300
+# From: Fergus Slorach <su...@gmail.com>
+# Subject: svn commit --targets behaviour change in 1.7?
+@Issue(4059)
+@XFail()
+def commit_add_subadd(sbox):
+ "committing add with explicit subadd targets"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ A_path = os.path.join(wc_dir, 'A')
+ A2_path = os.path.join(wc_dir, 'A2')
+
+ targets_file = sbox.ospath('targets') # ### better tempdir?
+ targets_file = os.path.abspath(targets_file)
+
+ # prepare targets file
+ targets = "A2/D A2/D/H A2/D/H/chi A2/D/H/omega A2/D/H/psi".split()
+ open(targets_file, 'w').write("\n".join(targets))
+
+ # r2: add some stuff, with specific invocation
+ import shutil
+ shutil.copytree(A_path, A2_path)
+
+ # hack to copy A to A2, without creating .svn dirs when running against 1.6
+ svntest.main.run_svn(None, 'cp', A_path, A2_path)
+ svntest.main.run_svn(None, 'revert', '-R', A2_path)
+
+ os.chdir(wc_dir)
+ svntest.main.run_svn(None, 'commit', '--targets', targets_file, '-mm')
+
########################################################################
# Run the tests
@@ -2871,6 +2928,8 @@ test_list = [ None,
tree_conflicts_block_commit,
tree_conflicts_resolved,
commit_multiple_nested_deletes,
+ commit_incomplete,
+ commit_add_subadd,
]
if __name__ == '__main__':
Modified: subversion/branches/fs-py/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/copy_tests.py?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/copy_tests.py Mon Dec 19 18:49:34 2011
@@ -3444,11 +3444,12 @@ def copy_peg_rev_url(sbox):
wc_dir)
# Copy using a peg rev
- # Add peg rev '@HEAD' to sigma_url when copying which tests for issue #3651.
+ # Add an empty peg specifier ('@') to sigma_url when copying, to test for
+ # issue #3651 "svn copy does not eat peg revision within copy target path".
svntest.actions.run_and_verify_svn(None, None, [],
'cp',
iota_url + '@HEAD', '-r', '1',
- sigma_url + '@HEAD', '-m', 'rev 3')
+ sigma_url + '@', '-m', 'rev 3')
# Validate the copy destination's mergeinfo (we expect none).
svntest.actions.run_and_verify_svn(None, [], [],
@@ -4653,9 +4654,15 @@ def changed_dir_data_should_match_checko
os.chdir(was_cwd)
os.chdir(wc_dir)
- svntest.actions.run_and_verify_svn(None, verify_out, [], 'status', '-v')
+ rv, verify_out2, err = main.run_svn (None, 'status', '-v')
os.chdir(was_cwd)
+ # The order of the status output is not absolutely defined, but
+ # otherwise should match
+ svntest.verify.verify_outputs(None,
+ sorted(verify_out2), None,
+ sorted(verify_out), None)
+
def move_added_nodes(sbox):
"""move added nodes"""
@@ -5545,6 +5552,122 @@ def commit_deleted_half_of_move(sbox):
svntest.actions.run_and_verify_svn(None, None, expected_error,
'commit', '-m', 'foo', A_path)
+@Issue(4026)
+def wc_wc_copy_incomplete(sbox):
+ "wc-to-wc copy of an incomplete directory"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # We don't know whether copy will do E or F first, so make both
+ # incomplete
+ svntest.actions.set_incomplete(sbox.ospath('A/B/E'), 1)
+ svntest.actions.set_incomplete(sbox.ospath('A/B/F'), 1)
+
+ # Copy fails with no changes to wc
+ svntest.actions.run_and_verify_svn(None, None,
+ 'svn: E155035: Cannot handle status',
+ 'copy',
+ sbox.ospath('A/B/E'),
+ sbox.ospath('A/B/E2'))
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/B/E', 'A/B/F', status='! ')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Copy fails part way through
+ svntest.actions.run_and_verify_svn(None, None,
+ 'svn: E155035: Cannot handle status',
+ 'copy',
+ sbox.ospath('A/B'),
+ sbox.ospath('A/B2'))
+
+ expected_status.add({
+ 'A/B2' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/B2/E' : Item(status='! ', wc_rev='-'),
+ 'A/B2/F' : Item(status='! ', wc_rev='-'),
+ 'A/B2/lambda' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+ ### Can't get this to work as copied status of E and F in 1.6
+ ### entries tree doesn't match 1.7 status tree
+ #svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Commit preserves incomplete status
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B2': Item(verb='Adding'),
+ })
+ expected_status.tweak('A/B2', 'A/B2/lambda',
+ status=' ', copied=None, wc_rev=2)
+ expected_status.tweak('A/B2/E', 'A/B2/F',
+ status='! ', copied=None, wc_rev=2)
+ ### E and F are status '!' but the test code ignores them?
+ expected_status.remove('A/B2/E', 'A/B2/F')
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status,
+ None, wc_dir)
+ expected_status.add({
+ 'A/B2/E' : Item(status='! ', wc_rev=2),
+ 'A/B2/F' : Item(status='! ', wc_rev=2),
+ })
+
+ # Update makes things complete
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B2/E' : Item(status='A '),
+ 'A/B2/E/alpha' : Item(status='A '),
+ 'A/B2/E/beta' : Item(status='A '),
+ 'A/B2/F' : Item(status='A '),
+ })
+ expected_status.tweak(wc_rev=2, status=' ')
+ expected_status.add({
+ 'A/B2/E/alpha' : Item(status=' ', wc_rev=2),
+ 'A/B2/E/beta' : Item(status=' ', wc_rev=2),
+ })
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output,
+ None,
+ expected_status)
+
+def three_nested_moves(sbox):
+ "three nested moves"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+ sbox.ospath('A/B'),
+ sbox.ospath('A/B2'))
+ svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+ sbox.ospath('A/B2/E'),
+ sbox.ospath('A/B2/E2'))
+ svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+ sbox.ospath('A/B2/E2/alpha'),
+ sbox.ospath('A/B2/E2/alpha2'))
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.add({
+ 'A/B2' : Item(status=' ', wc_rev=2),
+ 'A/B2/E2' : Item(status=' ', wc_rev=2),
+ 'A/B2/E2/alpha2' : Item(status=' ', wc_rev=2),
+ 'A/B2/E2/beta' : Item(status=' ', wc_rev=2),
+ 'A/B2/F' : Item(status=' ', wc_rev=2),
+ 'A/B2/lambda' : Item(status=' ', wc_rev=2),
+ })
+ expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+ 'A/B/F', 'A/B/lambda')
+ expected_output = svntest.wc.State(wc_dir, {
+ 'A/B' : Item(verb='Deleting'),
+ 'A/B2' : Item(verb='Adding'),
+ 'A/B2/E' : Item(verb='Deleting'),
+ 'A/B2/E2' : Item(verb='Adding'),
+ 'A/B2/E2/alpha' : Item(verb='Deleting'),
+ 'A/B2/E2/alpha2' : Item(verb='Adding'),
+ })
+
+ svntest.actions.run_and_verify_commit(wc_dir,
+ expected_output,
+ expected_status,
+ None, wc_dir)
+
########################################################################
# Run the tests
@@ -5657,6 +5780,8 @@ test_list = [ None,
copy_deleted_dir,
commit_copied_half_of_move,
commit_deleted_half_of_move,
+ wc_wc_copy_incomplete,
+ three_nested_moves,
]
if __name__ == '__main__':
Modified: subversion/branches/fs-py/subversion/tests/cmdline/dav-mirror-autocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/dav-mirror-autocheck.sh?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/dav-mirror-autocheck.sh (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/dav-mirror-autocheck.sh Mon Dec 19 18:49:34 2011
@@ -323,7 +323,7 @@ fi
[ -r "$MOD_AUTHZ_SVN" ] \
|| fail "authz_svn_module not found, please use '--enable-shared --enable-dso --with-apxs' with your 'configure' script"
-export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs"
+export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
MASTER_REPOS="${MASTER_REPOS:-"$HTTPD_ROOT/master_repos"}"
SLAVE_REPOS="${SLAVE_REPOS:-"$HTTPD_ROOT/slave_repos"}"
Modified: subversion/branches/fs-py/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/davautocheck.sh?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/davautocheck.sh Mon Dec 19 18:49:34 2011
@@ -195,7 +195,7 @@ fi
[ -r "$MOD_AUTHZ_SVN" ] \
|| fail "authz_svn_module not found, please use '--enable-shared --enable-dso --with-apxs' with your 'configure' script"
-export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs"
+export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
case "`uname`" in
Darwin*) LDD='otool -L'
Modified: subversion/branches/fs-py/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/depth_tests.py?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/depth_tests.py Mon Dec 19 18:49:34 2011
@@ -1076,7 +1076,8 @@ def diff_in_depthy_wc(sbox):
"___________________________________________________________________\n",
"Deleted: foo\n",
"## -1 +0,0 ##\n",
- "-foo-val\n"]
+ "-foo-val\n",
+ "\\ No newline at end of property\n"]
os.chdir(wc_empty)
@@ -2811,6 +2812,35 @@ def sparse_update_with_dash_dash_parents
None, None, None, None, None, False,
'--parents', omega_path)
+def update_below_depth_empty(sbox):
+ "update below depth empty shouldn't be applied"
+ sbox.build()
+
+ repo_url = sbox.repo_url
+ A = sbox.ospath('A')
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A/C' : Item(status='D '),
+ 'A/B' : Item(status='D '),
+ 'A/mu' : Item(status='D '),
+ 'A/D' : Item(status='D '),
+ })
+ svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output, None,
+ None, None, None, None, None, None,
+ False,
+ '--set-depth', 'empty', A)
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'cp', repo_url + '/iota',
+ repo_url + '/A/B',
+ '-m', 'remote copy')
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ })
+
+ # This update should just update the revision of the working copy
+ svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output, None,
+ None, None)
#----------------------------------------------------------------------
# list all tests here, starting with None:
@@ -2858,6 +2888,7 @@ test_list = [ None,
update_excluded_path_sticky_depths,
update_depth_empty_root_of_infinite_children,
sparse_update_with_dash_dash_parents,
+ update_below_depth_empty,
]
if __name__ == "__main__":
Modified: subversion/branches/fs-py/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fs-py/subversion/tests/cmdline/diff_tests.py?rev=1220893&r1=1220892&r2=1220893&view=diff
==============================================================================
--- subversion/branches/fs-py/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/fs-py/subversion/tests/cmdline/diff_tests.py Mon Dec 19 18:49:34 2011
@@ -57,6 +57,16 @@ def make_diff_header(path, old_tag, new_
"+++ " + path_as_shown + "\t(" + new_tag + ")\n",
]
+def make_no_diff_deleted_header(path, old_tag, new_tag):
+ """Generate the expected diff header for a deleted file PATH when in
+ 'no-diff-deleted' mode. (In that mode, no further details appear after the
+ header.) Return the header as an array of newline-terminated strings."""
+ path_as_shown = path.replace('\\', '/')
+ return [
+ "Index: " + path_as_shown + " (deleted)\n",
+ "===================================================================\n",
+ ]
+
def make_git_diff_header(target_path, repos_relpath,
old_tag, new_tag, add=False, src_label=None,
dst_label=None, delete=False, text_changes=True,
@@ -146,15 +156,20 @@ def make_diff_prop_header(path):
"___________________________________________________________________\n"
]
+def make_diff_prop_val(plus_minus, pval):
+ "Return diff for prop value PVAL, with leading PLUS_MINUS (+ or -)."
+ if len(pval) > 0 and pval[-1] != '\n':
+ return [plus_minus + pval + "\n","\\ No newline at end of property\n"]
+ return [plus_minus + pval]
+
def make_diff_prop_deleted(pname, pval):
"""Return a property diff for deletion of property PNAME, old value PVAL.
PVAL is a single string with no embedded newlines. Return the result
as a list of newline-terminated strings."""
return [
"Deleted: " + pname + "\n",
- "## -1 +0,0 ##\n",
- "-" + pval + "\n"
- ]
+ "## -1 +0,0 ##\n"
+ ] + make_diff_prop_val("-", pval)
def make_diff_prop_added(pname, pval):
"""Return a property diff for addition of property PNAME, new value PVAL.
@@ -163,8 +178,7 @@ def make_diff_prop_added(pname, pval):
return [
"Added: " + pname + "\n",
"## -0,0 +1 ##\n",
- "+" + pval + "\n"
- ]
+ ] + make_diff_prop_val("+", pval)
def make_diff_prop_modified(pname, pval1, pval2):
"""Return a property diff for modification of property PNAME, old value
@@ -173,9 +187,7 @@ def make_diff_prop_modified(pname, pval1
return [
"Modified: " + pname + "\n",
"## -1 +1 ##\n",
- "-" + pval1 + "\n",
- "+" + pval2 + "\n"
- ]
+ ] + make_diff_prop_val("-", pval1) + make_diff_prop_val("+", pval2)
######################################################################
# Diff output checker
@@ -1218,6 +1230,7 @@ def diff_deleted_in_head(sbox):
#----------------------------------------------------------------------
+@Issue(2873)
def diff_targets(sbox):
"select diff targets"
@@ -1263,30 +1276,20 @@ def diff_targets(sbox):
update_path,
add_path)
- regex = 'svn: E195012: Unable to find repository location for \'.*\''
- for line in err_output:
- if re.match(regex, line):
- break
- else:
+ if check_update_a_file(diff_output) or check_add_a_file(diff_output):
raise svntest.Failure
exit_code, diff_output, err_output = svntest.main.run_svn(1,
'diff', '-r1:2',
add_path)
- for line in err_output:
- if re.match(regex, line):
- break
- else:
+
+ if not check_update_a_file(diff_output) or check_add_a_file(diff_output):
raise svntest.Failure
exit_code, diff_output, err_output = svntest.main.run_svn(
1, 'diff', '-r1:2', '--old', parent_path, 'alpha', 'theta')
- regex = 'svn: E160013: \'.*\' was not found in the repository'
- for line in err_output:
- if re.match(regex, line):
- break
- else:
+ if check_update_a_file(diff_output) or check_add_a_file(diff_output):
raise svntest.Failure
exit_code, diff_output, err_output = svntest.main.run_svn(
@@ -2863,18 +2866,18 @@ def diff_with_depth(sbox):
A_header = make_diff_header('A', "revision 1", "working copy")
B_header = make_diff_header(B_path, "revision 1", "working copy")
- expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
- expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
- + iota_header + diff[7:12])
- expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:7])
+ expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+ + iota_header + diff[8:14])
+ expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+ iota_header
- + diff[7:12]
- + A_header + diff[8:18])
- expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ + diff[8:14]
+ + A_header + diff[15:21])
+ expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+ iota_header
- + diff[7:12]
- + A_header + diff[8:18]
- + B_header + diff[12:])
+ + diff[8:14]
+ + A_header + diff[15:21]
+ + B_header + diff[22:])
os.chdir(sbox.wc_dir)
@@ -2910,18 +2913,18 @@ def diff_with_depth(sbox):
A_header = make_diff_header('A', "revision 1", "revision 2")
B_header = make_diff_header(B_path, "revision 1", "revision 2")
- expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
- expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
- + iota_header + diff[7:12])
- expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:7])
+ expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+ + iota_header + diff[8:14])
+ expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+ iota_header
- + diff[7:12]
- + A_header + diff[8:18])
+ + diff[8:14]
+ + A_header + diff[15:21])
expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+ iota_header
- + diff[7:12]
- + A_header + diff[8:18]
- + B_header + diff[12:])
+ + diff[8:14]
+ + A_header + diff[15:21]
+ + B_header + diff[22:])
# Test repos-repos diff.
svntest.actions.run_and_verify_svn(None, expected_empty, [],
@@ -2954,10 +2957,10 @@ def diff_with_depth(sbox):
make_diff_prop_header(".") + \
make_diff_prop_modified("foo1", "bar1", "baz1")
- expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[43:])
- expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[29:])
- expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[11:22]
- +diff_wc_repos[29:])
+ expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[49:])
+ expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[33:])
+ expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[13:26]
+ +diff_wc_repos[33:])
expected_infinity = svntest.verify.UnorderedOutput(diff_wc_repos[:])
svntest.actions.run_and_verify_svn(None, None, [],