subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1726108 [4/4] - in /subversion/branches/parallel-put: ./ build/ac-macros/ notes/ notes/move-tracking/ subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/ subversion/bindings/swig/ subversion/bindings/swig/include/ subversio...
Date Thu, 21 Jan 2016 21:39:24 GMT
Modified: subversion/branches/parallel-put/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/tests/cmdline/authz_tests.py?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/parallel-put/subversion/tests/cmdline/authz_tests.py Thu Jan 21 21:39:22 2016
@@ -1610,6 +1610,57 @@ def authz_log_censor_revprops(sbox):
     args=['--with-revprop', 'svn:author', '--with-revprop', 's',
           '-r1', sbox.repo_url])
 
+@Skip(svntest.main.is_ra_type_file)
+def remove_access_after_commit(sbox):
+  "remove a subdir with authz file"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  svntest.main.write_restrictive_svnserve_conf(sbox.repo_dir)
+  svntest.main.write_authz_file(sbox, { "/"      : "*=rw"})
+
+  # Modification in subtree
+  sbox.simple_append('A/B/E/alpha', 'appended\n')
+  sbox.simple_append('A/D/G/rho', 'appended\n')
+  sbox.simple_commit()
+
+  svntest.main.write_authz_file(sbox, { "/"      : "*=rw",
+                                        "/A/B"   : "*=",
+                                        "/A/D"   : "*="})
+
+  # Local modification
+  sbox.simple_append('A/D/G/pi', 'appended\n')
+
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'  : Item(status='D '),
+    'A/D'  : Item(status='  ', treeconflict='C'),
+  })
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/D/G/rho',
+                      contents="This is the file 'rho'.\nappended\n")
+  expected_disk.tweak('A/D/G/pi',
+                      contents="This is the file 'pi'.\nappended\n")
+  expected_disk.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+                       'A/B/F', 'A/B/lambda')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+
+  expected_status.tweak('A/D', status='R ',treeconflict='C', )
+  expected_status.tweak('A/D', 'A/D/G', 'A/D/G/pi', 'A/D/G/rho', 'A/D/G/tau',
+                        'A/D/H', 'A/D/H/omega', 'A/D/H/chi', 'A/D/H/psi',
+                        'A/D/gamma', copied='+', wc_rev='-')
+  expected_status.tweak('A/D/G/pi', status='M ')
+  expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta', 'A/B/F',
+                         'A/B/lambda')
+
+  # And expect a mixed rev copy
+  expected_status.tweak('A/D/G/rho', status='A ', entry_status='  ')
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        [], True)
+
 
 ########################################################################
 # Run the tests
@@ -1646,6 +1697,7 @@ test_list = [ None,
               log_diff_dontdothat,
               authz_file_external_to_authz,
               authz_log_censor_revprops,
+              remove_access_after_commit,
              ]
 serial_only = True
 

Modified: subversion/branches/parallel-put/subversion/tests/cmdline/mod_dav_svn_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/tests/cmdline/mod_dav_svn_tests.py?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/tests/cmdline/mod_dav_svn_tests.py (original)
+++ subversion/branches/parallel-put/subversion/tests/cmdline/mod_dav_svn_tests.py Thu Jan 21 21:39:22 2016
@@ -25,7 +25,7 @@
 ######################################################################
 
 # General modules
-import logging, httplib, base64
+import os, logging, httplib, base64
 
 logger = logging.getLogger()
 
@@ -41,6 +41,73 @@ Issue = svntest.testcase.Issue_deco
 Wimp = svntest.testcase.Wimp_deco
 
 ######################################################################
+# Helper routines
+
+def compare_xml_elem(a, b):
+  """Recursively compare two xml.etree.ElementTree.Element objects.
+  Return a 3-tuple made out of (cmp, elem_a, elem_b), where cmp is
+  the integer result of the comparison (negative, zero or positive),
+  and elem_a and elem_b point to mismatching elements.  Iff cmp is
+  zero, elem_a and elem_b are None. """
+
+  # Compare tags, attributes, inner text, tail attribute and the
+  # number of child elements.
+  res = cmp(a.tag, b.tag)
+  if res != 0:
+    return res, a, b
+  # Don't care about the order of the attributes.
+  res = cmp(a.attrib, b.attrib)
+  if res != 0:
+    return res, a, b
+  res = cmp(a.text, b.text)
+  if res != 0:
+    return res, a, b
+  res = cmp(a.tail, b.tail)
+  if res != 0:
+    return res, a, b
+  res = cmp(len(a), len(b))
+  if res != 0:
+    return res, a, b
+
+  # Prior to recursing, order child elements using the same comparator.
+  # Right now we don't care about the order of the elements.  For instance,
+  # <D:response>'s in PROPFIND *need* to be compared without a particular
+  # order, since the server returns them in an unstable order of the hash
+  # iteration.
+  def sortcmp(x, y):
+    return compare_xml_elem(x, y)[0]
+
+  a_children = sorted(list(a), cmp=sortcmp)
+  b_children = sorted(list(b), cmp=sortcmp)
+
+  for a_child, b_child in zip(a_children, b_children):
+    res = compare_xml_elem(a_child, b_child)
+    if res[0] != 0:
+      return res
+
+  # Elements are equal.
+  return 0, None, None
+
+def verify_xml_response(expected_xml, actual_xml):
+  """Parse and compare two XML responses, raise svntest.Failure
+  in case EXPECTED_XML doesn't match ACTUAL_XML. """
+
+  import xml.etree.ElementTree as ET
+
+  expected_root = ET.fromstring(expected_xml)
+  actual_root = ET.fromstring(actual_xml)
+  res, expected_elem, actual_elem = compare_xml_elem(expected_root,
+                                                     actual_root)
+  if res != 0:
+    # The actual response doesn't match our expectations; dump it for
+    # debugging purposes, and highlight the mismatching xml element.
+    logger.warn("Response:\n%s" % actual_xml)
+    raise svntest.Failure("Unexpected response part\n"
+                          "  Expected: '%s'\n    Actual: '%s'\n"
+                          % (ET.tostring(expected_elem),
+                             ET.tostring(actual_elem)))
+
+######################################################################
 # Tests
 
 @SkipUnless(svntest.main.is_ra_type_dav)
