Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A2D401758F for ; Sun, 22 Feb 2015 16:52:15 +0000 (UTC) Received: (qmail 71751 invoked by uid 500); 22 Feb 2015 16:52:10 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 71597 invoked by uid 500); 22 Feb 2015 16:52:10 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 71337 invoked by uid 99); 22 Feb 2015 16:52:10 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Feb 2015 16:52:10 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 1C2EBAC0722 for ; Sun, 22 Feb 2015 16:52:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1661492 [5/7] - in /subversion/branches/move-tracking-2: ./ build/ build/generator/ subversion/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/tests/org/apache/sub... Date: Sun, 22 Feb 2015 16:52:07 -0000 To: commits@subversion.apache.org From: julianfoad@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150222165210.1C2EBAC0722@hades.apache.org> Modified: subversion/branches/move-tracking-2/subversion/svn/blame-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/blame-cmd.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/blame-cmd.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/blame-cmd.c Sun Feb 22 16:52:05 2015 @@ -31,6 +31,7 @@ #include "svn_pools.h" #include "svn_props.h" #include "svn_cmdline.h" +#include "svn_sorts.h" #include "svn_xml.h" #include "svn_time.h" #include "cl.h" @@ -42,6 +43,8 @@ typedef struct blame_baton_t svn_cl__opt_state_t *opt_state; svn_stream_t *out; svn_stringbuf_t *sbuf; + + int rev_maxlength; } blame_baton_t; @@ -63,9 +66,9 @@ blame_receiver_xml(void *baton, svn_boolean_t local_change, apr_pool_t *pool) { - svn_cl__opt_state_t *opt_state = - ((blame_baton_t *) baton)->opt_state; - svn_stringbuf_t *sb = ((blame_baton_t *) baton)->sbuf; + blame_baton_t *bb = baton; + svn_cl__opt_state_t *opt_state = bb->opt_state; + svn_stringbuf_t *sb = bb->sbuf; /* "" */ /* line_no is 0-based, but the rest of the world is probably Pascal @@ -119,23 +122,13 @@ print_line_info(svn_stream_t *out, const char *date, const char *path, svn_boolean_t verbose, - svn_revnum_t end_revnum, + int rev_maxlength, apr_pool_t *pool) { const char *time_utf8; const char *time_stdout; const char *rev_str; - int rev_maxlength; - /* The standard column width for the revision number is 6 characters. - If the revision number can potentially be larger (i.e. if the end_revnum - is larger than 1000000), we increase the column width as needed. */ - rev_maxlength = 6; - while (end_revnum >= 1000000) - { - rev_maxlength++; - end_revnum = end_revnum / 10; - } rev_str = SVN_IS_VALID_REVNUM(revision) ? apr_psprintf(pool, "%*ld", rev_maxlength, revision) : apr_psprintf(pool, "%*s", rev_maxlength, "-"); @@ -189,11 +182,26 @@ blame_receiver(void *baton, svn_boolean_t local_change, apr_pool_t *pool) { - svn_cl__opt_state_t *opt_state = - ((blame_baton_t *) baton)->opt_state; - svn_stream_t *out = ((blame_baton_t *)baton)->out; + blame_baton_t *bb = baton; + svn_cl__opt_state_t *opt_state = bb->opt_state; + svn_stream_t *out = bb->out; svn_boolean_t use_merged = FALSE; + if (!bb->rev_maxlength) + { + svn_revnum_t max_revnum = MAX(start_revnum, end_revnum); + /* The standard column width for the revision number is 6 characters. + If the revision number can potentially be larger (i.e. if the end_revnum + is larger than 1000000), we increase the column width as needed. */ + + bb->rev_maxlength = 6; + while (max_revnum >= 1000000) + { + bb->rev_maxlength++; + max_revnum = max_revnum / 10; + } + } + if (opt_state->use_merge_history) { /* Choose which revision to use. If they aren't equal, prefer the @@ -216,7 +224,8 @@ blame_receiver(void *baton, SVN_PROP_REVISION_AUTHOR), svn_prop_get_value(merged_rev_props, SVN_PROP_REVISION_DATE), - merged_path, opt_state->verbose, end_revnum, + merged_path, opt_state->verbose, + bb->rev_maxlength, pool)); else SVN_ERR(print_line_info(out, revision, @@ -224,7 +233,8 @@ blame_receiver(void *baton, SVN_PROP_REVISION_AUTHOR), svn_prop_get_value(rev_props, SVN_PROP_REVISION_DATE), - NULL, opt_state->verbose, end_revnum, + NULL, opt_state->verbose, + bb->rev_maxlength, pool)); return svn_stream_printf(out, pool, "%s%s", line, APR_EOL_STR); @@ -286,6 +296,7 @@ svn_cl__blame(apr_getopt_t *os, bl.sbuf = svn_stringbuf_create_empty(pool); bl.opt_state = opt_state; + bl.rev_maxlength = 0; subpool = svn_pool_create(pool); Modified: subversion/branches/move-tracking-2/subversion/svn/changelist-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/changelist-cmd.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/changelist-cmd.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/changelist-cmd.c Sun Feb 22 16:52:05 2015 @@ -72,25 +72,7 @@ svn_cl__changelist(apr_getopt_t *os, SVN_ERR(svn_cl__check_targets_are_local_paths(targets)); if (opt_state->quiet) - /* FIXME: This is required because svn_client_create_context() - always initializes ctx->notify_func2 to a wrapper function - which calls ctx->notify_func() if it isn't NULL. In other - words, typically, ctx->notify_func2 is never NULL. This isn't - usually a problem, but the changelist logic generates - svn_error_t's as part of its notification. - - So, svn_wc_set_changelist() checks its notify_func (our - ctx->notify_func2) for NULL-ness, and seeing non-NULL-ness, - generates a notificaton object and svn_error_t to describe some - problem. It passes that off to its notify_func (our - ctx->notify_func2) which drops the notification on the floor - (because it wraps a NULL ctx->notify_func). But svn_error_t's - dropped on the floor cause SEGFAULTs at pool cleanup time -- - they need instead to be cleared. - - SOOOooo... we set our ctx->notify_func2 to NULL so the WC code - doesn't even generate the errors. */ - ctx->notify_func2 = NULL; + ctx->notify_func2 = NULL; /* Easy out: avoid unneeded work */ if (depth == svn_depth_unknown) depth = svn_depth_empty; Modified: subversion/branches/move-tracking-2/subversion/svn/cl.h URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/cl.h?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/cl.h (original) +++ subversion/branches/move-tracking-2/subversion/svn/cl.h Sun Feb 22 16:52:05 2015 @@ -297,8 +297,7 @@ svn_opt_subcommand_t svn_cl__switch, svn_cl__unlock, svn_cl__update, - svn_cl__upgrade, - svn_cl__youngest; + svn_cl__upgrade; /* See definition in svn.c for documentation. */ Modified: subversion/branches/move-tracking-2/subversion/svn/commit-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/commit-cmd.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/commit-cmd.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/commit-cmd.c Sun Feb 22 16:52:05 2015 @@ -137,7 +137,9 @@ svn_cl__commit(apr_getopt_t *os, if (opt_state->depth == svn_depth_unknown) opt_state->depth = svn_depth_infinity; - cfg = svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG); + cfg = ctx->config + ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG) + : NULL; if (cfg) SVN_ERR(svn_config_get_bool(cfg, &no_unlock, SVN_CONFIG_SECTION_MISCELLANY, Modified: subversion/branches/move-tracking-2/subversion/svn/copy-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/copy-cmd.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/copy-cmd.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/copy-cmd.c Sun Feb 22 16:52:05 2015 @@ -169,6 +169,7 @@ svn_cl__copy(apr_getopt_t *os, err = svn_client_copy7(sources, dst_path, TRUE, opt_state->parents, opt_state->ignore_externals, + FALSE /* metadata_only */, opt_state->pin_externals, NULL, /* pin all externals */ opt_state->revprop_table, Modified: subversion/branches/move-tracking-2/subversion/svn/diff-cmd.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/diff-cmd.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/diff-cmd.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/diff-cmd.c Sun Feb 22 16:52:05 2015 @@ -344,7 +344,7 @@ svn_cl__diff(apr_getopt_t *os, { ignore_content_type = TRUE; } - else + else if (ctx->config) { SVN_ERR(svn_config_get_bool(svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG), @@ -353,6 +353,10 @@ svn_cl__diff(apr_getopt_t *os, SVN_CONFIG_OPTION_DIFF_IGNORE_CONTENT_TYPE, FALSE)); } + else + { + ignore_content_type = FALSE; + } svn_opt_push_implicit_dot_target(targets, pool); Modified: subversion/branches/move-tracking-2/subversion/svn/status.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/status.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/status.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/status.c Sun Feb 22 16:52:05 2015 @@ -138,37 +138,38 @@ generate_status_desc(enum svn_wc_status_ /* Make a relative path containing '..' elements as needed. TARGET_ABSPATH shall be the absolute version of TARGET_PATH. - TARGET_ABSPATH, TARGET_PATH and PATH shall be canonical. + TARGET_ABSPATH, TARGET_PATH and LOCAL_ABSPATH shall be canonical If above conditions are met, a relative path that leads to PATH from TARGET_PATH is returned, but there is no error checking involved. The returned path is allocated from RESULT_POOL, all other - allocations are made in SCRATCH_POOL. */ + allocations are made in SCRATCH_POOL. + + Note that it is not possible to just join the resulting path to + reconstruct the real path as the "../" paths are relative from + a different base than the normal relative paths! + */ static const char * make_relpath(const char *target_abspath, const char *target_path, - const char *path, + const char *local_abspath, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { const char *la; const char *parent_dir_els = ""; - const char *abspath, *relative; - svn_error_t *err = svn_dirent_get_absolute(&abspath, path, scratch_pool); + const char *t_relpath; + const char *p_relpath; - if (err) - { - /* We probably got passed some invalid path. */ - svn_error_clear(err); - return apr_pstrdup(result_pool, path); - } +#ifdef SVN_DEBUG + SVN_ERR_ASSERT_NO_RETURN(svn_dirent_is_absolute(local_abspath)); +#endif - relative = svn_dirent_skip_ancestor(target_abspath, abspath); - if (relative) - { - return svn_dirent_join(target_path, relative, result_pool); - } + t_relpath = svn_dirent_skip_ancestor(target_abspath, local_abspath); + + if (t_relpath) + return svn_dirent_join(target_path, t_relpath, result_pool); /* An example: * relative_to_path = /a/b/c @@ -180,17 +181,16 @@ make_relpath(const char *target_abspath, * path = C:/wc * result = C:/wc */ - /* Skip the common ancestor of both paths, here '/a'. */ - la = svn_dirent_get_longest_ancestor(target_abspath, abspath, + la = svn_dirent_get_longest_ancestor(target_abspath, local_abspath, scratch_pool); if (*la == '\0') { /* Nothing in common: E.g. C:/ vs F:/ on Windows */ - return apr_pstrdup(result_pool, path); + return apr_pstrdup(result_pool, local_abspath); } - relative = svn_dirent_skip_ancestor(la, target_abspath); - path = svn_dirent_skip_ancestor(la, path); + t_relpath = svn_dirent_skip_ancestor(la, target_abspath); + p_relpath = svn_dirent_skip_ancestor(la, local_abspath); /* In above example, we'd now have: * relative_to_path = b/c @@ -198,14 +198,14 @@ make_relpath(const char *target_abspath, /* Count the elements of relative_to_path and prepend as many '..' elements * to path. */ - while (*relative) + while (*t_relpath) { - svn_dirent_split(&relative, NULL, relative, - scratch_pool); + t_relpath = svn_dirent_dirname(t_relpath, scratch_pool); parent_dir_els = svn_dirent_join(parent_dir_els, "..", scratch_pool); } - return svn_dirent_join(parent_dir_els, path, result_pool); + /* This returns a ../ style path relative from the status target */ + return svn_dirent_join(parent_dir_els, p_relpath, result_pool); } @@ -232,8 +232,6 @@ print_status(const char *target_abspath, const char *moved_from_line = ""; const char *moved_to_line = ""; - path = make_relpath(target_abspath, target_path, 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. @@ -487,8 +485,6 @@ svn_cl__print_status_xml(const char *tar SVN_ERR(svn_wc_conflicted_p3(NULL, NULL, &tree_conflicted, ctx->wc_ctx, local_abspath, pool)); - path = make_relpath(target_abspath, target_path, path, pool, pool); - svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "entry", "path", svn_dirent_local_style(path, pool), SVN_VA_NULL); Modified: subversion/branches/move-tracking-2/subversion/svn/svn.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/svn.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/svn.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/svn.c Sun Feb 22 16:52:05 2015 @@ -507,12 +507,27 @@ const svn_opt_subcommand_desc2_t svn_cl_ }, { "blame", svn_cl__blame, {"praise", "annotate", "ann"}, N_ - ("Output the content of specified files or\n" - "URLs with revision and author information in-line.\n" - "usage: blame TARGET[@REV]...\n" + ("Show when each line of a file was last (or\n" + "next) changed.\n" + "usage: blame [-rM:N] TARGET[@REV]...\n" + "\n" + " Annotate each line of a file with the revision number and author of the\n" + " last change (or optionally the next change) to that line.\n" + "\n" + " With no revision range (same as -r0:REV), or with '-r M:N' where M < N,\n" + " annotate each line that is present in revision N of the file, with\n" + " the last revision at or before rN that changed or added the line,\n" + " looking back no further than rM.\n" + "\n" + " With a reverse revision range '-r M:N' where M > N,\n" + " annotate each line that is present in revision N of the file, with\n" + " the next revision after rN that changed or deleted the line,\n" + " looking forward no further than rM.\n" "\n" " If specified, REV determines in which revision the target is first\n" - " looked up.\n"), + " looked up.\n" + "\n" + " Write the annotated result to standard output.\n"), {'r', 'v', 'g', opt_incremental, opt_xml, 'x', opt_force} }, { "cat", svn_cl__cat, {0}, N_ @@ -1723,14 +1738,6 @@ const svn_opt_subcommand_desc2_t svn_cl_ " Local modifications are preserved.\n"), { 'q' } }, - { "youngest", svn_cl__youngest, {0}, N_ - ("Print the youngest revision number of a target's repository.\n" - "usage: youngest [TARGET]\n" - "\n" - " Print the revision number of the youngest revision in the repository\n" - " with which TARGET is associated.\n"), - { opt_no_newline } }, - { NULL, NULL, {0}, NULL, {0} } }; Modified: subversion/branches/move-tracking-2/subversion/svn/util.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svn/util.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/svn/util.c (original) +++ subversion/branches/move-tracking-2/subversion/svn/util.c Sun Feb 22 16:52:05 2015 @@ -204,7 +204,7 @@ svn_cl__make_log_msg_baton(void **baton, apr_hash_t *config, apr_pool_t *pool) { - struct log_msg_baton *lmb = apr_palloc(pool, sizeof(*lmb)); + struct log_msg_baton *lmb = apr_pcalloc(pool, sizeof(*lmb)); if (opt_state->filedata) { @@ -237,6 +237,8 @@ svn_cl__make_log_msg_baton(void **baton, SVN_CONFIG_OPTION_LOG_ENCODING, NULL); } + else + lmb->message_encoding = NULL; lmb->base_dir = base_dir ? base_dir : ""; lmb->tmpfile_left = NULL; Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/README URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/README?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/README (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/README Sun Feb 22 16:52:05 2015 @@ -180,8 +180,8 @@ or if you're running an individual test, $ ./basic_tests.py --url=svn://localhost --enable-sasl 3 -Note that to do this you'll have to have a subversion.conf file in your -SASL lib dir (i.e. something like /usr/lib/sasl2/subversion.conf), it +Note that to do this you'll have to have a svn.conf file in your +SASL lib dir (i.e. something like /usr/lib/sasl2/svn.conf), it should contain something like: pwcheck_method: auxprop @@ -195,6 +195,16 @@ $ saslpasswd2 -c -u svntest jconstant As usual, both users should use the password 'rayjandom'. +To enable DUMP_LOAD_CROSS_CHECK to work a third user is required, + +$ saslpasswd2 -c -u svntest __dumpster__ + +with password '__loadster__'. + +The user running the tests will need read access to the sasl database +and on some systems this can be arranged by adding the user to the sasl +group. + There are 'make svnserveautocheck' and ./svnserveautocheck.sh commands, analogous to davautocheck.sh documented above. Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/basic_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/basic_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/basic_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/basic_tests.py Sun Feb 22 16:52:05 2015 @@ -3083,32 +3083,6 @@ def peg_rev_on_non_existent_wc_path(sbox 'cat', '-r2', sbox.ospath('mu3') + '@3') -@Issue(4299) -def basic_youngest(sbox): - 'basic youngest' - - sbox.build(read_only=True) - - repos_url = sbox.repo_url - deep_repos_url = repos_url + '/A/D/G' - - wc_dir = sbox.wc_dir - deep_wc_dir = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha') - bad_wc_dir = os.path.join(wc_dir, 'Z') - - svntest.actions.run_and_verify_svn(None, svntest.verify.AnyOutput, - 'youngest', bad_wc_dir) - - for flag, output in [(False, "1\n"), (True, "1")]: - for path in [repos_url, deep_repos_url, wc_dir, deep_wc_dir]: - if flag: - svntest.actions.run_and_verify_svn([output], [], - 'youngest', '--no-newline', path) - else: - svntest.actions.run_and_verify_svn([output], [], - 'youngest', path) - - # With 'svn mkdir --parents' the target directory may already exist on disk. # In that case it was wrongly performing a recursive 'add' on its contents. def mkdir_parents_target_exists_on_disk(sbox): @@ -3202,7 +3176,6 @@ test_list = [ None, rm_missing_with_case_clashing_ondisk_item, delete_conflicts_one_of_many, peg_rev_on_non_existent_wc_path, - basic_youngest, mkdir_parents_target_exists_on_disk, ] Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/blame_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/blame_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/blame_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/blame_tests.py Sun Feb 22 16:52:05 2015 @@ -748,7 +748,7 @@ def blame_output_after_merge(sbox): # Next test with the -g option with -rN:M expected_output = [ " - - New version of file 'mu'.\n", " - - 2nd line in file 'mu'.\n", - "G - - new 3rd line in file 'mu'.\n", + "G 5 jrandom new 3rd line in file 'mu'.\n", "G 6 jrandom add 3.5 line in file 'mu'.\n", " - - 4th line in file 'mu'.\n", " - - 5th line in file 'mu'.\n", @@ -950,23 +950,115 @@ def blame_youngest_to_oldest(sbox): orig_line = open(iota).read() line = "New contents for iota\n" svntest.main.file_append(iota, line) - sbox.simple_commit() + sbox.simple_commit() #r2 # Move the file, to check that the operation will peg correctly. iota_moved = sbox.ospath('iota_moved') sbox.simple_move('iota', 'iota_moved') - sbox.simple_commit() + sbox.simple_commit() #r3 # Delete a line. open(iota_moved, 'w').write(line) - sbox.simple_commit() + sbox.simple_commit() #r4 expected_output = [ - ' %d jrandom %s\n' % (3, orig_line[:-1]), + ' %d jrandom %s\n' % (4, orig_line[:-1]), ] svntest.actions.run_and_verify_svn(expected_output, [], 'blame', '-r4:1', iota_moved) + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:1', iota_moved) + + expected_output = [ + ' %d jrandom %s\n' % (2, line[:-1]), + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-r1:HEAD', iota_moved) + +@Issue(4467) +def blame_reverse_no_change(sbox): + "blame reverse towards a revision with no change" + + sbox.build() + + # Introduce a revision where iota doesn't change! + sbox.simple_propset('a', 'b', 'A') + sbox.simple_commit('') #r2 + + sbox.simple_append('iota', 'new line\n') + sbox.simple_commit('') #r3 + + sbox.simple_append('iota', 'another new line\n') + sbox.simple_commit('') #r4 + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 3 jrandom new line\n', + ' 4 jrandom another new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-r2:HEAD', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ] + # This used to trigger an assertion on 1.9.x before 1.9.0 + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:2', sbox.ospath('iota')) + + # Drop the middle line + sbox.simple_append('iota', 'This is the file \'iota\'.\n' + 'another new line\n', truncate=True) + sbox.simple_commit('') #r5 + + # Back to start + sbox.simple_append('iota', 'This is the file \'iota\'.\n', truncate=True) + sbox.simple_commit('') #r6 + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:2', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 5 jrandom new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:3', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 5 jrandom new line\n', + ' 6 jrandom another new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:4', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 6 jrandom another new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:5', sbox.ospath('iota')) + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-rHEAD:6', sbox.ospath('iota')) + + + expected_output = [ + ' - - This is the file \'iota\'.\n', + ' 5 jrandom new line\n', + ] + svntest.actions.run_and_verify_svn(expected_output, [], + 'blame', '-r5:3', sbox.ospath('iota')) + + ######################################################################## # Run the tests @@ -991,6 +1083,7 @@ test_list = [ None, blame_multiple_targets, blame_eol_handling, blame_youngest_to_oldest, + blame_reverse_no_change, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/copy_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/copy_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/copy_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/copy_tests.py Sun Feb 22 16:52:05 2015 @@ -1005,8 +1005,7 @@ def repos_to_wc(sbox): expected_output = svntest.actions.get_virginal_state(wc_dir, 1) expected_output.add({ - 'pi' : Item(status='A ', wc_rev='0', entry_rev='1'), - # And from the foreign repository + 'pi' : Item(status='A ', wc_rev='0'), 'E' : Item(status='A ', wc_rev='0'), 'E/beta' : Item(status='A ', wc_rev='0'), 'E/alpha' : Item(status='A ', wc_rev='0'), @@ -5430,6 +5429,13 @@ def copy_and_move_conflicts(sbox): 'D/G/pi', 'D/G/rho', 'D/G/tau') + expected_status.tweak('B', moved_from='../A/B') + expected_status.tweak('D', moved_from='../A/D') + expected_status.tweak('H', moved_from='D/H') + expected_status.tweak('Q', moved_from='../A/Q') + expected_status.tweak('D/H', moved_to='H') + expected_status.tweak('alpha', moved_from='B/E/alpha') + expected_status.tweak('B/E/alpha', moved_to='alpha') svntest.actions.run_and_verify_status(wc('move-dest'), expected_status) expected_disk = svntest.wc.State('', { Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/depth_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/depth_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/depth_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/depth_tests.py Sun Feb 22 16:52:05 2015 @@ -2886,6 +2886,82 @@ def spurious_nodes_row(sbox): # ra_neon added a spurious not-present row that does not show up in status raise svntest.Failure("count changed from '%s' to '%s'" % (val1, val2)) +def commit_excluded(sbox): + "commit an excluded node" + + sbox.build() + wc_dir = sbox.wc_dir + + expected_output = svntest.wc.State(wc_dir, { + 'A/D/G' : Item(status='D '), + }) + expected_status = svntest.actions.get_virginal_state(wc_dir, 1) + expected_status.remove('A/D/G', 'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau') + + svntest.actions.run_and_verify_update(wc_dir, + expected_output, + None, + expected_status, + None, None, None, None, None, False, + "--set-depth=exclude", + sbox.ospath('A/D/G')) + + sbox.simple_copy('A/D', 'D') + + expected_output = svntest.wc.State(wc_dir, { + 'D' : Item(verb='Adding'), + }) + + expected_status.add({ + 'D' : Item(status=' ', wc_rev='2'), + 'D/H' : Item(status=' ', wc_rev='2'), + 'D/H/chi' : Item(status=' ', wc_rev='2'), + 'D/H/psi' : Item(status=' ', wc_rev='2'), + 'D/H/omega' : Item(status=' ', wc_rev='2'), + 'D/gamma' : Item(status=' ', wc_rev='2') + }) + + svntest.actions.run_and_verify_commit(wc_dir, + expected_output, + expected_status, + None, wc_dir) + + expected_output = svntest.wc.State(wc_dir, { + 'A/D/G' : Item(status='A '), + 'A/D/G/pi' : Item(status='A '), + 'A/D/G/tau' : Item(status='A '), + 'A/D/G/rho' : Item(status='A '), + 'D/G' : Item(status='A '), + 'D/G/pi' : Item(status='A '), + 'D/G/tau' : Item(status='A '), + 'D/G/rho' : Item(status='A ') + }) + + expected_status.tweak(wc_rev=2) + + expected_status.add({ + 'D' : Item(status=' ', wc_rev='2'), + 'D/G' : Item(status=' ', wc_rev='2'), + 'D/G/pi' : Item(status=' ', wc_rev='2'), + 'D/G/rho' : Item(status=' ', wc_rev='2'), + 'D/G/tau' : Item(status=' ', wc_rev='2'), + 'D/H' : Item(status=' ', wc_rev='2'), + 'D/H/chi' : Item(status=' ', wc_rev='2'), + 'D/H/psi' : Item(status=' ', wc_rev='2'), + 'D/H/omega' : Item(status=' ', wc_rev='2'), + 'D/gamma' : Item(status=' ', wc_rev='2'), + 'A/D/G' : Item(status=' ', wc_rev='2'), + 'A/D/G/rho' : Item(status=' ', wc_rev='2'), + 'A/D/G/tau' : Item(status=' ', wc_rev='2'), + 'A/D/G/pi' : Item(status=' ', wc_rev='2') + }) + + svntest.actions.run_and_verify_update(wc_dir, + expected_output, + None, + expected_status, + None, None, None, None, None, False, + "--set-depth=infinity", wc_dir) #---------------------------------------------------------------------- # list all tests here, starting with None: @@ -2937,6 +3013,7 @@ test_list = [ None, commit_then_immediates_update, revert_depth_files, spurious_nodes_row, + commit_excluded, ] if __name__ == "__main__": Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn--help_stdout Sun Feb 22 16:52:05 2015 @@ -46,7 +46,6 @@ Available subcommands: unlock update (up) upgrade - youngest Subversion is a tool for version control. For additional information, see http://subversion.apache.org/ Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests_data/svn_help_stdout Sun Feb 22 16:52:05 2015 @@ -46,7 +46,6 @@ Available subcommands: unlock update (up) upgrade - youngest Subversion is a tool for version control. For additional information, see http://subversion.apache.org/ Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/info_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/info_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/info_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/info_tests.py Sun Feb 22 16:52:05 2015 @@ -591,6 +591,51 @@ def relpath_escaping(sbox): svntest.actions.run_and_verify_update(wc_dir, expected_output, None, None) +def node_hidden_info(sbox): + "fetch svn info on 'hidden' nodes" + + sbox.build() + + sbox.simple_rm('A/B/E/alpha') + sbox.simple_commit() + svntest.actions.run_and_verify_svn(None, [], + 'up', '--set-depth', 'exclude', + sbox.ospath('A/B/E/beta')) + + sbox.simple_copy('A/B/E', 'E') + + # Running info on BASE not-present fails + expected_err = '.*(E|W)155010: The node \'.*alpha\' was not found.*' + svntest.actions.run_and_verify_svn(None, expected_err, + 'info', sbox.ospath('A/B/E/alpha')) + + expected_info = [ + { + 'Path': re.escape(sbox.ospath('A/B/E/beta')), + 'Schedule': 'normal', + 'Depth': 'exclude', + 'Node Kind': 'file', + }, + { + 'Path': re.escape(sbox.ospath('E/alpha')), + 'Schedule': 'delete', + 'Depth': 'exclude', + 'Node Kind': 'unknown', + }, + { + 'Path': re.escape(sbox.ospath('E/beta')), + 'Schedule': 'normal', + 'Depth': 'exclude', + 'Node Kind': 'file', + } + ] + + svntest.actions.run_and_verify_info(expected_info, + sbox.ospath('A/B/E/beta'), + sbox.ospath('E/alpha'), + sbox.ospath('E/beta')) + + ######################################################################## # Run the tests @@ -606,6 +651,7 @@ test_list = [ None, info_show_exclude, binary_tree_conflict, relpath_escaping, + node_hidden_info, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/lock_tests.py Sun Feb 22 16:52:05 2015 @@ -1997,7 +1997,6 @@ def failing_post_hooks(sbox): 'unlock', pi_path) svntest.actions.run_and_verify_status(wc_dir, expected_status) -@XFail() def break_delete_add(sbox): "break a lock, delete and add the file" @@ -2384,22 +2383,20 @@ def delete_dir_with_lots_of_locked_files nfiles = 75 # NOTE: test XPASSES with 50 files!!! locked_paths = [] for i in range(nfiles): - locked_paths.append("A/locked_files/file-%i" % i) + locked_paths.append(sbox.ospath("A/locked_files/file-%i" % i)) # Create files at these paths os.mkdir(sbox.ospath("A/locked_files")) for file_path in locked_paths: - svntest.main.file_write(sbox.ospath(file_path), "This is a file\n") + svntest.main.file_write(file_path, "This is '%s'.\n" % (file_path,)) sbox.simple_add("A/locked_files") sbox.simple_commit() sbox.simple_update() # lock all the files - for file_path in locked_paths: - svntest.actions.run_and_verify_svn(None, [], 'lock', - '--username', 'jrandom', - '-m', 'lock %s' % file_path, - sbox.ospath(file_path)) + svntest.actions.run_and_verify_svn(None, [], 'lock', + '-m', 'All locks', + *locked_paths) # Locally delete A sbox.simple_rm("A") @@ -2411,6 +2408,62 @@ def delete_dir_with_lots_of_locked_files # This problem was introduced on the 1.8.x branch in r1606976. sbox.simple_commit() +def delete_locks_on_depth_commit(sbox): + "delete locks on depth-limited commit" + + sbox.build() + wc_dir = sbox.wc_dir + + svntest.actions.run_and_verify_svn(None, [], 'lock', + '-m', 'All files', + *(sbox.ospath(x) + for x in ['iota', 'A/B/E/alpha', + 'A/B/E/beta', 'A/B/lambda', + 'A/D/G/pi', 'A/D/G/rho', + 'A/D/G/tau', 'A/D/H/chi', + 'A/D/H/omega', 'A/D/H/psi', + 'A/D/gamma', 'A/mu'])) + + sbox.simple_rm("A") + + expected_output = svntest.wc.State(wc_dir, { + 'A' : Item(verb='Deleting'), + }) + + expected_status = svntest.wc.State(wc_dir, { + '' : Item(status=' ', wc_rev='1'), + 'iota' : Item(status=' ', wc_rev='1'), + }) + + svntest.actions.run_and_verify_commit(wc_dir, expected_output, + expected_status, [], + wc_dir, '--depth', 'immediates') + + sbox.simple_update() # r2 + + svntest.actions.run_and_verify_svn(None, [], 'cp', + sbox.repo_url + '/A@1', sbox.ospath('A')) + + expected_output = [ + 'Adding %s\n' % sbox.ospath('A'), + 'svn: The depth of this commit is \'immediates\', but copies ' \ + 'are always performed recursively in the repository.\n', + 'Committing transaction...\n', + 'Committed revision 3.\n', + ] + + # Verifying the warning line... so can't use verify_commit() + svntest.actions.run_and_verify_svn(expected_output, [], + 'commit', wc_dir, '--depth', 'immediates', + '-mm') + + # Verify that all locks are gone at the server and at the client + expected_status = svntest.actions.get_virginal_state(wc_dir, 3) + expected_status.tweak('', 'iota', wc_rev=2) + svntest.actions.run_and_verify_status(wc_dir, expected_status) + + + ######################################################################## # Run the tests @@ -2477,6 +2530,7 @@ test_list = [ None, lock_commit_bump, copy_dir_with_locked_file, delete_dir_with_lots_of_locked_files, + delete_locks_on_depth_commit, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/log_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/log_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/log_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/log_tests.py Sun Feb 22 16:52:05 2015 @@ -2618,6 +2618,77 @@ def merge_sensitive_log_xml_reverse_merg svntest.actions.run_and_verify_log_xml(expected_log_attrs=log_attrs, args=['-g', '-r8', D_COPY_path]) +def log_revision_move_copy(sbox): + "log revision handling over move/copy" + + sbox.build() + + sbox.simple_move('iota', 'iotb') + sbox.simple_append('iotb', 'new line\n') + + sbox.simple_copy('A/mu', 'mutb') + sbox.simple_append('mutb', 'mutb\n') + + sbox.simple_move('A/B/E', 'E') + sbox.simple_move('E/alpha', 'alpha') + + #r2 + svntest.actions.run_and_verify_svn(None, [], + 'rm', sbox.repo_url + '/A/D', '-mm') + + sbox.simple_commit() #r3 + + # This introduces a copy and a move in r3, but check how the history + # of these nodes behaves in r2. + + # This one might change behavior once we improve move handling + expected_output = [ + '------------------------------------------------------------------------\n' + ] + expected_err = [] + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'log', '-v',sbox.ospath('iotb'), + '-r2') + + # While this one + expected_output = [] + expected_err = '.*E195012: Unable to find repository location.*' + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'log', '-v', sbox.ospath('mutb'), + '-r2') + + # And just for fun, do the same thing for blame + expected_output = [ + ' 1 jrandom This is the file \'iota\'.\n' + ] + expected_err = [] + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'blame', sbox.ospath('iotb'), + '-r2') + + expected_output = None + expected_err = '.*E195012: Unable to find repository location.*' + svntest.actions.run_and_verify_svn(expected_output, expected_err, + 'blame', sbox.ospath('mutb'), + '-r2') + + expected_output = svntest.verify.RegexListOutput([ + '-+\\n', + 'r3\ .*\n', + re.escape('Changed paths:\n'), + re.escape(' D /A/B/E\n'), + re.escape(' A /E (from /A/B/E:2)\n'), # Patched - Direct move + re.escape(' D /E/alpha\n'), + re.escape(' A /alpha (from /A/B/E/alpha:1)\n'), # Indirect move - Not patched + re.escape(' D /iota\n'), + re.escape(' A /iotb (from /iota:2)\n'), # Patched - Direct move + re.escape(' A /mutb (from /A/mu:1)\n'), # Copy (always r1) + '-+\\n' + ]) + svntest.actions.run_and_verify_svn(expected_output, [], + 'log', '-v', '-q', sbox.wc_dir, + '-c3') + ######################################################################## # Run the tests @@ -2667,6 +2738,7 @@ test_list = [ None, log_multiple_revs_spanning_rename, mergeinfo_log, merge_sensitive_log_xml_reverse_merges, + log_revision_move_copy, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/move_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/move_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/move_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/move_tests.py Sun Feb 22 16:52:05 2015 @@ -1156,23 +1156,11 @@ def move_missing(sbox): expected_status.tweak('A/D/G', 'A/D/G/tau', 'A/D/G/pi', 'A/D/G/rho', status='! ', entry_status=' ') - expected_status.add({ - 'R' : Item(status='! ', wc_rev='-', - entry_status='A ', entry_copied='+'), - 'R/pi' : Item(status='! ', wc_rev='-', - entry_status=' ', entry_copied='+'), - 'R/tau' : Item(status='! ', wc_rev='-', - entry_status=' ', entry_copied='+'), - 'R/rho' : Item(status='! ', wc_rev='-', - entry_status=' ', entry_copied='+'), - }) - # Verify that the status processing doesn't crash svntest.actions.run_and_verify_status(wc_dir, expected_status) # The issue is a crash when the destination is present os.mkdir(sbox.ospath('R')) - expected_status.tweak('R', status='A ', copied='+') svntest.actions.run_and_verify_status(wc_dir, expected_status) Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py Sun Feb 22 16:52:05 2015 @@ -2930,6 +2930,30 @@ def load_txdelta(sbox): ".*Verified revision *"): raise svntest.Failure +@Issues(4563) +def load_no_svndate_r0(sbox): + "load without svn:date on r0" + + sbox.build(create_wc=False, empty=True) + + # svn:date exits + svntest.actions.run_and_verify_svnlook([' svn:date\n'], [], + 'proplist', '--revprop', '-r0', + sbox.repo_dir) + + dump_old = ["SVN-fs-dump-format-version: 2\n", "\n", + "UUID: bf52886d-358d-4493-a414-944a6e5ad4f5\n", "\n", + "Revision-number: 0\n", + "Prop-content-length: 10\n", + "Content-length: 10\n", "\n", + "PROPS-END\n", "\n"] + svntest.actions.run_and_verify_load(sbox.repo_dir, dump_old) + + # svn:date should have been removed + svntest.actions.run_and_verify_svnlook([], [], + 'proplist', '--revprop', '-r0', + sbox.repo_dir) + ######################################################################## # Run the tests @@ -2984,6 +3008,7 @@ test_list = [ None, freeze_same_uuid, upgrade, load_txdelta, + load_no_svndate_r0, ] if __name__ == '__main__': Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/actions.py Sun Feb 22 16:52:05 2015 @@ -1545,7 +1545,7 @@ def run_and_verify_status(wc_dir_name, s exit_code, output, errput = main.run_svn(None, 'status', '-v', '-u', '-q', wc_dir_name) - actual_status = svntest.wc.State.from_status(output) + actual_status = svntest.wc.State.from_status(output, wc_dir=wc_dir_name) # Verify actual output against expected output. if isinstance(status_tree, wc.State): @@ -1590,7 +1590,7 @@ def run_and_verify_unquiet_status(wc_dir exit_code, output, errput = main.run_svn(None, 'status', '-v', '-u', wc_dir_name) - actual_status = svntest.wc.State.from_status(output) + actual_status = svntest.wc.State.from_status(output, wc_dir=wc_dir_name) # Verify actual output against expected output. if isinstance(status_tree, wc.State): Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/factory.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/factory.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/factory.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/factory.py Sun Feb 22 16:52:05 2015 @@ -1035,7 +1035,7 @@ class TestFactory: make_py, prev_status = self.get_prev_status(wc) - actual_status = svntest.wc.State.from_status(output) + actual_status = svntest.wc.State.from_status(output, wc_dir=wc.realpath) # The tests currently compare SVNTreeNode trees, so let's do that too. prev_status_tree = prev_status.old_tree() Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/main.py Sun Feb 22 16:52:05 2015 @@ -54,7 +54,7 @@ import svntest from svntest import Failure from svntest import Skip -SVN_VER_MINOR = 9 +SVN_VER_MINOR = 10 ###################################################################### # Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/sandbox.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/sandbox.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/sandbox.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/sandbox.py Sun Feb 22 16:52:05 2015 @@ -424,7 +424,7 @@ class Sandbox: def simple_append(self, dest, contents, truncate=False): """Append CONTENTS to file DEST, optionally truncating it first. DEST is a relpath relative to the WC.""" - open(self.ospath(dest), truncate and 'w' or 'a').write(contents) + open(self.ospath(dest), truncate and 'wb' or 'ab').write(contents) def simple_lock(self, *targets): """Lock TARGETS in the WC. Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py Sun Feb 22 16:52:05 2015 @@ -434,7 +434,7 @@ class State: return not self.__eq__(other) @classmethod - def from_status(cls, lines): + def from_status(cls, lines, wc_dir=None): """Create a State object from 'svn status' output.""" def not_space(value): @@ -442,6 +442,17 @@ class State: return value return None + def parse_move(path, wc_dir): + if path.startswith('../'): + # ../ style paths are relative from the status root + return to_relpath(os.path.normpath(repos_join(wc_dir, path))) + else: + # Other paths are just relative from cwd + return to_relpath(path) + + if not wc_dir: + wc_dir = '' + desc = { } last = None for line in lines: @@ -455,15 +466,15 @@ class State: if ex_match: if ex_match.group('moved_from'): - path = ex_match.group('moved_from') - last.tweak(moved_from = to_relpath(path)) + path = to_relpath(ex_match.group('moved_from')) + last.tweak(moved_from = parse_move(path, wc_dir)) elif ex_match.group('moved_to'): - path = ex_match.group('moved_to') - last.tweak(moved_to = to_relpath(path)) + path = to_relpath(ex_match.group('moved_to')) + last.tweak(moved_to = parse_move(path, wc_dir)) elif ex_match.group('swapped_with'): - path = ex_match.group('swapped_with') - last.tweak(moved_to = to_relpath(path)) - last.tweak(moved_from = to_relpath(path)) + path = to_relpath(ex_match.group('swapped_with')) + last.tweak(moved_to = parse_move(path, wc_dir)) + last.tweak(moved_from = parse_move(path, wc_dir)) # Parse TC description? Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/tree_conflict_tests.py Sun Feb 22 16:52:05 2015 @@ -1449,7 +1449,6 @@ def update_dir_with_not_present(sbox): run_and_verify_svn(None, [], 'ci', '-m', '', wc_dir) -@XFail() def update_delete_mixed_rev(sbox): "update that deletes mixed-rev" @@ -1484,6 +1483,10 @@ def update_delete_mixed_rev(sbox): status='A ', copied='+', treeconflict='C', wc_rev='-') expected_status.tweak('A/B/F', 'A/B/E', 'A/B/E/beta', 'A/B/lambda', copied='+', wc_rev='-') + + # The entries world doesn't see a changed revision as another add + # while the WC-NG world does... + expected_status.tweak('A/B/E', status='A ', entry_status=' ') run_and_verify_update(wc_dir, expected_output, expected_disk, expected_status, None, None, None, None, None, 1, Modified: subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py (original) +++ subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py Sun Feb 22 16:52:05 2015 @@ -935,15 +935,15 @@ def tree_replace1(sbox): { '' : Item(status=' M', wc_rev=17), 'B' : Item(status='R ', copied='+', wc_rev='-'), - 'B/f' : Item(status='R ', copied='+', wc_rev='-'), + 'B/f' : Item(status=' ', copied='+', wc_rev='-'), 'B/g' : Item(status='D ', wc_rev=17), - 'B/h' : Item(status='A ', copied='+', wc_rev='-'), - 'B/C' : Item(status='R ', copied='+', wc_rev='-'), - 'B/C/f' : Item(status='R ', copied='+', wc_rev='-'), + 'B/h' : Item(status=' ', copied='+', wc_rev='-'), + 'B/C' : Item(status=' ', copied='+', wc_rev='-'), + 'B/C/f' : Item(status=' ', copied='+', wc_rev='-'), 'B/D' : Item(status='D ', wc_rev=17), 'B/D/f' : Item(status='D ', wc_rev=17), - 'B/E' : Item(status='A ', copied='+', wc_rev='-'), - 'B/E/f' : Item(status='A ', copied='+', wc_rev='-'), + 'B/E' : Item(status=' ', copied='+', wc_rev='-'), + 'B/E/f' : Item(status=' ', copied='+', wc_rev='-'), }) run_and_verify_status_no_server(sbox.wc_dir, expected_status) @@ -961,11 +961,11 @@ def tree_replace2(sbox): 'B' : Item(status='R ', copied='+', wc_rev='-'), 'B/f' : Item(status='D ', wc_rev=12), 'B/D' : Item(status='D ', wc_rev=12), - 'B/g' : Item(status='A ', copied='+', wc_rev='-'), - 'B/E' : Item(status='A ', copied='+', wc_rev='-'), + 'B/g' : Item(status=' ', copied='+', wc_rev='-'), + 'B/E' : Item(status=' ', copied='+', wc_rev='-'), 'C' : Item(status='R ', copied='+', wc_rev='-'), - 'C/f' : Item(status='A ', copied='+', wc_rev='-'), - 'C/D' : Item(status='A ', copied='+', wc_rev='-'), + 'C/f' : Item(status=' ', copied='+', wc_rev='-'), + 'C/D' : Item(status=' ', copied='+', wc_rev='-'), 'C/g' : Item(status='D ', wc_rev=12), 'C/E' : Item(status='D ', wc_rev=12), }) Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_client/client-test.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_client/client-test.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/libsvn_client/client-test.c (original) +++ subversion/branches/move-tracking-2/subversion/tests/libsvn_client/client-test.c Sun Feb 22 16:52:05 2015 @@ -1157,7 +1157,7 @@ test_copy_pin_externals(const svn_test_o APR_ARRAY_PUSH(copy_sources, svn_client_copy_source_t *) = ©_source; A_copy_url = apr_pstrcat(pool, repos_url, "/A_copy", SVN_VA_NULL); SVN_ERR(svn_client_copy7(copy_sources, A_copy_url, FALSE, FALSE, - FALSE, TRUE, externals_to_pin, + FALSE, FALSE, TRUE, externals_to_pin, NULL, NULL, NULL, ctx, pool)); /* Verify that externals were pinned as expected. */ Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_client/mtcc-test.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_client/mtcc-test.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/libsvn_client/mtcc-test.c (original) +++ subversion/branches/move-tracking-2/subversion/tests/libsvn_client/mtcc-test.c Sun Feb 22 16:52:05 2015 @@ -472,8 +472,55 @@ struct handle_rev_baton svn_revnum_t last; svn_boolean_t up; svn_boolean_t first; + + /* Per revision handler */ + svn_txdelta_window_handler_t inner_handler; + void *inner_baton; + + /* Swapped between revisions to reconstruct data */ + svn_stringbuf_t *cur; + svn_stringbuf_t *prev; + + /* Pool for some test stuff */ + apr_pool_t *pool; }; +/* Implement svn_txdelta_window_handler_t */ +static svn_error_t * +handle_rev_delta(svn_txdelta_window_t *window, + void * baton) +{ + struct handle_rev_baton *hrb = baton; + + SVN_ERR(hrb->inner_handler(window, hrb->inner_baton)); + + if (!window) + { + int expected_rev; + const char *expected; + + /* Some revisions don't update the revision body */ + switch (hrb->last) + { + case 5: + expected_rev = 4; + break; + case 7: /* Not reported */ + case 8: + expected_rev = 6; + break; + default: + expected_rev = (int)hrb->last; + } + + expected = apr_psprintf(hrb->pool, "revision-%d", expected_rev); + + SVN_TEST_STRING_ASSERT(hrb->cur->data, expected); + } + + return SVN_NO_ERROR; +} + /* Helper for test_file_revs_both_ways */ static svn_error_t * handle_rev(void *baton, @@ -489,19 +536,38 @@ handle_rev(void *baton, struct handle_rev_baton *hrb = baton; svn_revnum_t expected_rev = hrb->up ? (hrb->last + 1) : (hrb->last - 1); + if (expected_rev == 7) + expected_rev = hrb->up ? 8 : 6; + SVN_TEST_ASSERT(rev == expected_rev); SVN_TEST_ASSERT(apr_hash_count(rev_props) >= 3); SVN_TEST_STRING_ASSERT(path, (rev < 5) ? "/iota" : "/mu"); - if (!hrb->first && rev == (hrb->up ? 5 : 4)) + if (!hrb->first + && (rev == (hrb->up ? 5 : 4) || rev == (hrb->up ? 8 : 6))) SVN_TEST_ASSERT(delta_handler == NULL); else SVN_TEST_ASSERT(delta_handler != NULL); if (delta_handler) { - *delta_handler = svn_delta_noop_window_handler; - *delta_baton = NULL; + svn_stringbuf_t *tmp; + + *delta_handler = handle_rev_delta; + *delta_baton = hrb; + + /* Swap string buffers, to use previous as original */ + tmp = hrb->prev; + hrb->prev = hrb->cur; + hrb->cur = tmp; + + svn_stringbuf_setempty(hrb->cur); + + svn_txdelta_apply(svn_stream_from_stringbuf(hrb->prev, pool), + svn_stream_from_stringbuf(hrb->cur, pool), + NULL, NULL, pool, + &hrb->inner_handler, + &hrb->inner_baton); } hrb->last = rev; @@ -579,10 +645,16 @@ test_file_revs_both_ways(const svn_test_ SVN_ERR(svn_client_open_ra_session2(&ra, repos_url, NULL, ctx, pool, subpool)); + hrb.prev = svn_stringbuf_create("", pool); + hrb.cur = svn_stringbuf_create("", pool); + hrb.pool = pool; + svn_pool_clear(subpool); hrb.up = FALSE; hrb.last = 5; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "iota", 4, 1, FALSE, handle_rev, &hrb, subpool)); @@ -592,6 +664,8 @@ test_file_revs_both_ways(const svn_test_ hrb.up = TRUE; hrb.last = 0; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "iota", 1, 4, FALSE, handle_rev, &hrb, subpool)); @@ -601,6 +675,8 @@ test_file_revs_both_ways(const svn_test_ hrb.up = FALSE; hrb.last = 7; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "mu", 6, 1, FALSE, handle_rev, &hrb, subpool)); @@ -610,11 +686,41 @@ test_file_revs_both_ways(const svn_test_ hrb.up = TRUE; hrb.last = 0; hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); SVN_ERR(svn_ra_get_file_revs2(ra, "mu", 1, 6, FALSE, handle_rev, &hrb, subpool)); SVN_TEST_ASSERT(hrb.last == 6); + /* Ressurect mu */ + svn_pool_clear(subpool); + SVN_ERR(svn_client__mtcc_create(&mtcc, repos_url, 7, ctx, subpool, subpool)); + SVN_ERR(svn_client__mtcc_add_copy("mu", 6, "mu", mtcc, subpool)); + SVN_ERR(verify_mtcc_commit(mtcc, 8, subpool)); + + svn_pool_clear(subpool); + hrb.up = TRUE; + hrb.last = 0; + hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); + SVN_ERR(svn_ra_get_file_revs2(ra, "mu", 1, SVN_INVALID_REVNUM, FALSE, + handle_rev, &hrb, + subpool)); + SVN_TEST_ASSERT(hrb.last == 8); + + svn_pool_clear(subpool); + hrb.up = FALSE; + hrb.last = 9; + hrb.first = TRUE; + svn_stringbuf_setempty(hrb.prev); + svn_stringbuf_setempty(hrb.cur); + SVN_ERR(svn_ra_get_file_revs2(ra, "mu", SVN_INVALID_REVNUM, 1, FALSE, + handle_rev, &hrb, + subpool)); + SVN_TEST_ASSERT(hrb.last == 1); + return SVN_NO_ERROR; } Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/cache-test.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/cache-test.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/cache-test.c (original) +++ subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/cache-test.c Sun Feb 22 16:52:05 2015 @@ -354,6 +354,74 @@ test_memcache_long_key(const svn_test_op return SVN_NO_ERROR; } +static svn_error_t * +test_membuffer_cache_clearing(apr_pool_t *pool) +{ + svn_cache__t *cache; + svn_membuffer_t *membuffer; + svn_boolean_t found; + svn_revnum_t *value; + svn_revnum_t valueA = 12345; + svn_revnum_t valueB = 67890; + + /* Create a simple cache for strings, keyed by strings. */ + SVN_ERR(svn_cache__membuffer_cache_create(&membuffer, 10*1024, 1, 0, + TRUE, TRUE, pool)); + SVN_ERR(svn_cache__create_membuffer_cache(&cache, + membuffer, + serialize_revnum, + deserialize_revnum, + APR_HASH_KEY_STRING, + "cache:", + SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, + FALSE, + pool, pool)); + + /* Initially, the cache is empty. */ + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key A", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key B", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + /* Add entries. */ + SVN_ERR(svn_cache__set(cache, "key A", &valueA, pool)); + SVN_ERR(svn_cache__set(cache, "key B", &valueB, pool)); + + /* Added entries should be cached (too small to get evicted already). */ + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key A", pool)); + SVN_TEST_ASSERT(found); + SVN_TEST_ASSERT(*value == valueA); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key B", pool)); + SVN_TEST_ASSERT(found); + SVN_TEST_ASSERT(*value == valueB); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + /* Clear the cache. */ + SVN_ERR(svn_cache__membuffer_clear(membuffer)); + + /* The cache is empty again. */ + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key A", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key B", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__get((void **) &value, &found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + /* But still functional: */ + SVN_ERR(svn_cache__set(cache, "key B", &valueB, pool)); + SVN_ERR(svn_cache__has_key(&found, cache, "key A", pool)); + SVN_TEST_ASSERT(!found); + SVN_ERR(svn_cache__has_key(&found, cache, "key B", pool)); + SVN_TEST_ASSERT(found); + SVN_ERR(svn_cache__has_key(&found, cache, "key C", pool)); + SVN_TEST_ASSERT(!found); + + return SVN_NO_ERROR; +} + /* The test table. */ @@ -372,6 +440,8 @@ static struct svn_test_descriptor_t test "basic membuffer svn_cache test"), SVN_TEST_PASS2(test_membuffer_serializer_error_handling, "test for error handling in membuffer svn_cache"), + SVN_TEST_PASS2(test_membuffer_cache_clearing, + "test clearing a membuffer svn_cache"), SVN_TEST_NULL }; Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/sqlite-test.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/sqlite-test.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/sqlite-test.c (original) +++ subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/sqlite-test.c Sun Feb 22 16:52:05 2015 @@ -49,7 +49,7 @@ static svn_error_t * error_second(svn_sqlite__context_t *sctx, int argc, svn_sqlite__value_t *values[], - apr_pool_t *scratch_pool) + void *baton) { static int i = 0; Modified: subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/subst_translate-test.c URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1661492&r1=1661491&r2=1661492&view=diff ============================================================================== --- subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/subst_translate-test.c (original) +++ subversion/branches/move-tracking-2/subversion/tests/libsvn_subr/subst_translate-test.c Sun Feb 22 16:52:05 2015 @@ -115,7 +115,7 @@ test_svn_subst_translate_string2_null_en svn_string_t *new_value = NULL; svn_boolean_t translated_to_utf8 = FALSE; svn_boolean_t translated_line_endings = TRUE; - /* 'Æ', which is 0xc6 in both ISO-8859-1 and Windows-1252 */ + /* The 'AE' ligature, which is 0xc6 in both ISO-8859-1 and Windows-1252 */ svn_string_t *source_string = svn_string_create("\xc6", pool); SVN_ERR(svn_subst_translate_string2(&new_value, &translated_to_utf8,