subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
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 GMT
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__':



Mime
View raw message