@@ -142,6 +209,411 @@ def cache_control_header(sbox):
   r.read()
 
 
+@SkipUnless(svntest.main.is_ra_type_dav)
+def simple_propfind(sbox):
+  "verify simple PROPFIND responses"
+
+  sbox.build(create_wc=False, read_only=True)
+  repo_uripath = '/' + svntest.wc.svn_uri_quote(
+    svntest.main.pristine_greek_repos_dir.replace(os.path.sep, '/'))
+  h = svntest.main.create_http_connection(sbox.repo_url)
+
+  # PROPFIND /repos/!svn/rvr/1, Depth = 0
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '0',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<propfind xmlns="DAV:">\n'
+    '<prop><resourcetype xmlns="DAV:"/></prop>\n'
+    '</propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/1', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:lp1="DAV:" '
+        'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype><D:collection/></lp1:resourcetype>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
+  # PROPFIND /repos/!svn/rvr/1, Depth = 1
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '1',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<propfind xmlns="DAV:">\n'
+      '<prop><resourcetype xmlns="DAV:"/></prop>\n'
+    '</propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/1', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:lp1="DAV:" '
+        'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype><D:collection/></lp1:resourcetype>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+      '<D:response xmlns:lp1="DAV:" '
+        'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/A/</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype><D:collection/></lp1:resourcetype>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+      '<D:response xmlns:lp1="DAV:" '
+        'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/iota</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype/>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
+  # PROPFIND /repos/!svn/rvr/1/A/B/F, Depth = 1
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '1',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<propfind xmlns="DAV:">\n'
+      '<prop><resourcetype xmlns="DAV:"/></prop>\n'
+    '</propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/1/A/B/F', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:lp1="DAV:" '
+        'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/A/B/F/</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype><D:collection/></lp1:resourcetype>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
+  # PROPFIND /repos/!svn/rvr/1/iota, Depth = 0
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '0',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<propfind xmlns="DAV:">\n'
+      '<prop><resourcetype xmlns="DAV:"/></prop>\n'
+    '</propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/1/iota', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:lp1="DAV:" '
+        'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/iota</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype/>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
+
+@SkipUnless(svntest.main.is_ra_type_dav)
+def propfind_multiple_props(sbox):
+  "verify multi-prop PROPFIND response"
+
+  sbox.build(create_wc=False, read_only=True)
+  repo_uripath = '/' + svntest.wc.svn_uri_quote(
+    svntest.main.pristine_greek_repos_dir.replace(os.path.sep, '/'))
+  h = svntest.main.create_http_connection(sbox.repo_url)
+
+  # PROPFIND /repos/!svn/rvr/1/iota, Depth = 0
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '0',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8" ?>\n'
+    '<D:propfind xmlns:D="DAV:">\n'
+      '<D:prop xmlns:S="http://subversion.tigris.org/xmlns/dav/">\n'
+         '<D:resourcetype/>\n'
+         '<S:md5-checksum/>\n'
+      '</D:prop>\n'
+    '</D:propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/1/iota', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" '
+                   'xmlns:ns1="http://subversion.tigris.org/xmlns/dav/" '
+                   'xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:lp1="DAV:" '
+                  'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+      '<D:href>' + repo_uripath + '/!svn/rvr/1/iota</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype/>\n'
+            '<lp2:md5-checksum>'
+              '2d18c5e57e84c5b8a5e9a6e13fa394dc'
+            '</lp2:md5-checksum>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
+
+@SkipUnless(svntest.main.is_ra_type_dav)
+def propfind_404(sbox):
+  "verify PROPFIND for non-existing property"
+
+  sbox.build(create_wc=False, read_only=True)
+  repo_uripath = '/' + svntest.wc.svn_uri_quote(
+    svntest.main.pristine_greek_repos_dir.replace(os.path.sep, '/'))
+  h = svntest.main.create_http_connection(sbox.repo_url)
+
+  # PROPFIND /repos/!svn/rvr/1, Depth = 0
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '0',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<propfind xmlns="DAV:">\n'
+      '<prop><nonexistingprop xmlns="DAV:"/></prop>\n'
+    '</propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/1', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:g0="DAV:">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<g0:nonexistingprop/>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 404 Not Found</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
+
+@SkipUnless(svntest.main.is_ra_type_dav)
+def propfind_allprop(sbox):
+  "verify allprop PROPFIND response"
+
+  sbox.build()
+  repo_uripath = '/' + svntest.wc.svn_uri_quote(
+    sbox.repo_dir.replace(os.path.sep, '/'))
+  svntest.actions.enable_revprop_changes(sbox.repo_dir)
+  # Ensure stable date and uuid
+  svntest.main.run_svnadmin('setuuid', sbox.repo_dir,
+                            'd7130b12-92f6-45c9-9217-b9f0472c3fab')
+  svntest.actions.run_and_verify_svn(None, [],
+                                     'propset', '--revprop', '-r', '1',
+                                     'svn:date', '2015-01-01T00:00:00.0Z',
+                                     sbox.wc_dir)
+
+  h = svntest.main.create_http_connection(sbox.repo_url)
+
+  # PROPFIND /repos/!svn/rvr/1, Depth = 0
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '0',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<propfind xmlns="DAV:">\n'
+      '<allprop/>\n'
+    '</propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/1', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" '
+                  'xmlns:C="http://subversion.tigris.org/xmlns/custom/" '
+                  'xmlns:V="http://subversion.tigris.org/xmlns/dav/" '
+                  'xmlns:lp1="DAV:" '
+                  'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/1/</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+            '<lp1:resourcetype><D:collection/></lp1:resourcetype>\n'
+            '<lp1:getcontenttype>' +
+              'text/html; charset=UTF-8' +
+            '</lp1:getcontenttype>\n'
+            '<lp1:getetag>W/"1//"</lp1:getetag>\n'
+            '<lp1:creationdate>2015-01-01T00:00:00.0Z</lp1:creationdate>\n'
+            '<lp1:getlastmodified>' +
+              'Thu, 01 Jan 2015 00:00:00 GMT' +
+            '</lp1:getlastmodified>\n'
+            '<lp1:checked-in>'
+              '<D:href>' + repo_uripath + '/!svn/ver/1/</D:href>'
+            '</lp1:checked-in>\n'
+            '<lp1:version-controlled-configuration>'
+              '<D:href>' + repo_uripath + '/!svn/vcc/default</D:href>'
+            '</lp1:version-controlled-configuration>\n'
+            '<lp1:version-name>1</lp1:version-name>\n'
+            '<lp1:creator-displayname>jrandom</lp1:creator-displayname>\n'
+            '<lp2:baseline-relative-path/>\n'
+            '<lp2:repository-uuid>' +
+              'd7130b12-92f6-45c9-9217-b9f0472c3fab' +
+            '</lp2:repository-uuid>\n'
+            '<lp2:deadprop-count>0</lp2:deadprop-count>\n'
+            '<D:lockdiscovery/>\n'
+          '</D:prop>\n'
+        '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
+
+@SkipUnless(svntest.main.is_ra_type_dav)
+def propfind_propname(sbox):
+  "verify propname PROPFIND response"
+
+  sbox.build()
+  sbox.simple_propset('a', 'b', 'iota')
+  sbox.simple_commit()
+  repo_uripath = '/' + svntest.wc.svn_uri_quote(
+    sbox.repo_dir.replace(os.path.sep, '/'))
+
+  h = svntest.main.create_http_connection(sbox.repo_url)
+
+  # PROPFIND /repos/!svn/rvr/2/iota, Depth = 0
+  headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'Depth': '0',
+  }
+  req_body = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<propfind xmlns="DAV:">\n'
+      '<propname/>\n'
+    '</propfind>\n'
+    )
+  h.request('PROPFIND', sbox.repo_url + '/!svn/rvr/2/iota', req_body, headers)
+  r = h.getresponse()
+  if r.status != httplib.MULTI_STATUS:
+    raise svntest.Failure('Unexpected status: %d %s' % (r.status, r.reason))
+
+  expected_response = (
+    '<?xml version="1.0" encoding="utf-8"?>\n'
+    '<D:multistatus xmlns:D="DAV:" xmlns:ns0="DAV:">\n'
+      '<D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" '
+                  'xmlns:C="http://subversion.tigris.org/xmlns/custom/" '
+                  'xmlns:V="http://subversion.tigris.org/xmlns/dav/" '
+                  'xmlns:lp1="DAV:" '
+                  'xmlns:lp2="http://subversion.tigris.org/xmlns/dav/">\n'
+        '<D:href>' + repo_uripath + '/!svn/rvr/2/iota</D:href>\n'
+        '<D:propstat>\n'
+          '<D:prop>\n'
+          '<C:a/>\n'
+          '<lp1:resourcetype/>\n'
+          '<lp1:getcontentlength/>\n'
+          '<lp1:getcontenttype/>\n'
+          '<lp1:getetag/>\n'
+          '<lp1:creationdate/>\n'
+          '<lp1:getlastmodified/>\n'
+          '<lp1:checked-in/>\n'
+          '<lp1:version-controlled-configuration/>\n'
+          '<lp1:version-name/>\n'
+          '<lp1:creator-displayname/>\n'
+          '<lp2:baseline-relative-path/>\n'
+          '<lp2:md5-checksum/>\n'
+          '<lp2:repository-uuid/>\n'
+          '<lp2:deadprop-count/>\n'
+          '<lp2:sha1-checksum/>\n'
+          '<D:supportedlock/>\n'
+          '<D:lockdiscovery/>\n'
+          '</D:prop>\n'
+          '<D:status>HTTP/1.1 200 OK</D:status>\n'
+        '</D:propstat>\n'
+      '</D:response>\n'
+    '</D:multistatus>\n'
+    )
+  actual_response = r.read()
+  verify_xml_response(expected_response, actual_response)
+
 ########################################################################
 # Run the tests
 
