You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2014/04/30 01:36:46 UTC
svn commit: r1591144 [4/5] - in /subversion/branches/1.8.x-r1536931: ./
build/ build/ac-macros/ build/generator/ subversion/bindings/javahl/native/
subversion/bindings/swig/ subversion/bindings/swig/perl/native/
subversion/bindings/swig/ruby/libsvn_swi...
Modified: subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/repos.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/repos.c Tue Apr 29 23:36:43 2014
@@ -1790,14 +1790,97 @@ do_out_of_date_check(dav_resource_combin
"Could not get created rev of "
"resource", r->pool);
- if (comb->priv.version_name < created_rev)
+ if (SVN_IS_VALID_REVNUM(created_rev))
{
- serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL,
- "Item '%s' is out of date",
- comb->priv.repos_path);
- return dav_svn__convert_err(serr, HTTP_CONFLICT,
- "Attempting to modify out-of-date resource.",
- r->pool);
+ if (comb->priv.version_name < created_rev)
+ {
+ serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL,
+ comb->res.collection
+ ? "Directory '%s' is out of date"
+ : (comb->res.exists
+ ? "File '%s' is out of date"
+ : "'%s' is out of date"),
+ comb->priv.repos_path);
+ return dav_svn__convert_err(serr, HTTP_CONFLICT,
+ "Attempting to modify out-of-date resource.",
+ r->pool);
+ }
+ }
+ else if (SVN_IS_VALID_REVNUM(comb->priv.version_name)
+ && comb->res.collection)
+ {
+ /* Issue #4480: With HTTPv2 we can receive the first change for a
+ directory after it has been made mutable, because one of its
+ descendants was changed before changing the directory.
+
+ We have to check if whatever the node is in HEAD is equivalent
+ to what it was in the provided BASE revision.
+
+ If the node was copied, we would process it before its decendants
+ and we already performed quite a few checks when making it mutable
+ via its descendant, so what we should really check here is if the
+ properties changed since the BASE version.
+
+ ### I think svn_fs_node_relation() checks for more changes than we
+ should check for here. Needs further review. But it looks like\
+ this check matches the checks in the libsvn_fs commit editor.
+
+ For now I would say reporting out of date in a few too many
+ cases is safer than not reporting out of date when we should.
+ */
+ svn_revnum_t txn_base_rev;
+ svn_fs_root_t *txn_base_root;
+ svn_fs_root_t *rev_root;
+ const svn_fs_id_t *txn_base_id;
+ const svn_fs_id_t *rev_id;
+
+ txn_base_rev = svn_fs_txn_base_revision(comb->res.info->root.txn);
+
+ if (comb->priv.version_name == txn_base_rev)
+ return NULL; /* Easy out: Nothing changed */
+
+ serr = svn_fs_revision_root(&txn_base_root, comb->res.info->repos->fs,
+ txn_base_rev, r->pool);
+
+ if (!serr)
+ serr = svn_fs_node_id(&txn_base_id, txn_base_root,
+ comb->priv.repos_path, r->pool);
+
+ if (serr != NULL)
+ {
+ return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Could not open youngest revision root "
+ "for verification against the base "
+ "revision", r->pool);
+ }
+
+ serr = svn_fs_revision_root(&rev_root, comb->res.info->repos->fs,
+ comb->priv.version_name, r->pool);
+
+ if (!serr)
+ serr = svn_fs_node_id(&rev_id, rev_root,
+ comb->priv.repos_path, r->pool);
+
+ if (serr != NULL)
+ {
+ return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Could not open the base revision"
+ "for verification against the youngest "
+ "revision", r->pool);
+ }
+
+ svn_fs_close_root(rev_root);
+ svn_fs_close_root(txn_base_root);
+
+ if (0 != svn_fs_compare_ids(txn_base_id, rev_id))
+ {
+ serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL,
+ "Directory '%s' is out of date",
+ comb->priv.repos_path);
+ return dav_svn__convert_err(serr, HTTP_CONFLICT,
+ "Attempting to modify out-of-date resource.",
+ r->pool);
+ }
}
return NULL;
@@ -1969,26 +2052,31 @@ get_resource(request_rec *r,
/* Special case: detect and build the SVNParentPath as a unique type
of private resource, iff the SVNListParentPath directive is 'on'. */
- if (fs_parent_path && dav_svn__get_list_parentpath_flag(r))
+ if (dav_svn__is_parentpath_list(r))
{
- char *uri = apr_pstrdup(r->pool, r->uri);
- char *parentpath = apr_pstrdup(r->pool, root_path);
- apr_size_t uri_len = strlen(uri);
- apr_size_t parentpath_len = strlen(parentpath);
-
- if (uri[uri_len-1] == '/')
- uri[uri_len-1] = '\0';
+ /* Only allow GET and HEAD on the parentpath resource
+ * httpd uses the same method_number for HEAD as GET */
+ if (r->method_number != M_GET)
+ {
+ int status;
- if (parentpath[parentpath_len-1] == '/')
- parentpath[parentpath_len-1] = '\0';
+ /* Marshall the error back to the client by generating by
+ * way of the dav_svn__error_response_tag trick. */
+ err = dav_svn__new_error(r->pool, HTTP_METHOD_NOT_ALLOWED,
+ SVN_ERR_APMOD_MALFORMED_URI,
+ "The URI does not contain the name "
+ "of a repository.");
+ /* can't use r->allowed since the default handler isn't called */
+ apr_table_setn(r->headers_out, "Allow", "GET,HEAD");
+ status = dav_svn__error_response_tag(r, err);
- if (strcmp(parentpath, uri) == 0)
- {
- err = get_parentpath_resource(r, resource);
- if (err)
- return err;
- return NULL;
+ return dav_push_error(r->pool, status, err->error_id, NULL, err);
}
+
+ err = get_parentpath_resource(r, resource);
+ if (err)
+ return err;
+ return NULL;
}
/* This does all the work of interpreting/splitting the request uri. */
@@ -2455,9 +2543,12 @@ get_parent_resource(const dav_resource *
parent->info = parentinfo;
parentinfo->uri_path =
- svn_stringbuf_create(get_parent_path(resource->info->uri_path->data,
- TRUE, resource->pool),
- resource->pool);
+ svn_stringbuf_create(
+ get_parent_path(
+ svn_urlpath__canonicalize(resource->info->uri_path->data,
+ resource->pool),
+ TRUE, resource->pool),
+ resource->pool);
parentinfo->repos = resource->info->repos;
parentinfo->root = resource->info->root;
parentinfo->r = resource->info->r;
Modified: subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/util.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/mod_dav_svn/util.c Tue Apr 29 23:36:43 2014
@@ -425,6 +425,32 @@ dav_svn__simple_parse_uri(dav_svn__uri_i
"Unsupported URI form");
}
+svn_boolean_t
+dav_svn__is_parentpath_list(request_rec *r)
+{
+ const char *fs_parent_path = dav_svn__get_fs_parent_path(r);
+
+ if (fs_parent_path && dav_svn__get_list_parentpath_flag(r))
+ {
+ const char *root_path = dav_svn__get_root_dir(r);
+ char *uri = apr_pstrdup(r->pool, r->uri);
+ char *parentpath = apr_pstrdup(r->pool, root_path);
+ apr_size_t uri_len = strlen(uri);
+ apr_size_t parentpath_len = strlen(parentpath);
+
+ if (uri[uri_len-1] == '/')
+ uri[uri_len-1] = '\0';
+
+ if (parentpath[parentpath_len-1] == '/')
+ parentpath[parentpath_len-1] = '\0';
+
+ if (strcmp(parentpath, uri) == 0)
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
/* ### move this into apr_xml */
int
Modified: subversion/branches/1.8.x-r1536931/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/svn/conflict-callbacks.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/svn/conflict-callbacks.c Tue Apr 29 23:36:43 2014
@@ -489,10 +489,10 @@ static const resolver_option_t text_conf
/* Resolver options for a property conflict */
static const resolver_option_t prop_conflict_options[] =
{
- { "mf", N_("my version"), N_("accept my version of entire file (even "
+ { "mf", N_("my version"), N_("accept my version of entire property (even "
"non-conflicts) [mine-full]"),
svn_wc_conflict_choose_mine_full },
- { "tf", N_("their version"), N_("accept their version of entire file "
+ { "tf", N_("their version"), N_("accept their version of entire property "
"(same) [theirs-full]"),
svn_wc_conflict_choose_theirs_full },
{ "dc", N_("display conflict"), N_("show conflicts in this property"), -1 },
@@ -935,7 +935,7 @@ handle_text_conflict(svn_wc_conflict_res
/* 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 (result->choice == svn_wc_conflict_choose_merged
+ if (opt->choice == svn_wc_conflict_choose_merged
&& ! knows_something)
{
SVN_ERR(svn_cmdline_fprintf(
Modified: subversion/branches/1.8.x-r1536931/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/svn/status-cmd.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/svn/status-cmd.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/svn/status-cmd.c Tue Apr 29 23:36:43 2014
@@ -358,7 +358,8 @@ svn_cl__status(apr_getopt_t *os,
NULL, opt_state->quiet,
/* not versioned: */
SVN_ERR_WC_NOT_WORKING_COPY,
- SVN_ERR_WC_PATH_NOT_FOUND));
+ SVN_ERR_WC_PATH_NOT_FOUND,
+ SVN_NO_ERROR));
if (opt_state->xml)
SVN_ERR(print_finish_target_xml(repos_rev, iterpool));
Modified: subversion/branches/1.8.x-r1536931/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/svn/svn.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/svn/svn.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/svn/svn.c Tue Apr 29 23:36:43 2014
@@ -2939,6 +2939,10 @@ sub_main(int argc, const char *argv[], a
"Subversion"));
}
+ /* Ensure that stdout is flushed, so the user will see any write errors.
+ This makes sure that output is not silently lost. */
+ err = svn_error_compose_create(err, svn_cmdline_fflush(stdout));
+
return EXIT_ERROR(err);
}
else
Propchange: subversion/branches/1.8.x-r1536931/subversion/svn/svn.c
------------------------------------------------------------------------------
Merged /subversion/branches/1.8.x/subversion/svn/svn.c:r1536934-1591142
Merged /subversion/trunk/subversion/svn/svn.c:r1499470,1543413
Modified: subversion/branches/1.8.x-r1536931/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/svndumpfilter/svndumpfilter.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/svndumpfilter/svndumpfilter.c Tue Apr 29 23:36:43 2014
@@ -570,6 +570,9 @@ new_node_record(void **node_baton,
}
else
{
+ const char *kind;
+ const char *action;
+
tcl = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH);
/* Test if this node was copied from dropped source. */
@@ -584,7 +587,6 @@ new_node_record(void **node_baton,
dumpfile should contain the new contents of the file. In this
scenario, we'll just do an add without history using the new
contents. */
- const char *kind;
kind = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_NODE_KIND);
/* If there is a Text-content-length header, and the kind is
@@ -623,6 +625,30 @@ new_node_record(void **node_baton,
if (! nb->rb->writing_begun)
SVN_ERR(output_revision(nb->rb));
+ /* A node record is required to begin with 'Node-path', skip the
+ leading '/' to match the form used by 'svnadmin dump'. */
+ SVN_ERR(svn_stream_printf(nb->rb->pb->out_stream,
+ pool, "%s: %s\n",
+ SVN_REPOS_DUMPFILE_NODE_PATH, node_path + 1));
+
+ /* Node-kind is next and is optional. */
+ kind = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_NODE_KIND);
+ if (kind)
+ SVN_ERR(svn_stream_printf(nb->rb->pb->out_stream,
+ pool, "%s: %s\n",
+ SVN_REPOS_DUMPFILE_NODE_KIND, kind));
+
+ /* Node-action is next and required. */
+ action = svn_hash_gets(headers, SVN_REPOS_DUMPFILE_NODE_ACTION);
+ if (action)
+ SVN_ERR(svn_stream_printf(nb->rb->pb->out_stream,
+ pool, "%s: %s\n",
+ SVN_REPOS_DUMPFILE_NODE_ACTION, action));
+ else
+ return svn_error_createf(SVN_ERR_INCOMPLETE_DATA, 0,
+ _("Missing Node-action for path '%s'"),
+ node_path);
+
for (hi = apr_hash_first(pool, headers); hi; hi = apr_hash_next(hi))
{
const char *key = svn__apr_hash_index_key(hi);
@@ -638,7 +664,10 @@ new_node_record(void **node_baton,
if ((!strcmp(key, SVN_REPOS_DUMPFILE_CONTENT_LENGTH))
|| (!strcmp(key, SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH))
- || (!strcmp(key, SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH)))
+ || (!strcmp(key, SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH))
+ || (!strcmp(key, SVN_REPOS_DUMPFILE_NODE_PATH))
+ || (!strcmp(key, SVN_REPOS_DUMPFILE_NODE_KIND))
+ || (!strcmp(key, SVN_REPOS_DUMPFILE_NODE_ACTION)))
continue;
/* Rewrite Node-Copyfrom-Rev if we are renumbering revisions.
Modified: subversion/branches/1.8.x-r1536931/subversion/svnrdump/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/svnrdump/util.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/svnrdump/util.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/svnrdump/util.c Tue Apr 29 23:36:43 2014
@@ -35,7 +35,7 @@ svn_rdump__normalize_prop(const char *na
const svn_string_t **value,
apr_pool_t *result_pool)
{
- if (svn_prop_needs_translation(name))
+ if (svn_prop_needs_translation(name) && *value)
{
const char *cstring;
Modified: subversion/branches/1.8.x-r1536931/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/svnserve/serve.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/svnserve/serve.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/svnserve/serve.c Tue Apr 29 23:36:43 2014
@@ -1526,6 +1526,9 @@ static svn_error_t *get_file(svn_ra_svn_
&want_props, &want_contents,
&wants_inherited_props));
+ if (wants_inherited_props == SVN_RA_SVN_UNSPECIFIED_NUMBER)
+ wants_inherited_props = FALSE;
+
full_path = svn_fspath__join(b->fs_path->data,
svn_relpath_canonicalize(path, pool), pool);
@@ -1545,8 +1548,14 @@ static svn_error_t *get_file(svn_ra_svn_
SVN_CMD_ERR(svn_fs_file_checksum(&checksum, svn_checksum_md5, root,
full_path, TRUE, pool));
hex_digest = svn_checksum_to_cstring_display(checksum, pool);
+
+ /* Fetch the file's explicit and/or inherited properties if
+ requested. Although the wants-iprops boolean was added to the
+ protocol in 1.8 a standard 1.8 client never requests iprops. */
if (want_props || wants_inherited_props)
- SVN_CMD_ERR(get_props(&props, &inherited_props, &ab, root, full_path,
+ SVN_CMD_ERR(get_props(want_props ? &props : NULL,
+ wants_inherited_props ? &inherited_props : NULL,
+ &ab, root, full_path,
pool));
if (want_contents)
SVN_CMD_ERR(svn_fs_file_contents(&contents, root, full_path, pool));
@@ -1640,6 +1649,9 @@ static svn_error_t *get_dir(svn_ra_svn_c
&dirent_fields_list,
&wants_inherited_props));
+ if (wants_inherited_props == SVN_RA_SVN_UNSPECIFIED_NUMBER)
+ wants_inherited_props = FALSE;
+
if (! dirent_fields_list)
{
dirent_fields = SVN_DIRENT_ALL;
@@ -1689,10 +1701,13 @@ static svn_error_t *get_dir(svn_ra_svn_c
/* Fetch the root of the appropriate revision. */
SVN_CMD_ERR(svn_fs_revision_root(&root, b->fs, rev, pool));
- /* Fetch the directory's explicit and/or inherited properties
- if requested. */
+ /* Fetch the directory's explicit and/or inherited properties if
+ requested. Although the wants-iprops boolean was added to the
+ protocol in 1.8 a standard 1.8 client never requests iprops. */
if (want_props || wants_inherited_props)
- SVN_CMD_ERR(get_props(&props, &inherited_props, &ab, root, full_path,
+ SVN_CMD_ERR(get_props(want_props ? &props : NULL,
+ wants_inherited_props ? &inherited_props : NULL,
+ &ab, root, full_path,
pool));
/* Begin response ... */
Modified: subversion/branches/1.8.x-r1536931/subversion/svnserve/svnserve.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/svnserve/svnserve.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/svnserve/svnserve.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/svnserve/svnserve.c Tue Apr 29 23:36:43 2014
@@ -215,9 +215,7 @@ static const apr_getopt_option_t svnserv
" "
"minimize redundant operations.\n"
" "
- "Default is 128 for threaded and 16 for non-\n"
- " "
- "threaded mode.\n"
+ "Default is 16.\n"
" "
"[used for FSFS repositories only]")},
{"cache-txdeltas", SVNSERVE_OPT_CACHE_TXDELTAS, 1,
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/authz_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/authz_tests.py Tue Apr 29 23:36:43 2014
@@ -576,8 +576,8 @@ def authz_log_and_tracing_test(sbox):
if sbox.repo_url.startswith('http'):
expected_err2 = expected_err
else:
- expected_err2 = ".*svn: E220001: Unreadable path encountered; " \
- "access denied.*"
+ expected_err2 = ".*svn: E220001: ((Unreadable path encountered; " \
+ "access denied)|(Item is not readable)).*"
# if we do the same thing directly on the unreadable file, we get:
# svn: Item is not readable
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/autoprop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/autoprop_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/autoprop_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/autoprop_tests.py Tue Apr 29 23:36:43 2014
@@ -102,7 +102,9 @@ def autoprops_test(sbox, cmd, cfgenable,
# some directories
wc_dir = sbox.wc_dir
- tmp_dir = os.path.abspath(svntest.main.temp_dir)
+ tmp_dir = os.path.join(os.path.abspath(svntest.main.temp_dir), sbox.name)
+ if not os.path.isdir(tmp_dir):
+ os.makedirs(tmp_dir)
config_dir = os.path.join(tmp_dir, 'autoprops_config_' + sbox.name)
repos_url = sbox.repo_url
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/checkout_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/checkout_tests.py Tue Apr 29 23:36:43 2014
@@ -27,6 +27,7 @@
# General modules
import sys, re, os, time, subprocess
+import datetime
# Our testing module
import svntest
@@ -660,11 +661,28 @@ def checkout_peg_rev_date(sbox):
sbox.build()
wc_dir = sbox.wc_dir
- # note the current time to use it as peg revision date.
- current_time = time.strftime("%Y-%m-%dT%H:%M:%S")
-
- # sleep till the next second.
- time.sleep(1.1)
+ ## Get svn:date.
+ exit_code, output, errput = svntest.main.run_svn(None, 'propget', 'svn:date',
+ '--revprop', '-r1',
+ '--strict',
+ sbox.repo_url)
+ if exit_code or errput != [] or len(output) != 1:
+ raise svntest.Failure("svn:date propget failed")
+ r1_string = output[0]
+
+ ## Increment the svn:date date by one microsecond.
+ # TODO: pass tzinfo=UTC to datetime.datetime()
+ date_pattern = re.compile(r'(\d+)-(\d+)-(\d+)T(\d\d):(\d\d):(\d\d)\.(\d+)Z$')
+ r1_time = datetime.datetime(*map(int, date_pattern.match(r1_string).groups()))
+ peg_time = r1_time + datetime.timedelta(microseconds=1)
+ assert r1_time != peg_time
+ # peg_string is, by all likelihood, younger than r1's svn:date and older than
+ # r2's svn:date. It is also not equal to either of them, so we test the
+ # binary search of svn:date values.
+ peg_string = '%04d-%02d-%02dT%02d:%02d:%02d.%06dZ' % \
+ tuple(getattr(peg_time, x)
+ for x in ["year", "month", "day", "hour", "minute",
+ "second", "microsecond"])
# create a new revision
mu_path = os.path.join(wc_dir, 'A', 'mu')
@@ -673,7 +691,7 @@ def checkout_peg_rev_date(sbox):
svntest.actions.run_and_verify_svn(None, None, [],
'ci', '-m', 'changed file mu', wc_dir)
- # now checkout the repo@current_time in another folder, this should create our
+ # now checkout the repo@peg_string in another folder, this should create our
# initial wc without the change in mu.
checkout_target = sbox.add_wc_path('checkout')
os.mkdir(checkout_target)
@@ -686,7 +704,24 @@ def checkout_peg_rev_date(sbox):
# use an old date to checkout, that way we're sure we get the first revision
svntest.actions.run_and_verify_checkout(sbox.repo_url +
- '@{' + current_time + '}',
+ '@{' + peg_string + '}',
+ checkout_target,
+ expected_output,
+ expected_wc)
+
+ # now try another checkout with repo@r1_string
+ checkout_target = sbox.add_wc_path('checkout2')
+ os.mkdir(checkout_target)
+
+ expected_output = svntest.main.greek_state.copy()
+ expected_output.wc_dir = checkout_target
+ expected_output.tweak(status='A ', contents=None)
+
+ expected_wc = svntest.main.greek_state.copy()
+
+ # use an old date to checkout, that way we're sure we get the first revision
+ svntest.actions.run_and_verify_checkout(sbox.repo_url +
+ '@{' + r1_string + '}',
checkout_target,
expected_output,
expected_wc)
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/commit_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/commit_tests.py Tue Apr 29 23:36:43 2014
@@ -2545,6 +2545,16 @@ def start_commit_hook_test(sbox):
'STDERR',
expected_stderr, actual_stderr)
+ # Now list the txns in the repo. The list should be empty.
+ exit_code, output, errput = svntest.main.run_svnadmin('lstxns',
+ sbox.repo_dir)
+ svntest.verify.compare_and_display_lines(
+ "Error running 'svnadmin lstxns'.",
+ 'STDERR', [], errput)
+ svntest.verify.compare_and_display_lines(
+ "Output of 'svnadmin lstxns' is unexpected.",
+ 'STDOUT', [], output)
+
#----------------------------------------------------------------------
@Issue(3553)
def pre_commit_hook_test(sbox):
@@ -2998,7 +3008,115 @@ def commit_cp_with_deep_delete(sbox):
None,
wc_dir)
-
+def commit_deep_deleted(sbox):
+ "try to commit a deep descendant of a deleted node"
+
+ sbox.build()
+
+ sbox.simple_move('A', 'AA')
+
+ sbox.simple_propset('k', 'v', 'AA/D/G')
+
+ # Committing some added descendant returns a proper error
+ expected_err = ('svn: E200009: \'%s\' is not known to exist in the ' +
+ 'repository and is not part of the commit, yet its ' +
+ 'child \'%s\' is part of the commit') % (
+ re.escape(os.path.abspath(sbox.ospath('AA'))),
+ re.escape(os.path.abspath(sbox.ospath('AA/D/G'))))
+
+ svntest.actions.run_and_verify_commit(sbox.wc_dir,
+ None,
+ None,
+ expected_err,
+ sbox.ospath('AA/D/G'))
+
+ sbox.simple_propdel('k', 'AA/D/G')
+ sbox.simple_rm('AA/D/G')
+
+ # But a delete fails..
+ # This used to trigger an assertion in Subversion 1.8.0-1.8.8, because
+ # the status walker couldn't find the repository path for AA/D/G
+ svntest.actions.run_and_verify_commit(sbox.wc_dir,
+ None,
+ None,
+ expected_err,
+ sbox.ospath('AA/D/G'))
+
+ # And now commit like how a GUI client would do it, but forgetting the move
+ expected_err = ('svn: E200009: Cannot commit \'%s\' because it was moved ' +
+ 'from \'%s\' which is not part of the commit; both sides ' +
+ 'of the move must be committed together') % (
+ re.escape(os.path.abspath(sbox.ospath('AA'))),
+ re.escape(os.path.abspath(sbox.ospath('A'))))
+ svntest.actions.run_and_verify_commit(sbox.wc_dir,
+ None,
+ None,
+ expected_err,
+ '--depth', 'empty',
+ sbox.ospath('AA/D/G'),
+ sbox.ospath('AA'))
+
+
+ # And now how it works
+ svntest.actions.run_and_verify_commit(sbox.wc_dir,
+ None,
+ None,
+ [],
+ '--depth', 'empty',
+ sbox.ospath('AA/D/G'),
+ sbox.ospath('AA'),
+ sbox.ospath('A'))
+
+@Issue(4480)
+def commit_mergeinfo_ood(sbox):
+ "commit of mergeinfo that should cause out of date"
+
+ sbox.build()
+ sbox.simple_rm('A', 'iota')
+ sbox.simple_commit() # r2
+
+ sbox.simple_mkdir('trunk', 'branch')
+ sbox.simple_commit() # r3
+
+ sbox.simple_append('trunk/a', 'This is a\n')
+ sbox.simple_add('trunk/a')
+ sbox.simple_commit() # r4
+
+ sbox.simple_append('trunk/b', 'This is b\n')
+ sbox.simple_add('trunk/b')
+ sbox.simple_commit() # r5
+
+ sbox.simple_update() # To r5
+
+ expected_output = [
+ '--- Merging r4 into \'%s\':\n' % sbox.ospath('branch'),
+ 'A %s\n' % sbox.ospath('branch/a'),
+ '--- Recording mergeinfo for merge of r4' \
+ ' into \'%s\':\n' % sbox.ospath('branch'),
+ ' U %s\n' % sbox.ospath('branch'),
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'merge', '-c4', '^/trunk',
+ sbox.ospath('branch'))
+
+ sbox.simple_commit()
+
+ sbox.simple_update(revision='5')
+
+ expected_output = [
+ '--- Merging r5 into \'%s\':\n' % sbox.ospath('branch'),
+ 'A %s\n' % sbox.ospath('branch/b'),
+ '--- Recording mergeinfo for merge of r5 into \'%s\':\n' % sbox.ospath('branch'),
+ ' U %s\n' % sbox.ospath('branch'),
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'merge', '-c5', '^/trunk',
+ sbox.ospath('branch'))
+
+ # Currently this commit succeeds with dav over HTTPv2, while it should really fail
+ expected_err = '.*out of date.*'
+ svntest.actions.run_and_verify_svn(None, None, expected_err,
+ 'commit', sbox.ospath(''), '-m', 'M')
########################################################################
# Run the tests
@@ -3072,6 +3190,8 @@ test_list = [ None,
commit_danglers,
last_changed_of_copied_subdir,
commit_cp_with_deep_delete,
+ commit_deep_deleted,
+ commit_mergeinfo_ood,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/copy_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/copy_tests.py Tue Apr 29 23:36:43 2014
@@ -25,7 +25,7 @@
######################################################################
# General modules
-import stat, os, re, shutil, logging
+import stat, os, re, shutil, logging, sys
logger = logging.getLogger()
@@ -5787,6 +5787,33 @@ def copy_over_excluded(sbox):
sbox.ospath('A/C'),
sbox.ospath('A/D'))
+def copy_relocate(sbox):
+ "copy from a relocated location"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ tmp_dir = sbox.add_wc_path('relocated')
+
+ shutil.copytree(sbox.repo_dir, tmp_dir)
+
+ url = 'file://'
+
+ if sys.platform == 'win32':
+ url += '/'
+
+ url += os.path.abspath(tmp_dir).replace(os.path.sep, '/')
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'relocate', url, wc_dir)
+
+ copiedpath = sbox.ospath('AA')
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'cp', url + '/A', copiedpath)
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'info', copiedpath)
+
########################################################################
# Run the tests
@@ -5904,6 +5931,7 @@ test_list = [ None,
copy_to_unversioned_parent,
copy_text_conflict,
copy_over_excluded,
+ copy_relocate,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/diff_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/diff_tests.py Tue Apr 29 23:36:43 2014
@@ -4648,6 +4648,26 @@ def diff_local_missing_obstruction(sbox)
'diff', wc_dir)
+@Issue(4444)
+def diff_move_inside_copy(sbox):
+ "diff copied-along child that contains a moved file"
+ sbox.build(read_only=True)
+ wc_dir = sbox.wc_dir
+
+ d_path = 'A/D'
+ d_copy = 'A/D-copy'
+ h_path = 'A/D-copy/H'
+ chi_path = '%s/chi' % h_path
+ chi_moved = '%s/chi-moved' % h_path
+
+ sbox.simple_copy(d_path, d_copy)
+ sbox.simple_move(chi_path, chi_moved)
+ sbox.simple_append(chi_moved, 'a new line')
+
+ # Bug: Diffing the copied-along parent directory asserts
+ svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, [],
+ 'diff', sbox.ospath(h_path))
+
########################################################################
#Run the tests
@@ -4729,6 +4749,7 @@ test_list = [ None,
diff_repos_empty_file_addition,
diff_missing_tree_conflict_victim,
diff_local_missing_obstruction,
+ diff_move_inside_copy,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/export_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/export_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/export_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/export_tests.py Tue Apr 29 23:36:43 2014
@@ -964,6 +964,114 @@ def export_custom_keywords(sbox):
if open(export_file).read() != ''.join(alpha_content):
raise svntest.Failure("wrong keyword expansion")
+@Issue(4427)
+def export_file_external(sbox):
+ "export file external from WC and URL"
+ sbox.build()
+
+ wc_dir = sbox.wc_dir
+
+ # Set 'svn:externals' property in 'A/C' to 'A/B/E/alpha'(file external),
+ C_path = os.path.join(wc_dir, 'A', 'C')
+ externals_prop = "^/A/B/E/alpha exfile_alpha"
+
+ tmp_f = sbox.get_tempname('prop')
+ svntest.main.file_append(tmp_f, externals_prop)
+ svntest.main.run_svn(None, 'ps', '-F', tmp_f, 'svn:externals', C_path)
+ svntest.main.run_svn(None,'ci', '-m', 'log msg', '--quiet', C_path)
+
+ # Update the working copy to receive file external
+ svntest.main.run_svn(None, 'up', wc_dir)
+
+ # Update the expected disk tree to include the external.
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\n"),
+ })
+
+ # Export from URL
+ export_target = sbox.add_wc_path('export_url')
+ expected_output = svntest.main.greek_state.copy()
+ expected_output.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\r"),
+ })
+ expected_output.wc_dir = export_target
+ expected_output.desc[''] = Item()
+ expected_output.tweak(contents=None, status='A ')
+ svntest.actions.run_and_verify_export(sbox.repo_url,
+ export_target,
+ expected_output,
+ expected_disk)
+
+ # Export from WC
+ export_target = sbox.add_wc_path('export_wc')
+ expected_output = svntest.main.greek_state.copy()
+ expected_output.add({
+ 'A/C/exfile_alpha' : Item("This is the file 'alpha'.\r"),
+ })
+ expected_output.wc_dir = export_target
+ expected_output.desc['A'] = Item()
+ expected_output.tweak(contents=None, status='A ')
+ svntest.actions.run_and_verify_export(wc_dir,
+ export_target,
+ expected_output,
+ expected_disk)
+
+@Issue(4427)
+def export_file_externals2(sbox):
+ "exporting file externals"
+
+ sbox.build()
+ sbox.simple_mkdir('DIR', 'DIR2')
+
+ sbox.simple_propset('svn:externals', '^/iota file', 'DIR')
+ sbox.simple_propset('svn:externals', '^/DIR TheDir', 'DIR2')
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ tmp = sbox.add_wc_path('tmp')
+ os.mkdir(tmp)
+
+ expected_output = svntest.wc.State(tmp, {
+ 'file' : Item(status='A '),
+ })
+ expected_disk = svntest.wc.State('', {
+ 'file': Item(contents="This is the file 'iota'.\n")
+ })
+ # Fails in 1.8.8 and r1575909.
+ # Direct export of file external was just skipped
+ svntest.actions.run_and_verify_export(sbox.ospath('DIR/file'),
+ tmp,
+ expected_output,
+ expected_disk)
+
+ expected_output = svntest.wc.State(tmp, {
+ 'DIR/file' : Item(status='A '),
+ })
+ expected_disk = svntest.wc.State('', {
+ 'file': Item(contents="This is the file 'iota'.\n")
+ })
+ # Fails in 1.8.8 (doesn't export file), passes in r1575909
+ svntest.actions.run_and_verify_export(sbox.ospath('DIR'),
+ os.path.join(tmp, 'DIR'),
+ expected_output,
+ expected_disk)
+
+ expected_output = svntest.wc.State(tmp, {
+ 'DIR2/TheDir/file' : Item(status='A '),
+ })
+ expected_disk = svntest.wc.State('', {
+ 'TheDir' : Item(),
+ 'TheDir/file' : Item(contents="This is the file 'iota'.\n")
+ })
+ # Fails in 1.8.8 (doesn't export anything),
+ # Fails in r1575909 (exports file twice; once as file; once as external)
+ svntest.actions.run_and_verify_export(sbox.ospath('DIR2'),
+ os.path.join(tmp, 'DIR2'),
+ expected_output,
+ expected_disk)
+
+
########################################################################
# Run the tests
@@ -998,6 +1106,8 @@ test_list = [ None,
export_to_current_dir,
export_file_overwrite_with_force,
export_custom_keywords,
+ export_file_external,
+ export_file_externals2
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/lock_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/lock_tests.py Tue Apr 29 23:36:43 2014
@@ -1890,6 +1890,147 @@ def drop_locks_on_parent_deletion(sbox):
wc_dir)
+@SkipUnless(svntest.main.is_ra_type_dav)
+def dav_lock_timeout(sbox):
+ "unlock a lock with timeout"
+
+ import httplib
+ from urlparse import urlparse
+ import base64
+
+ sbox.build()
+ loc = urlparse(sbox.repo_url)
+
+ if loc.scheme == 'http':
+ h = httplib.HTTPConnection(loc.hostname, loc.port)
+ else:
+ h = httplib.HTTPSConnection(loc.hostname, loc.port)
+
+ lock_body = '<?xml version="1.0" encoding="utf-8" ?>' \
+ '<D:lockinfo xmlns:D="DAV:">' \
+ ' <D:lockscope><D:exclusive/></D:lockscope>' \
+ ' <D:locktype><D:write/></D:locktype>' \
+ ' <D:owner>' \
+ ' <D:href>http://a/test</D:href>' \
+ ' </D:owner>' \
+ '</D:lockinfo>'
+
+ lock_headers = {
+ 'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+ 'Timeout': 'Second-86400'
+ }
+
+ # Enabling the following line makes this test easier to debug
+ h.set_debuglevel(9)
+
+ h.request('LOCK', sbox.repo_url + '/iota', lock_body, lock_headers)
+
+ r = h.getresponse()
+
+ # Verify that there is a lock, by trying to obtain one
+ svntest.actions.run_and_verify_svn2(None, None, ".*locked by user", 0,
+ 'lock', '-m', '', sbox.ospath('iota'))
+
+ # Before this patch this used to fail with a parse error of the timeout
+ svntest.actions.run_and_verify_svn2(None, None, ".*W160039.*Unlock.*403", 0,
+ 'unlock', sbox.repo_url + '/iota')
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'unlock', sbox.ospath('iota'), '--force')
+
+
+
+def non_root_locks(sbox):
+ "locks for working copies not at repos root"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'cp', sbox.repo_url, sbox.repo_url + '/X',
+ '-m', 'copy greek tree')
+
+ sbox.simple_switch(sbox.repo_url + '/X')
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Lock a file
+ svntest.actions.run_and_verify_svn(None, ".*locked by user", [],
+ 'lock', sbox.ospath('A/D/G/pi'),
+ '-m', '')
+ expected_status.tweak('A/D/G/pi', writelocked='K')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Updates don't break the lock
+ sbox.simple_update('A/D')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ sbox.simple_update('')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Break the lock
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'unlock', sbox.repo_url + '/X/A/D/G/pi')
+
+ # Subdir update reports the break
+ sbox.simple_update('A/D')
+ expected_status.tweak('A/D/G/pi', writelocked=None)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+ # Relock and break
+ svntest.actions.run_and_verify_svn(None, ".*locked by user", [],
+ 'lock', sbox.ospath('A/D/G/pi'),
+ '-m', '')
+ expected_status.tweak('A/D/G/pi', writelocked='K')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'unlock', sbox.repo_url + '/X/A/D/G/pi')
+
+ # Root update reports the break
+ sbox.simple_update('')
+ expected_status.tweak('A/D/G/pi', writelocked=None)
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+@Issue(3515)
+@SkipUnless(svntest.main.is_ra_type_dav)
+def dav_lock_refresh(sbox):
+ "refresh timeout of DAV lock"
+
+ import httplib
+ from urlparse import urlparse
+ import base64
+
+ sbox.build(create_wc = False)
+
+ # Acquire lock on 'iota'
+ svntest.actions.run_and_verify_svn(None, ".*locked by user", [], 'lock',
+ sbox.repo_url + '/iota')
+
+ # Try to refresh lock using 'If' header
+ loc = urlparse(sbox.repo_url)
+
+ if loc.scheme == 'http':
+ h = httplib.HTTPConnection(loc.hostname, loc.port)
+ else:
+ h = httplib.HTTPSConnection(loc.hostname, loc.port)
+
+ lock_token = svntest.actions.run_and_parse_info(sbox.repo_url + '/iota')[0]['Lock Token']
+
+ lock_headers = {
+ 'Authorization': 'Basic ' + base64.b64encode('jrandom:rayjandom'),
+ 'If': '(<' + lock_token + '>)',
+ 'Timeout': 'Second-7200'
+ }
+
+ # Enabling the following line makes this test easier to debug
+ h.set_debuglevel(9)
+
+ h.request('LOCK', sbox.repo_url + '/iota', '', lock_headers)
+
+ # XFAIL Refreshing of DAV lock fails with error '412 Precondition Failed'
+ r = h.getresponse()
+ if r.status != httplib.OK:
+ raise svntest.Failure('Lock refresh failed: %d %s' % (r.status, r.reason))
+
########################################################################
# Run the tests
@@ -1943,6 +2084,9 @@ test_list = [ None,
lock_unlock_deleted,
commit_stolen_lock,
drop_locks_on_parent_deletion,
+ dav_lock_timeout,
+ non_root_locks,
+ dav_lock_refresh,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_automatic_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_automatic_tests.py Tue Apr 29 23:36:43 2014
@@ -1202,6 +1202,132 @@ def effective_sync_results_in_reintegrat
svntest.actions.run_and_verify_svn(None, expected_output, [], 'merge',
sbox.repo_url + '/branch', A_path)
+@Issue(4481)
+def reintegrate_subtree_not_updated(sbox):
+ "reintegrate subtree not updated"
+
+ sbox.build()
+
+ # Create change on branch 'D_1'
+ sbox.simple_copy('A/D', 'D_1')
+ sbox.simple_commit()
+ sbox.simple_append('D_1/G/pi', "D_1/G pi edit\n")
+ sbox.simple_append('D_1/H/chi', "D_1/H chi edit\n")
+ sbox.simple_commit()
+
+ # Merge back to 'D' with two subtree merges
+ expected_output = [
+ "--- Merging r2 through r3 into '"
+ + sbox.ospath('A/D/G') + "':\n",
+ "U "
+ + sbox.ospath('A/D/G/pi') + "\n",
+ "--- Recording mergeinfo for merge of r2 through r3 into '"
+ + sbox.ospath('A/D/G') + "':\n",
+ " U "
+ + sbox.ospath('A/D/G') + "\n"]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'merge',
+ sbox.repo_url + '/D_1/G',
+ sbox.ospath('A/D/G'))
+ expected_output = [
+ "--- Merging r2 through r3 into '"
+ + sbox.ospath('A/D/H') + "':\n",
+ "U "
+ + sbox.ospath('A/D/H/chi') + "\n",
+ "--- Recording mergeinfo for merge of r2 through r3 into '"
+ + sbox.ospath('A/D/H') + "':\n",
+ " U "
+ + sbox.ospath('A/D/H') + "\n"]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'merge',
+ sbox.repo_url + '/D_1/H',
+ sbox.ospath('A/D/H'))
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # Create branch 'D_2'
+ sbox.simple_copy('A/D', 'D_2')
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # Create change on 'D_2'
+ sbox.simple_append('D_2/G/pi', "D_2/G pi edit\n")
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # Create change on 'D'
+ sbox.simple_append('A/D/G/rho', "D/G rho edit\n")
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # Sync merge to 'D_2' (doesn't record mergeinfo on 'D_2/H' subtree)
+ expected_output = [
+ "--- Merging r5 through r7 into '"
+ + sbox.ospath('D_2') + "':\n",
+ "U "
+ + sbox.ospath('D_2/G/rho') + "\n",
+ "--- Recording mergeinfo for merge of r5 through r7 into '"
+ + sbox.ospath('D_2') + "':\n",
+ " U "
+ + sbox.ospath('D_2') + "\n",
+ "--- Recording mergeinfo for merge of r5 through r7 into '"
+ + sbox.ospath('D_2/G') + "':\n",
+ " U "
+ + sbox.ospath('D_2/G') + "\n"]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'merge',
+ sbox.repo_url + '/A/D',
+ sbox.ospath('D_2'))
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # Reintegrate 'D_2' to 'D'
+ expected_output = [
+ "--- Merging differences between repository URLs into '"
+ + sbox.ospath('A/D') + "':\n",
+ "U "
+ + sbox.ospath('A/D/G/pi') + "\n",
+ " U "
+ + sbox.ospath('A/D/G') + "\n",
+ "--- Recording mergeinfo for merge between repository URLs into '"
+ + sbox.ospath('A/D') + "':\n",
+ " U "
+ + sbox.ospath('A/D') + "\n",
+ " U "
+ + sbox.ospath('A/D/G') + "\n"]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'merge',
+ sbox.repo_url + '/D_2',
+ sbox.ospath('A/D'))
+ sbox.simple_commit()
+ sbox.simple_update()
+
+ # merge to 'D_2'. This merge previously failed with this error:
+ #
+ # svn: E195016: Reintegrate can only be used if revisions 5 through 9 were
+ # previously merged from [URL]/D_2 to the reintegrate source, but this is
+ # not the case:
+ # A/D/G
+ # Missing ranges: /A/D/G:7
+ #
+ expected_output = [
+ "--- Merging differences between repository URLs into '"
+ + sbox.ospath('D_2') + "':\n",
+ " U "
+ + sbox.ospath('D_2/G') + "\n",
+ "--- Recording mergeinfo for merge between repository URLs into '"
+ + sbox.ospath('D_2') + "':\n",
+ " U "
+ + sbox.ospath('D_2') + "\n",
+ " G "
+ + sbox.ospath('D_2/G') + "\n"]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'merge',
+ sbox.repo_url + '/A/D',
+ sbox.ospath('D_2'))
+ sbox.simple_commit()
+ sbox.simple_update()
+
########################################################################
# Run the tests
@@ -1230,6 +1356,7 @@ test_list = [ None,
merge_replacement,
auto_merge_handles_replacements_in_merge_source,
effective_sync_results_in_reintegrate,
+ reintegrate_subtree_not_updated,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/merge_tests.py Tue Apr 29 23:36:43 2014
@@ -19143,6 +19143,159 @@ def merge_to_empty_target_merge_to_infin
# Commit the merge.
#sbox.simple_commit()
+def merge_dir_delete_force(sbox):
+ "merge a directory delete with --force"
+
+ sbox.build()
+
+ sbox.simple_rm('A/D/G')
+ sbox.simple_commit() # r2
+
+ sbox.simple_update(revision=1)
+
+ # Just merging r2 on r1 succeeds
+ svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
+ 'merge', '-c2', '^/', sbox.wc_dir,
+ '--ignore-ancestry')
+
+ # Bring working copy to r1 again
+ svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
+ 'revert', '-R', sbox.wc_dir)
+
+ # But when using --force this same merge caused a segfault in 1.8.0-1.8.8
+ svntest.actions.run_and_verify_svn(sbox.wc_dir, None, [],
+ 'merge', '-c2', '^/', sbox.wc_dir,
+ '--ignore-ancestry', '--force')
+
+def conflict_naming(sbox):
+ "verify conflict file naming"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ sbox.simple_append('file.txt', 'This is the initial content\n')
+ sbox.simple_add('file.txt')
+ sbox.simple_commit()
+
+ sbox.simple_append('file.txt', 'This is the new content\n', truncate=True)
+ sbox.simple_commit()
+
+ sbox.simple_append('file.txt', 'This is conflicting content\n', truncate=True)
+
+ # Update - no preserve ext
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_disk = svntest.main.greek_state.copy()
+ expected_output = svntest.wc.State(wc_dir, {
+ 'file.txt' : Item(status='C ')
+ })
+ expected_status.add({
+ 'file.txt' : Item(status='C ', wc_rev='2')
+ })
+
+ expected_disk.add({
+ 'file.txt.r3' : Item(contents="This is the new content\n"),
+ 'file.txt.r2' : Item(contents="This is the initial content\n"),
+ 'file.txt' : Item(contents="<<<<<<< .mine\n" \
+ "This is conflicting content\n" \
+ "=======\n" \
+ "This is the initial content\n" \
+ ">>>>>>> .r2\n"),
+ 'file.txt.mine' : Item(contents="This is conflicting content\n"),
+ })
+ svntest.actions.run_and_verify_update(wc_dir,
+ expected_output, expected_disk,
+ expected_status,
+ None, None, None,
+ None, None, None,
+ wc_dir, '-r', '2')
+
+ sbox.simple_revert('file.txt')
+ sbox.simple_update('', revision=3)
+ sbox.simple_append('file.txt', 'This is conflicting content\n', truncate=True)
+
+ # Update - preserve ext
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+ expected_disk = svntest.main.greek_state.copy()
+ expected_output = svntest.wc.State(wc_dir, {
+ 'file.txt' : Item(status='C ')
+ })
+ expected_status.add({
+ 'file.txt' : Item(status='C ', wc_rev='2')
+ })
+
+ expected_disk.add({
+ 'file.txt.r3.txt' : Item(contents="This is the new content\n"),
+ 'file.txt.r2.txt' : Item(contents="This is the initial content\n"),
+ 'file.txt' : Item(contents="<<<<<<< .mine.txt\n" \
+ "This is conflicting content\n" \
+ "=======\n" \
+ "This is the initial content\n" \
+ ">>>>>>> .r2.txt\n"),
+ 'file.txt.mine.txt' : Item(contents="This is conflicting content\n"),
+ })
+ svntest.actions.run_and_verify_update(
+ wc_dir,
+ expected_output, expected_disk, expected_status,
+ None, None, None, None, None, None,
+ wc_dir, '-r', '2',
+ '--config-option',
+ 'config:miscellany:preserved-conflict-file-exts=' +
+ 'c txt h')
+
+ sbox.simple_revert('file.txt')
+ sbox.simple_update('', revision=3)
+ sbox.simple_append('file.txt', 'This is conflicting content\n', truncate=True)
+
+ # Merge - no preserve ext
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+ expected_disk = svntest.main.greek_state.copy()
+ expected_status.add({
+ 'file.txt' : Item(status='C ', wc_rev='3')
+ })
+ expected_disk.add({
+ 'file.txt.merge-left.r3' : Item(contents="This is the new content\n"),
+ 'file.txt.merge-right.r2': Item(contents="This is the initial content\n"),
+ 'file.txt' : Item(contents="<<<<<<< .working\n" \
+ "This is conflicting content\n" \
+ "=======\n" \
+ "This is the initial content\n" \
+ ">>>>>>> .merge-right.r2\n"),
+ 'file.txt.working' : Item(contents="This is conflicting content\n"),
+ })
+
+ svntest.actions.run_and_verify_svn(wc_dir, None, [],
+ 'merge', '-c-3', '^/', sbox.ospath(''))
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.verify_disk(wc_dir, expected_disk)
+
+ sbox.simple_revert('file.txt')
+ sbox.simple_append('file.txt', 'This is conflicting content\n', truncate=True)
+
+ # Merge - preserve ext
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+ expected_disk = svntest.main.greek_state.copy()
+ expected_status.add({
+ 'file.txt' : Item(status='C ', wc_rev='3')
+ })
+ expected_disk.add({
+ 'file.txt.merge-left.r3.txt' : Item(contents="This is the new content\n"),
+ 'file.txt.merge-right.r2.txt': Item(contents="This is the initial content\n"),
+ 'file.txt' : Item(contents="<<<<<<< .working.txt\n" \
+ "This is conflicting content\n" \
+ "=======\n" \
+ "This is the initial content\n" \
+ ">>>>>>> .merge-right.r2.txt\n"),
+ 'file.txt.working.txt' : Item(contents="This is conflicting content\n"),
+ })
+
+ svntest.actions.run_and_verify_svn(
+ wc_dir, None, [],
+ 'merge', '-c-3', '^/', sbox.ospath(''),
+ '--config-option',
+ 'config:miscellany:preserved-conflict-file-exts=' +
+ 'c txt h')
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+ svntest.actions.verify_disk(wc_dir, expected_disk)
+
########################################################################
# Run the tests
@@ -19288,6 +19441,8 @@ test_list = [ None,
single_editor_drive_merge_notifications,
conflicted_split_merge_with_resolve,
merge_to_empty_target_merge_to_infinite_target,
+ merge_dir_delete_force,
+ conflict_naming,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/move_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/move_tests.py Tue Apr 29 23:36:43 2014
@@ -1396,6 +1396,74 @@ def move_many_update_add(sbox):
None, None, None,
wc_dir, '--accept', 'mine-conflict')
+@Issue(4437)
+def move_del_moved(sbox):
+ "delete moved node, still a move"
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ sbox.simple_mkdir('A/NEW')
+ sbox.simple_move('A/mu', 'A/NEW/mu')
+ sbox.simple_rm('A/NEW/mu')
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', status='D ')
+ expected_status.add({
+ 'A/NEW' : Item(status='A ', wc_rev='-')
+ })
+
+ # A/mu still reports that it is moved to A/NEW/mu, while it is already
+ # deleted there.
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+def copy_move_commit(sbox):
+ "copy, move and commit"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ #repro
+ # Prepare
+ # - Create folder aaa
+ # - Add file bbb.sql
+ # create table bbb (Id int not null)
+ # - Commit
+ # Repro Issue 2
+ # - Copy folder aaa under same parent folder (i.e. as a sibling). (using Ctrl drag/drop).
+ # Creates Copy of aaa
+ # - Rename Copy of aaa to eee
+ # - Commit
+ # Get error need to update
+ # - Update
+ # - Commit
+ # Get error need to update
+
+ sbox.simple_copy('A/D/G', 'A/D/GG')
+ sbox.simple_move('A/D/GG', 'A/D/GG-moved')
+ sbox.simple_commit('A/D/GG-moved')
+
+
+def move_to_from_external(sbox):
+ "move to and from an external"
+
+ sbox.build()
+ sbox.simple_propset('svn:externals', '^/A/D/G GG', '')
+ sbox.simple_update()
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'move',
+ sbox.ospath('GG/tau'),
+ sbox.ospath('tau'))
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'move',
+ sbox.ospath('iota'),
+ sbox.ospath('GG/tau'))
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'ci', '-m', 'Commit both',
+ sbox.ospath(''),
+ sbox.ospath('GG'))
+
#######################################################################
# Run the tests
@@ -1410,6 +1478,9 @@ test_list = [ None,
move_missing,
move_many_update_delete,
move_many_update_add,
+ move_del_moved,
+ copy_move_commit,
+ move_to_from_external,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/prop_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/prop_tests.py Tue Apr 29 23:36:43 2014
@@ -2612,6 +2612,62 @@ def peg_rev_base_working(sbox):
'propget', '--strict', 'ordinal',
sbox.ospath('iota') + '@BASE')
+def iprops_list_abspath(sbox):
+ "test listing iprops via abspath"
+
+ sbox.build()
+
+ sbox.simple_propset('im', 'root', '')
+ sbox.simple_commit()
+
+ svntest.actions.run_and_verify_svn(None, None, [],
+ 'switch', '^/A/D', sbox.ospath(''),
+ '--ignore-ancestry')
+
+ sbox.simple_propset('im', 'GammA', 'gamma')
+
+ expected_output = [
+ 'Inherited properties on \'%s\',\n' % sbox.ospath('')[:-1],
+ 'from \'%s\':\n' % sbox.repo_url,
+ ' im\n',
+ ' root\n',
+ 'Properties on \'%s\':\n' % sbox.ospath('gamma'),
+ ' im\n',
+ ' GammA\n'
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'pl', '-R',
+ '--show-inherited-props', '-v',
+ sbox.ospath(''))
+
+ expected_output = [
+ 'Inherited properties on \'%s\',\n' % os.path.abspath(sbox.ospath('')),
+ 'from \'%s\':\n' % sbox.repo_url,
+ ' im\n',
+ ' root\n',
+ 'Properties on \'%s\':\n' % os.path.abspath(sbox.ospath('gamma')),
+ ' im\n',
+ ' GammA\n'
+ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'pl', '-R',
+ '--show-inherited-props', '-v',
+ os.path.abspath(sbox.ospath('')))
+
+def wc_propop_on_url(sbox):
+ "perform wc specific operations on url"
+
+ sbox.build(create_wc = False)
+
+ svntest.actions.run_and_verify_svn(None, None, '.*E195000:.*path',
+ 'pl', '-r', 'PREV',
+ sbox.repo_url)
+
+ svntest.actions.run_and_verify_svn(None, None, '.*E195000:.*path',
+ 'pg', 'my:Q', '-r', 'PREV',
+ sbox.repo_url)
+
+
########################################################################
# Run the tests
@@ -2657,6 +2713,8 @@ test_list = [ None,
inheritable_ignores,
almost_known_prop_names,
peg_rev_base_working,
+ iprops_list_abspath,
+ wc_propop_on_url,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/redirect_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/redirect_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/redirect_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/redirect_tests.py Tue Apr 29 23:36:43 2014
@@ -140,6 +140,44 @@ def redirected_update(sbox):
verify_url(wc_dir, sbox.repo_url)
#----------------------------------------------------------------------
+@SkipUnless(svntest.main.is_ra_type_dav)
+def redirected_nonroot_update(sbox):
+ "redirected update of non-repos-root wc"
+
+ sbox.build(create_wc=False)
+ wc_dir = sbox.wc_dir
+ checkout_url = sbox.repo_url + '/A'
+ relocate_url = sbox.redirected_root_url() + '/A'
+
+ # Checkout a subdir of the repository root.
+ exit_code, out, err = svntest.main.run_svn(None, 'co',
+ checkout_url, wc_dir)
+ if err:
+ raise svntest.Failure
+
+ # Relocate (by cheating) the working copy to the redirect URL. When
+ # we then update, we'll expect to find ourselves automagically back
+ # to the original URL. (This is because we can't easily introduce a
+ # redirect to the Apache configuration from the test suite here.)
+ svntest.actions.no_relocate_validation()
+ exit_code, out, err = svntest.main.run_svn(None, 'sw', '--relocate',
+ checkout_url, relocate_url,
+ wc_dir)
+ svntest.actions.do_relocate_validation()
+
+ # Now update the working copy.
+ exit_code, out, err = svntest.main.run_svn(None, 'up', wc_dir)
+ if err:
+ raise svntest.Failure
+ if not re.match("^Updating '.*':", out[0]):
+ raise svntest.Failure
+ if not redirect_regex.match(out[1]):
+ raise svntest.Failure
+
+ # Verify that we have the expected URL.
+ verify_url(wc_dir, checkout_url)
+
+#----------------------------------------------------------------------
########################################################################
# Run the tests
@@ -149,6 +187,7 @@ test_list = [ None,
temporary_redirect,
redirected_checkout,
redirected_update,
+ redirected_nonroot_update,
]
if __name__ == '__main__':
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/svndumpfilter_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/svndumpfilter_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/svndumpfilter_tests.py Tue Apr 29 23:36:43 2014
@@ -559,7 +559,7 @@ def dropped_but_not_renumbered_empty_rev
full_dump_contents = open(full_dump).read()
filtered_dumpfile, filtered_out = filter_and_return_output(
full_dump_contents,
- 8192, # Set a sufficiently large bufsize to avoid a deadlock
+ 16384, # Set a sufficiently large bufsize to avoid a deadlock
"exclude", "branches/B2",
"--skip-missing-merge-sources", "--drop-empty-revs")
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/upgrade_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/upgrade_tests.py Tue Apr 29 23:36:43 2014
@@ -1428,6 +1428,17 @@ def changelist_upgrade_1_6(sbox):
if paths != expected_paths:
raise svntest.Failure("changelist not matched")
+
+def upgrade_1_7_dir_external(sbox):
+ "upgrade from 1.7 with dir external"
+
+ sbox.build(create_wc = False)
+ replace_sbox_with_tarfile(sbox, 'upgrade_1_7_dir_external.tar.bz2')
+
+ # This fails for 'make check EXCLUSIVE_WC_LOCKS=1' giving an error:
+ # svn: warning: W200033: sqlite[S5]: database is locked
+ svntest.actions.run_and_verify_svn(None, None, [], 'upgrade', sbox.wc_dir)
+
########################################################################
# Run the tests
@@ -1483,6 +1494,7 @@ test_list = [ None,
iprops_upgrade,
iprops_upgrade1_6,
changelist_upgrade_1_6,
+ upgrade_1_7_dir_external,
]
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/wc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/wc_tests.py?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/wc_tests.py (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/cmdline/wc_tests.py Tue Apr 29 23:36:43 2014
@@ -118,8 +118,13 @@ def add_with_symlink_in_path(sbox):
sbox.simple_append('A/B/kappa', 'xyz', True)
sbox.simple_add('Z/B/kappa')
+def is_posix_os_and_not_root():
+ if not svntest.main.is_posix_os():
+ return False
+ return os.getuid() != 0
+
@Issue(4118)
-@SkipUnless(svntest.main.is_posix_os)
+@SkipUnless(is_posix_os_and_not_root)
def status_with_inaccessible_wc_db(sbox):
"""inaccessible .svn/wc.db"""
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_repos/repos-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_repos/repos-test.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_repos/repos-test.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_repos/repos-test.c Tue Apr 29 23:36:43 2014
@@ -3261,6 +3261,65 @@ filename_with_control_chars(const svn_te
}
+/* Notification receiver for test_dump_bad_mergeinfo(). This does not
+ need to do anything, it just needs to exist.
+ */
+static void
+dump_r0_mergeinfo_notifier(void *baton,
+ const svn_repos_notify_t *notify,
+ apr_pool_t *scratch_pool)
+{
+}
+
+/* Regression test for part the 'dump' part of issue #4476 "Mergeinfo
+ containing r0 makes svnsync and svnadmin dump fail". */
+static svn_error_t *
+test_dump_r0_mergeinfo(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_repos_t *repos;
+ svn_fs_t *fs;
+ svn_fs_txn_t *txn;
+ svn_fs_root_t *txn_root;
+ svn_revnum_t youngest_rev = 0;
+ const svn_string_t *bad_mergeinfo = svn_string_create("/foo:0", pool);
+
+ SVN_ERR(svn_test__create_repos(&repos, "test-repo-dump-r0-mergeinfo",
+ opts, pool));
+ fs = svn_repos_fs(repos);
+
+ /* Revision 1: Any commit will do, here */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_make_dir(txn_root, "/bar", pool));
+ SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
+ SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
+
+ /* Revision 2: Add bad mergeinfo */
+ SVN_ERR(svn_fs_begin_txn(&txn, fs, youngest_rev, pool));
+ SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+ SVN_ERR(svn_fs_change_node_prop(txn_root, "/bar", "svn:mergeinfo", bad_mergeinfo, pool));
+ SVN_ERR(svn_repos_fs_commit_txn(NULL, repos, &youngest_rev, txn, pool));
+ SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(youngest_rev));
+
+ /* Test that a dump completes without error. In order to exercise the
+ functionality under test -- that is, in order for the dump to try to
+ parse the mergeinfo it is dumping -- the dump must start from a
+ revision greater than 1 and must take a notification callback. */
+ {
+ svn_stringbuf_t *stringbuf = svn_stringbuf_create_empty(pool);
+ svn_stream_t *stream = svn_stream_from_stringbuf(stringbuf, pool);
+
+ SVN_ERR(svn_repos_dump_fs3(repos, stream, 2, SVN_INVALID_REVNUM,
+ FALSE, FALSE,
+ dump_r0_mergeinfo_notifier, NULL,
+ NULL, NULL,
+ pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* The test table. */
struct svn_test_descriptor_t test_funcs[] =
@@ -3306,5 +3365,7 @@ struct svn_test_descriptor_t test_funcs[
"test svn_repos_delete"),
SVN_TEST_OPTS_PASS(filename_with_control_chars,
"test filenames with control characters"),
+ SVN_TEST_OPTS_PASS(test_dump_r0_mergeinfo,
+ "test dumping with r0 mergeinfo"),
SVN_TEST_NULL
};
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_subr/checksum-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_subr/checksum-test.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_subr/checksum-test.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_subr/checksum-test.c Tue Apr 29 23:36:43 2014
@@ -23,7 +23,10 @@
#include <apr_pools.h>
+#include <zlib.h>
+
#include "svn_error.h"
+#include "svn_io.h"
#include "private/svn_pseudo_md5.h"
#include "../svn_test.h"
@@ -155,6 +158,87 @@ zero_match(apr_pool_t *pool)
return SVN_NO_ERROR;
}
+static svn_error_t *
+zlib_expansion_test(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ const char *data_path;
+ svn_stringbuf_t *deflated;
+ Byte dst_buffer[256 * 1024];
+ Byte *src_buffer;
+ apr_size_t sz;
+
+ data_path = svn_dirent_join(opts->srcdir, "zlib.deflated", pool);
+
+ SVN_ERR(svn_stringbuf_from_file2(&deflated, data_path, pool));
+ src_buffer = (Byte*)deflated->data;
+
+ /* Try to decompress the same data with different blocksizes */
+ for (sz = 1; sz < 256; sz++)
+ {
+ z_stream stream;
+ memset(&stream, 0, sizeof(stream));
+ inflateInit2(&stream, -15 /* DEFLATE_WINDOW_SIZE */);
+
+ stream.avail_in = sz;
+ stream.next_in = src_buffer;
+ stream.avail_out = sizeof(dst_buffer);
+ stream.next_out = dst_buffer;
+
+ do
+ {
+ int zr = inflate(&stream, Z_NO_FLUSH);
+
+ if (zr != Z_OK && zr != Z_STREAM_END)
+ {
+ return svn_error_createf(
+ SVN_ERR_TEST_FAILED, NULL,
+ "Failure decompressing with blocksize %d", (int)sz);
+ }
+ stream.avail_in += sz;
+ } while (stream.next_in + stream.avail_in < src_buffer + deflated->len);
+
+ stream.avail_in = (src_buffer + deflated->len) - stream.next_in;
+
+ {
+ int zr = inflate(&stream, Z_NO_FLUSH);
+
+ if (zr != Z_STREAM_END)
+ {
+ return svn_error_createf(
+ SVN_ERR_TEST_FAILED, NULL,
+ "Final flush failed with blocksize %d", (int)sz);
+ }
+
+ zr = inflateEnd(&stream);
+
+ if (zr != Z_OK)
+ {
+ return svn_error_createf(
+ SVN_ERR_TEST_FAILED, NULL,
+ "End of stream handling failed with blocksize %d",
+ (int)sz);
+ }
+ }
+
+ {
+ apr_uint32_t crc = crc32(0, dst_buffer, stream.total_out);
+
+ if (stream.total_out != 242014 || crc != 0x8f03d934)
+ {
+ return svn_error_createf(
+ SVN_ERR_TEST_FAILED, NULL,
+ "Decompressed data doesn't match expected size or crc with "
+ "blocksize %d: Found crc32=0x%08x, size=%d.\n"
+ "Verify your ZLib installation, as this should never happen",
+ (int)sz, (unsigned)crc, (int)stream.total_out);
+ }
+ }
+ }
+
+ return SVN_NO_ERROR;
+}
+
/* An array of all test functions */
struct svn_test_descriptor_t test_funcs[] =
{
@@ -167,5 +251,7 @@ struct svn_test_descriptor_t test_funcs[
"pseudo-md5 compatibility"),
SVN_TEST_PASS2(zero_match,
"zero checksum matching"),
+ SVN_TEST_OPTS_PASS(zlib_expansion_test,
+ "zlib expansion test (zlib regression)"),
SVN_TEST_NULL
};
Modified: subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1591144&r1=1591143&r2=1591144&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/branches/1.8.x-r1536931/subversion/tests/libsvn_wc/conflict-data-test.c Tue Apr 29 23:36:43 2014
@@ -740,7 +740,7 @@ test_prop_conflicts(const svn_test_opts_
svn_error_t *err;
const char *lock_abspath;
test_prop_conflict_baton_t *b = apr_pcalloc(pool, sizeof(*b));
- svn_wc_conflict_description2_t *desc = apr_pcalloc(pool, sizeof(*b));
+ svn_wc_conflict_description2_t *desc = apr_pcalloc(pool, sizeof(*desc));
SVN_ERR(svn_test__sandbox_create(&sbox, "test_prop_conflicts", opts, pool));