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 73FFCD37F for ; Sat, 29 Sep 2012 04:03:12 +0000 (UTC) Received: (qmail 7753 invoked by uid 500); 29 Sep 2012 04:03:12 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 7724 invoked by uid 500); 29 Sep 2012 04:03:12 -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 7710 invoked by uid 99); 29 Sep 2012 04:03:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Sep 2012 04:03:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Sep 2012 04:03:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B4CAC2388A6E; Sat, 29 Sep 2012 04:02:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1391746 - in /subversion/branches/1.7.x: ./ STATUS subversion/svndumpfilter/main.c subversion/tests/cmdline/svndumpfilter_tests.py Date: Sat, 29 Sep 2012 04:02:15 -0000 To: commits@subversion.apache.org From: svn-role@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120929040215.B4CAC2388A6E@eris.apache.org> Author: svn-role Date: Sat Sep 29 04:02:15 2012 New Revision: 1391746 URL: http://svn.apache.org/viewvc?rev=1391746&view=rev Log: Merge the r1391020 group from trunk: * r1391020, r1391022 Fix issue #4234, "svndumpfilter exclude --targets wants pathname to start with '/'" Justification: Fixes inconsistent parameter processing. Paths specified on the command line and via --targets file should be handled the same way. Notes: Test added by r1391022 depends on r1389499 backport to PASS in 1.8 WC. Votes: +1: stsp, cmpilato, rhuijben Modified: subversion/branches/1.7.x/ (props changed) subversion/branches/1.7.x/STATUS subversion/branches/1.7.x/subversion/svndumpfilter/main.c subversion/branches/1.7.x/subversion/tests/cmdline/svndumpfilter_tests.py Propchange: subversion/branches/1.7.x/ ------------------------------------------------------------------------------ Merged /subversion/trunk:r1391020,1391022 Modified: subversion/branches/1.7.x/STATUS URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1391746&r1=1391745&r2=1391746&view=diff ============================================================================== --- subversion/branches/1.7.x/STATUS (original) +++ subversion/branches/1.7.x/STATUS Sat Sep 29 04:02:15 2012 @@ -146,17 +146,6 @@ Veto-blocked changes: Approved changes: ================= - * r1391020, r1391022 - Fix issue #4234, "svndumpfilter exclude --targets wants pathname to - start with '/'" - Justification: - Fixes inconsistent parameter processing. Paths specified on the command - line and via --targets file should be handled the same way. - Notes: - Test added by r1391022 depends on r1389499 backport to PASS in 1.8 WC. - Votes: - +1: stsp, cmpilato, rhuijben - * r1391641 Convert cache time-to-live value from seconds to microseconds, which is the unit expected by the API. (An API doc error in the past was the Modified: subversion/branches/1.7.x/subversion/svndumpfilter/main.c URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/svndumpfilter/main.c?rev=1391746&r1=1391745&r2=1391746&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/svndumpfilter/main.c (original) +++ subversion/branches/1.7.x/subversion/svndumpfilter/main.c Sat Sep 29 04:02:15 2012 @@ -1453,6 +1453,8 @@ main(int argc, const char *argv[]) { svn_stringbuf_t *buffer, *buffer_utf8; const char *utf8_targets_file; + apr_array_header_t *targets = apr_array_make(pool, 0, + sizeof(const char *)); /* We need to convert to UTF-8 now, even before we divide the targets into an array, because otherwise we wouldn't @@ -1465,10 +1467,18 @@ main(int argc, const char *argv[]) pool)); SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool)); - opt_state.prefixes = apr_array_append(pool, - svn_cstring_split(buffer_utf8->data, "\n\r", - TRUE, pool), - opt_state.prefixes); + targets = apr_array_append(pool, + svn_cstring_split(buffer_utf8->data, "\n\r", + TRUE, pool), + targets); + + for (i = 0; i < targets->nelts; i++) + { + const char *prefix = APR_ARRAY_IDX(targets, i, const char *); + if (prefix[0] != '/') + prefix = apr_pstrcat(pool, "/", prefix, (char *)NULL); + APR_ARRAY_PUSH(opt_state.prefixes, const char *) = prefix; + } } if (apr_is_empty_array(opt_state.prefixes)) Modified: subversion/branches/1.7.x/subversion/tests/cmdline/svndumpfilter_tests.py URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/cmdline/svndumpfilter_tests.py?rev=1391746&r1=1391745&r2=1391746&view=diff ============================================================================== --- subversion/branches/1.7.x/subversion/tests/cmdline/svndumpfilter_tests.py (original) +++ subversion/branches/1.7.x/subversion/tests/cmdline/svndumpfilter_tests.py Sat Sep 29 04:02:15 2012 @@ -596,6 +596,33 @@ def dropped_but_not_renumbered_empty_rev 'propget', 'svn:mergeinfo', '-R', sbox.repo_url) +@Issue(4234) +def dumpfilter_targets_expect_leading_slash_prefixes(sbox): + "dumpfilter targets expect leading '/' in prefixes" + ## See http://subversion.tigris.org/issues/show_bug.cgi?id=4234. ## + + test_create(sbox) + + dumpfile_location = os.path.join(os.path.dirname(sys.argv[0]), + 'svndumpfilter_tests_data', + 'greek_tree.dump') + dumpfile = open(dumpfile_location).read() + + (fd, targets_file) = tempfile.mkstemp(dir=svntest.main.temp_dir) + try: + targets = open(targets_file, 'w') + + # Removing the leading slash in path prefixes should work. + targets.write('A/D/H\n') + targets.write('A/D/G\n') + targets.close() + _simple_dumpfilter_test(sbox, dumpfile, + 'exclude', '/A/B/E', '--targets', targets_file) + finally: + os.close(fd) + os.remove(targets_file) + + ######################################################################## # Run the tests @@ -608,6 +635,7 @@ test_list = [ None, dumpfilter_with_patterns, filter_mergeinfo_revs_outside_of_dump_stream, dropped_but_not_renumbered_empty_revs, + dumpfilter_targets_expect_leading_slash_prefixes, ] if __name__ == '__main__':