@@ -149,6 +621,11 @@ def cache_control_header(sbox):
 # list all tests here, starting with None:
 test_list = [ None,
               cache_control_header,
+              simple_propfind,
+              propfind_multiple_props,
+              propfind_404,
+              propfind_allprop,
+              propfind_propname,
              ]
 serial_only = True
 

Modified: subversion/branches/parallel-put/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/tests/cmdline/patch_tests.py?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/parallel-put/subversion/tests/cmdline/patch_tests.py Thu Jan 21 21:39:22 2016
@@ -4518,7 +4518,7 @@ def patch_empty_file(sbox):
     "--- lf.txt\t(revision 2)\n",
     "+++ lf.txt\t(working copy)\n",
     "@@ -1 +1 @@\n",
-    "\n"
+    "-\n"
     "+replacement\n",
 
   # patch a new file 'new.txt\n'
@@ -4553,7 +4553,7 @@ def patch_empty_file(sbox):
   # Current result: lf.txt patched ok, new created, empty succeeds with offset.
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.add({
-    'lf.txt'            : Item(contents="\n"),
+    'lf.txt'            : Item(contents="replacement\n"),
     'new.txt'           : Item(contents="new file\n"),
     'empty.txt'         : Item(contents="replacement\n"),
   })
@@ -7528,6 +7528,157 @@ def patch_move_and_change(sbox):
                                        [], True, True,
                                        '--reverse-diff')
 
+@Issue(4609)
+def missing_trailing_context(sbox):
+  "missing trailing context"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  sbox.simple_append('A/mu',
+                     'a\n'
+                     'b\n'
+                     'c\n'
+                     'd\n'
+                     'e\n',
+                     truncate=True)
+  sbox.simple_commit()
+  sbox.simple_update()
+
+  # The hunk is expected to have two lines of trailing context but
+  # only has one.
+  unidiff_patch = [
+    "Index: A/mu\n"
+    "===================================================================\n",
+    "--- A/mu\t(revision 2)\n",
+    "+++ A/mu\t(working copy)\n",
+    "@@ -1,5 +1,5 @@\n",
+    " a\n",
+    " b\n",
+    "-c\n",
+    "+cc\n",
+    " d\n",
+  ]
+  patch_file_path = sbox.get_tempname('my.patch')
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch), 'wb')
+
+  # GNU patch will apply the hunk with fuzz 1 and modify only the 'c' line.
+  # Our patch file finds the length mismatch and applies a penalty.
+  expected_output = [
+    'U         %s\n' % sbox.ospath('A/mu'),
+    '>         applied hunk @@ -1,4 +1,4 @@ with fuzz 1\n',
+  ]
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu', contents =
+                     'a\n'
+                     'b\n'
+                     'cc\n'
+                     'd\n'
+                     'e\n')
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+  expected_status.tweak('A/mu', status='M ')
+  expected_skip = wc.State('', { })
+  svntest.actions.run_and_verify_patch(wc_dir, patch_file_path,
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  # Try reverse patch
+  expected_disk.tweak('A/mu', contents =
+                     'a\n'
+                     'b\n'
+                     'c\n'
+                     'd\n'
+                     'e\n')
+  expected_status.tweak('A/mu', status='  ')
+  svntest.actions.run_and_verify_patch(wc_dir, patch_file_path,
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip,
+                                       [], False, True, '--reverse-diff')
+
+  # The hunk is expected to have two lines of trailing context but
+  # only has one.
+  unidiff_patch = [
+    "Index: A/mu\n"
+    "===================================================================\n",
+    "--- A/mu\t(revision 2)\n",
+    "+++ A/mu\t(working copy)\n",
+    "@@ -1,4 +1,4 @@\n",
+    " a\n",
+    " b\n",
+    "-c\n",
+    "+cc\n",
+    " d\n",
+    " e\n",
+  ]
+  patch_file_path = sbox.get_tempname('my2.patch')
+  svntest.main.file_write(patch_file_path, ''.join(unidiff_patch), 'wb')
+
+  expected_output = [
+    'U         %s\n' % sbox.ospath('A/mu'),
+    '>         applied hunk @@ -1,5 +1,5 @@ with fuzz 1\n',
+  ]
+  expected_disk.tweak('A/mu', contents =
+                     'a\n'
+                     'b\n'
+                     'cc\n'
+                     'd\n'
+                     'e\n')
+  expected_status.tweak('A/mu', status='M ')
+  svntest.actions.run_and_verify_patch(wc_dir, patch_file_path,
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
+  # Try reverse patch
+  expected_disk.tweak('A/mu', contents =
+                     'a\n'
+                     'b\n'
+                     'c\n'
+                     'd\n'
+                     'e\n')
+  expected_status.tweak('A/mu', status='  ')
+  svntest.actions.run_and_verify_patch(wc_dir, patch_file_path,
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip,
+                                       [], False, True, '--reverse-diff')
+
+def patch_missed_trail(sbox):
+  "apply a patch to an empty file"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  patch_file_path = sbox.get_tempname('my.patch')
+  svntest.main.file_write(patch_file_path, ''.join([
+  # Add a line to a file with just '\n' with bad header (should be +1,2)
+    "Index: lf.txt\n",
+    "===================================================================\n",
+    "--- lf.txt\t(revision 2)\n",
+    "+++ lf.txt\t(working copy)\n",
+    "@@ -1 +1 @@\n",
+    "\n"
+    "+replacement\n",
+  ]))
+
+  sbox.simple_add_text('\n', 'lf.txt')
+  sbox.simple_commit()
+
+  expected_output = [
+    'U         %s\n' % sbox.ospath('lf.txt'),
+    '>         applied hunk @@ -1,1 +1,2 @@ with fuzz 1\n',
+  ]
+
+  # Current result: lf.txt patched ok, new created, empty succeeds with offset.
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+    'lf.txt'            : Item(contents="\nreplacement\n"),
+  })
+  expected_skip = wc.State(wc_dir, {})
+  expected_status = None
+
+  svntest.actions.run_and_verify_patch(wc_dir, patch_file_path,
+                                       expected_output, expected_disk,
+                                       expected_status, expected_skip)
+
 ########################################################################
 #Run the tests
 
@@ -7608,6 +7759,8 @@ test_list = [ None,
               patch_add_one_line,
               patch_with_mergeinfo,
               patch_move_and_change,
+              missing_trailing_context,
+              patch_missed_trail,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/parallel-put/subversion/tests/cmdline/relocate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/tests/cmdline/relocate_tests.py?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/tests/cmdline/relocate_tests.py (original)
+++ subversion/branches/parallel-put/subversion/tests/cmdline/relocate_tests.py Thu Jan 21 21:39:22 2016
@@ -350,15 +350,20 @@ def relocate_with_relative_externals(sbo
 
   sbox.build()
   wc_dir = sbox.wc_dir
+  repo_dir = sbox.repo_dir
+  repo_url = sbox.repo_url
 
   # Add a relative external.
   change_external(os.path.join(wc_dir, 'A', 'B'),
                   "^/A/D/G G-ext\n../D/H H-ext", commit=True)
   svntest.actions.run_and_verify_svn(None, [], 'update', wc_dir)
 
+  # A second wc not at the repository root
+  other_wc = sbox.add_wc_path('other')
+  svntest.main.safe_rmtree(other_wc, 1)
+  svntest.actions.run_and_verify_svn(None, [], 'checkout',
+                                     repo_url + '/A/B', other_wc)
   # Move our repository to another location.
-  repo_dir = sbox.repo_dir
-  repo_url = sbox.repo_url
   other_repo_dir, other_repo_url = sbox.add_repo_path('other')
   svntest.main.copy_repos(repo_dir, other_repo_dir, 2, 0)
   svntest.main.safe_rmtree(repo_dir, 1)
@@ -374,6 +379,46 @@ def relocate_with_relative_externals(sbo
   svntest.actions.run_and_verify_info([{ 'URL' : '.*.other/A/D/H$' }],
                                       os.path.join(wc_dir, 'A', 'B', 'H-ext'))
 
+  # Relocate with prefix too long to be valid for externals.
+  svntest.actions.run_and_verify_svn(None, [], 'relocate',
+                                     repo_url + '/A/B',
+                                     other_repo_url + '/A/B',
+                                     other_wc)
+
+  svntest.actions.run_and_verify_info([{ 'URL' : '.*.other/A/D/G$' }],
+                                      os.path.join(other_wc, 'G-ext'))
+  svntest.actions.run_and_verify_info([{ 'URL' : '.*.other/A/D/H$' }],
+                                      os.path.join(other_wc, 'H-ext'))
+
+def prefix_partial_component(sbox):
+  """prefix with a partial component"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  repo_dir = sbox.repo_dir
+  repo_url = sbox.repo_url
+  other1_repo_dir, other1_repo_url = sbox.add_repo_path('xxxother')
+  other2_repo_dir, other2_repo_url = sbox.add_repo_path('yyyother')
+
+  # Relocate to 'xxxother'.
+  svntest.main.copy_repos(repo_dir, other1_repo_dir, 1, 0)
+  svntest.main.safe_rmtree(repo_dir, 1)
+  svntest.actions.run_and_verify_svn(None, [], 'relocate',
+                                     repo_url, other1_repo_url, wc_dir)
+  svntest.actions.run_and_verify_info([{ 'URL' : '.*.xxxother$' }],
+                                      wc_dir)
+
+  # Now relocate from 'xxx' to 'yyy' omitting 'other'.
+  svntest.main.copy_repos(other1_repo_dir, other2_repo_dir, 1, 0)
+  svntest.main.safe_rmtree(other1_repo_url, 1)
+  svntest.actions.run_and_verify_svn(None, [], 'relocate',
+                                     other1_repo_url[:-5],
+                                     other2_repo_url[:-5],
+                                     wc_dir)
+  svntest.actions.run_and_verify_info([{ 'URL' : '.*.yyyother$' }],
+                                      wc_dir)
+  
+  
 ########################################################################
 # Run the tests
 
@@ -385,6 +430,7 @@ test_list = [ None,
               single_file_relocate,
               relocate_with_switched_children,
               relocate_with_relative_externals,
+              prefix_partial_component,
               ]
 
 if __name__ == '__main__':

Modified: subversion/branches/parallel-put/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/tests/libsvn_fs/fs-test.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/parallel-put/subversion/tests/libsvn_fs/fs-test.c Thu Jan 21 21:39:22 2016
@@ -6701,6 +6701,9 @@ test_fsfs_config_opts(const svn_test_opt
   svn_fs_t *fs;
   const svn_fs_info_placeholder_t *fs_info;
   const svn_fs_fsfs_info_t *fsfs_info;
+  const char *dir_name = "test-repo-fsfs-config-opts";
+  const char *repo_name_default = "test-repo-fsfs-config-opts/default";
+  const char *repo_name_custom = "test-repo-fsfs-config-opts/custom";
 
   /* Bail (with SKIP) on known-untestable scenarios */
   if (strcmp(opts->fs_type, SVN_FS_TYPE_FSFS) != 0)
@@ -6708,20 +6711,19 @@ test_fsfs_config_opts(const svn_test_opt
                             "this will test FSFS repositories only");
 
   /* Remove the test directory from previous runs. */
-  SVN_ERR(svn_io_remove_dir2("test-repo-fsfs-config-opts", TRUE, NULL, NULL,
-                             pool));
+  SVN_ERR(svn_io_remove_dir2(dir_name, TRUE, NULL, NULL, pool));
 
   /* Create the test directory and add it to the test cleanup list. */
-  SVN_ERR(svn_io_dir_make("test-fsfs-config-opts", APR_OS_DEFAULT, pool));
-  svn_test_add_dir_cleanup("test-fsfs-config-opts");
+  SVN_ERR(svn_io_dir_make(dir_name, APR_OS_DEFAULT, pool));
+  svn_test_add_dir_cleanup(dir_name);
 
   /* Create an FSFS filesystem with default config.*/
   fs_config = apr_hash_make(pool);
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FS_TYPE, SVN_FS_TYPE_FSFS);
-  SVN_ERR(svn_fs_create(&fs, "test-fsfs-config-opts/default", fs_config, pool));
+  SVN_ERR(svn_fs_create(&fs, repo_name_default, fs_config, pool));
 
   /* Re-open FS to test the data on disk. */
-  SVN_ERR(svn_fs_open2(&fs, "test-fsfs-config-opts/default", NULL, pool, pool));
+  SVN_ERR(svn_fs_open2(&fs, repo_name_default, NULL, pool, pool));
 
   SVN_ERR(svn_fs_info(&fs_info, fs, pool, pool));
   SVN_TEST_STRING_ASSERT(fs_info->fs_type, SVN_FS_TYPE_FSFS);
@@ -6738,10 +6740,10 @@ test_fsfs_config_opts(const svn_test_opt
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FS_TYPE, SVN_FS_TYPE_FSFS);
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_LOG_ADDRESSING, "false");
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_SHARD_SIZE, "123");
-  SVN_ERR(svn_fs_create(&fs, "test-fsfs-config-opts/custom", fs_config, pool));
+  SVN_ERR(svn_fs_create(&fs, repo_name_custom, fs_config, pool));
 
   /* Re-open FS to test the data on disk. */
-  SVN_ERR(svn_fs_open2(&fs, "test-fsfs-config-opts/custom", NULL, pool, pool));
+  SVN_ERR(svn_fs_open2(&fs, repo_name_custom, NULL, pool, pool));
 
   SVN_ERR(svn_fs_info(&fs_info, fs, pool, pool));
   SVN_TEST_STRING_ASSERT(fs_info->fs_type, SVN_FS_TYPE_FSFS);

Modified: subversion/branches/parallel-put/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c (original)
+++ subversion/branches/parallel-put/subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c Thu Jan 21 21:39:22 2016
@@ -86,6 +86,7 @@ fuzzing_1_byte_1_rev(const char *repo_na
   fs_config = apr_hash_make(pool);
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_DELTAS, "1");
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS, "1");
+  svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_NODEPROPS, "1");
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_CACHE_REVPROPS, "2");
   svn_hash_sets(fs_config, SVN_FS_CONFIG_FSFS_BLOCK_READ, "0");
 

Modified: subversion/branches/parallel-put/subversion/tests/libsvn_ra/ra-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/subversion/tests/libsvn_ra/ra-test.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/branches/parallel-put/subversion/tests/libsvn_ra/ra-test.c Thu Jan 21 21:39:22 2016
@@ -603,6 +603,7 @@ get_dir_test(const svn_test_opts_t *opts
 {
   svn_ra_session_t *session;
   apr_hash_t *dirents;
+  svn_dirent_t *ent;
 
   SVN_ERR(make_and_open_repos(&session, "test-get-dir", opts, pool));
   SVN_ERR(commit_tree(session, pool));
@@ -613,6 +614,19 @@ get_dir_test(const svn_test_opts_t *opts
                                         SVN_DIRENT_KIND, pool),
                         SVN_ERR_FS_NOT_FOUND);
 
+  /* Test fetching SVN_DIRENT_SIZE without SVN_DIRENT_KIND. */
+  SVN_ERR(svn_ra_get_dir2(session, &dirents, NULL, NULL, "", 1,
+                          SVN_DIRENT_SIZE, pool));
+  SVN_TEST_INT_ASSERT(apr_hash_count(dirents), 1);
+  ent = svn_hash_gets(dirents, "A");
+  SVN_TEST_ASSERT(ent);
+
+#if 0
+  /* ra_serf has returns SVN_INVALID_SIZE instead of documented zero for
+   * for directories. */
+  SVN_TEST_INT_ASSERT(ent->size, 0);
+#endif
+
   return SVN_NO_ERROR;
 }
 
@@ -1632,12 +1646,9 @@ commit_empty_last_change(const svn_test_
       SVN_TEST_ASSERT(dirent != NULL);
       SVN_TEST_STRING_ASSERT(dirent->last_author, "jrandom");
       
-      /* BDB only updates last_changed on the repos_root when there is an
-         actual change. Our other filesystems handle this differently */
-      if (!opts->fs_type || !strcasecmp(opts->fs_type, "BDB"))
-        SVN_TEST_INT_ASSERT(dirent->created_rev, 1);
-      else
-        SVN_TEST_INT_ASSERT(dirent->created_rev, 2+i);
+      /* BDB used to only updates last_changed on the repos_root when there
+         was an actual change. Now all filesystems behave in the same way */
+      SVN_TEST_INT_ASSERT(dirent->created_rev, 2+i);
     }
 
   svn_pool_clear(tmp_pool);

Modified: subversion/branches/parallel-put/tools/backup/hot-backup.py.in
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/tools/backup/hot-backup.py.in?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/tools/backup/hot-backup.py.in (original)
+++ subversion/branches/parallel-put/tools/backup/hot-backup.py.in Thu Jan 21 21:39:22 2016
@@ -70,7 +70,7 @@ def chmod_tree(path, mode, mask):
 def safe_rmtree(dirname, retry=0):
   "Remove the tree at DIRNAME, making it writable first"
   def rmtree(dirname):
-    chmod_tree(dirname, 0666, 0666)
+    chmod_tree(dirname, 0o666, 0o666)
     shutil.rmtree(dirname)
 
   if not os.path.exists(dirname):
@@ -117,7 +117,7 @@ try:
                                                       "num-backups=",
                                                       "verify",
                                                       "help"])
-except getopt.GetoptError, e:
+except getopt.GetoptError as e:
   sys.stderr.write("ERROR: %s\n\n" % e)
   sys.stderr.flush()
   usage(sys.stderr)
@@ -137,6 +137,11 @@ for o, a in opts:
     usage()
     sys.exit()
 
+if archive_type not in (None, 'bz2', 'gz', 'zip', 'zip64'):
+  sys.stderr.write("ERROR: Bad --archive-type\n")
+  usage(sys.stderr)
+  sys.exit(2)
+
 if len(args) != 2:
   sys.stderr.write("ERROR: only two arguments allowed.\n\n")
   sys.stderr.flush()
@@ -198,7 +203,7 @@ def get_youngest_revision():
   """Examine the repository REPO_DIR using the svnlook binary
   specified by SVNLOOK, and return the youngest revision."""
 
-  p = subprocess.Popen([svnlook, 'youngest', repo_dir],
+  p = subprocess.Popen([svnlook, 'youngest', '--', repo_dir],
                        stdin=subprocess.PIPE,
                        stdout=subprocess.PIPE,
                        stderr=subprocess.PIPE)
@@ -226,7 +231,7 @@ print("Beginning hot backup of '"+ repo_
 
 try:
   youngest = get_youngest_revision()
-except Exception, e:
+except Exception as e:
   sys.stderr.write("%s\n" % e)
   sys.stderr.flush()
   sys.exit(1)
@@ -245,7 +250,7 @@ backup_subdir = os.path.join(backup_dir,
 # rather than start from 1 and increment because the starting
 # increments may have already been removed due to num_backups.
 
-regexp = re.compile("^" + repo + "-" + youngest +
+regexp = re.compile("^" + re.escape(repo) + "-" + re.escape(youngest) +
                     "(-(?P<increment>[0-9]+))?" + ext_re + "$")
 directory_list = os.listdir(backup_dir)
 young_list = [x for x in directory_list if regexp.search(x)]
@@ -262,8 +267,8 @@ if young_list:
 ###         copied last.
 
 print("Backing up repository to '" + backup_subdir + "'...")
-err_code = subprocess.call([svnadmin, "hotcopy", repo_dir, 
-                            backup_subdir, "--clean-logs"])
+err_code = subprocess.call([svnadmin, "hotcopy", "--clean-logs",
+                            '--', repo_dir, backup_subdir])
 if err_code != 0:
   sys.stderr.write("Unable to backup the repository.\n")
   sys.stderr.flush()
@@ -274,7 +279,7 @@ else:
 ### Step 4: Verify the hotcopy
 if verify_copy:
   print("Verifying backup...")
-  err_code = subprocess.call([svnadmin, "verify", "--quiet", backup_subdir])
+  err_code = subprocess.call([svnadmin, "verify", "--quiet", '--', backup_subdir])
   if err_code != 0:
     sys.stderr.write("Backup verification failed.\n")
     sys.stderr.flush()
@@ -294,10 +299,10 @@ if archive_type:
       tar = tarfile.open(archive_path, 'w:' + archive_type)
       tar.add(backup_subdir, os.path.basename(backup_subdir))
       tar.close()
-    except ImportError, e:
+    except ImportError as e:
       err_msg = "Import failed: " + str(e)
       err_code = -2
-    except tarfile.TarError, e:
+    except tarfile.TarError as e:
       err_msg = "Tar failed: " + str(e)
       err_code = -3
 
@@ -320,10 +325,10 @@ if archive_type:
       for dirpath, dirs, files in os.walk(backup_subdir):
         add_to_zip(zp, backup_dir, dirpath, dirs + files)
       zp.close()
-    except ImportError, e:
+    except ImportError as e:
       err_msg = "Import failed: " + str(e)
       err_code = -4
-    except zipfile.error, e:
+    except zipfile.error as e:
       err_msg = "Zip failed: " + str(e)
       err_code = -5
 
@@ -340,7 +345,7 @@ if archive_type:
 ###         NUM_BACKUPS.
 
 if num_backups > 0:
-  regexp = re.compile("^" + repo + "-[0-9]+(-[0-9]+)?" + ext_re + "$")
+  regexp = re.compile("^" + re.escape(repo) + "-[0-9]+(-[0-9]+)?" + ext_re + "$")
   directory_list = os.listdir(backup_dir)
   old_list = [x for x in directory_list if regexp.search(x)]
   old_list.sort(comparator)

Modified: subversion/branches/parallel-put/tools/client-side/svn-mergeinfo-normalizer/logic.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/tools/client-side/svn-mergeinfo-normalizer/logic.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/tools/client-side/svn-mergeinfo-normalizer/logic.c (original)
+++ subversion/branches/parallel-put/tools/client-side/svn-mergeinfo-normalizer/logic.c Thu Jan 21 21:39:22 2016
@@ -305,7 +305,7 @@ show_removing_obsoletes(svn_min__opt_sta
       && progress->needs_header)
     {
       SVN_ERR(svn_cmdline_printf(scratch_pool,
-                                _("\n    Removing obsolete entries ...\n")));
+                       _("\n    Trying to remove obsolete entries ...\n")));
       progress->needs_header = FALSE;
     }
 
@@ -498,9 +498,11 @@ find_surviving_copies(apr_array_header_t
  * enabled in it.
  *
  * If LOCAL_ONLY is set, only remove branches that are known to have been
- * deleted as per LOOKUP - this is for quick checks.  Track progress in
- * PROGRESS and update MERGEINFO is we can remove the info for branch PATH
- * from it.
+ * deleted (as per LOOKUP) with no surviving copies etc.  This is for quick
+ * checks.
+ *
+ * Track progress in PROGRESS and update MERGEINFO if we can remove the
+ * info for branch PATH from it.
  *
  * Use SCRATCH_POOL for temporaries.
  */
@@ -1339,10 +1341,10 @@ show_elision_result(svn_mergeinfo_t pare
           if (parent_mergeinfo)
             SVN_ERR(svn_cmdline_printf(scratch_pool,
                       _("\n    Sub-tree merge info cannot be elided due to "
-                        "the following branches:\n")));
+                        "the following branch(es):\n")));
           else
             SVN_ERR(svn_cmdline_printf(scratch_pool,
-                  _("\n    Merge info kept for the following branches:\n")));
+                _("\n    Merge info kept for the following branch(es):\n")));
 
           sorted_mi = svn_sort__hash(subtree_mergeinfo,
                                     svn_sort_compare_items_lexically,
@@ -1606,7 +1608,7 @@ show_obsoletes_summary(svn_min__branch_l
   iterpool = svn_pool_create(scratch_pool);
 
   SVN_ERR(svn_cmdline_printf(iterpool,
-                             _("\nEncountered %d missing branches:\n"),
+                             _("\nEncountered %d missing branch(es):\n"),
                              paths->nelts));
   for (i = 0; i < paths->nelts; ++i)
     {

Modified: subversion/branches/parallel-put/tools/dev/svnmover/merge3.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/tools/dev/svnmover/merge3.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/tools/dev/svnmover/merge3.c (original)
+++ subversion/branches/parallel-put/tools/dev/svnmover/merge3.c Thu Jan 21 21:39:22 2016
@@ -899,8 +899,9 @@ merge_subbranch(svn_branch__txn_t *edit_
                                          scratch_pool);
       svn_branch__state_t *edit_subbranch;
 
-      SVN_ERR(svn_branch__txn_branch(edit_txn, &edit_subbranch, from,
-                                     new_branch_id, scratch_pool, scratch_pool));
+      SVN_ERR(svn_branch__txn_open_branch(edit_txn, &edit_subbranch,
+                                          new_branch_id, from->eid, from,
+                                          scratch_pool, scratch_pool));
 
       /* subbranch possibly changed in source => merge */
       SVN_ERR(branch_merge_subtree_r(edit_txn, edit_subbranch,
@@ -933,8 +934,9 @@ merge_subbranch(svn_branch__txn_t *edit_
                                          svn_branch__root_eid(src_subbranch),
                                          scratch_pool);
 
-      SVN_ERR(svn_branch__txn_branch(edit_txn, NULL /*new_branch_p*/, from,
-                                     new_branch_id, scratch_pool, scratch_pool));
+      SVN_ERR(svn_branch__txn_open_branch(edit_txn, NULL /*new_branch_p*/,
+                                          new_branch_id, from->eid, from,
+                                          scratch_pool, scratch_pool));
     }
   else if (subbr_tgt)  /* added on target branch */
     {
@@ -948,8 +950,9 @@ merge_subbranch(svn_branch__txn_t *edit_
                                          svn_branch__root_eid(tgt_subbranch),
                                          scratch_pool);
 
-      SVN_ERR(svn_branch__txn_branch(edit_txn, NULL /*new_branch_p*/, from,
-                                     new_branch_id, scratch_pool, scratch_pool));
+      SVN_ERR(svn_branch__txn_open_branch(edit_txn, NULL /*new_branch_p*/,
+                                          new_branch_id, from->eid, from,
+                                          scratch_pool, scratch_pool));
     }
   else if (subbr_yca)  /* double delete */
     {

Modified: subversion/branches/parallel-put/tools/dev/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/tools/dev/svnmover/svnmover.c?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/tools/dev/svnmover/svnmover.c (original)
+++ subversion/branches/parallel-put/tools/dev/svnmover/svnmover.c Thu Jan 21 21:39:22 2016
@@ -917,6 +917,7 @@ svn_branch__replay(svn_branch__txn_t *ed
               SVN_ERR(svn_branch__txn_open_branch(edit_txn, &edit_subbranch,
                                                   new_branch_id,
                                                   svn_branch__root_eid(right_subbranch),
+                                                  NULL /*tree_ref*/,
                                                   scratch_pool, scratch_pool));
             }
 
@@ -1095,6 +1096,7 @@ update_wc_base_r(svnmover_wc_t *wc,
                                                   &base_subbranch,
                                                   new_branch_id,
                                                   svn_branch__root_eid(work_subbranch),
+                                                  NULL /*tree_ref*/,
                                                   scratch_pool, scratch_pool));
               SVN_ERR(svn_branch__state_get_history(
                         work_subbranch, &history, scratch_pool));
@@ -2634,6 +2636,7 @@ do_mkbranch(const char **new_branch_id_p
                                       scratch_pool);
   SVN_ERR(svn_branch__txn_open_branch(txn, &new_branch,
                                       new_branch_id, new_inner_eid,
+                                      NULL /*tree_ref*/,
                                       scratch_pool, scratch_pool));
   SVN_ERR(svn_branch__state_alter_one(new_branch, new_inner_eid,
                                       -1, "", payload, scratch_pool));
@@ -2683,9 +2686,9 @@ do_branch(svn_branch__state_t **new_bran
 
   new_branch_id = svn_branch__id_nest(to_outer_branch_id, to_outer_eid,
                                       scratch_pool);
-  SVN_ERR(svn_branch__txn_branch(txn, &new_branch,
-                                 from, new_branch_id,
-                                 result_pool, scratch_pool));
+  SVN_ERR(svn_branch__txn_open_branch(txn, &new_branch,
+                                      new_branch_id, from->eid, from,
+                                      result_pool, scratch_pool));
   history = svn_branch__history_create_empty(scratch_pool);
   SVN_ERR(svn_branch__history_add_parent(history, from->rev, from->bid,
                                          scratch_pool));
@@ -2718,9 +2721,9 @@ do_topbranch(svn_branch__state_t **new_b
   SVN_ERR(svn_branch__txn_new_eid(txn, &outer_eid, scratch_pool));
   new_branch_id = svn_branch__id_nest(NULL /*outer_branch*/, outer_eid,
                                       scratch_pool);
-  SVN_ERR(svn_branch__txn_branch(txn, &new_branch,
-                                 from, new_branch_id,
-                                 result_pool, scratch_pool));
+  SVN_ERR(svn_branch__txn_open_branch(txn, &new_branch,
+                                      new_branch_id, from->eid, from,
+                                      result_pool, scratch_pool));
 
   svnmover_notify_v("A+   (branch %s)",
                     new_branch->bid);

Modified: subversion/branches/parallel-put/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/branches/parallel-put/tools/dist/backport.pl?rev=1726108&r1=1726107&r2=1726108&view=diff
==============================================================================
--- subversion/branches/parallel-put/tools/dist/backport.pl (original)
+++ subversion/branches/parallel-put/tools/dist/backport.pl Thu Jan 21 21:39:22 2016
@@ -9,11 +9,11 @@ use v5.10.0; # needed for $^V
 # experimental and "subject to change" in v5.18 (see perl5180delta).  Every
 # use of it now triggers a warning.
 #
-# As of Perl v5.20.1, the semantics of given/when provided by Perl are
+# As of Perl v5.22.1, the semantics of given/when provided by Perl are
 # compatible with those expected by the script, so disable the warning for
 # those Perls.  But don't try to disable the the warning category on Perls
 # that don't know that category, since that breaks compilation.
-no if (v5.17.0 le $^V and $^V le v5.20.1),
+no if (v5.17.0 le $^V and $^V le v5.22.1),
    warnings => 'experimental::smartmatch';
 
 # Licensed to the Apache Software Foundation (ASF) under one



Mime
View raw message