subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1584737 - in /subversion/branches/1.8.x-r1584592: ./ subversion/mod_dav_svn/lock.c subversion/tests/cmdline/lock_tests.py
Date Fri, 04 Apr 2014 15:07:09 GMT
Author: rhuijben
Date: Fri Apr  4 15:07:08 2014
New Revision: 1584737

URL: http://svn.apache.org/r1584737
Log:
Merge r1584576,1584592 from trunk

Modified:
    subversion/branches/1.8.x-r1584592/   (props changed)
    subversion/branches/1.8.x-r1584592/subversion/mod_dav_svn/lock.c
    subversion/branches/1.8.x-r1584592/subversion/tests/cmdline/lock_tests.py

Propchange: subversion/branches/1.8.x-r1584592/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1584576,1584592

Modified: subversion/branches/1.8.x-r1584592/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1584592/subversion/mod_dav_svn/lock.c?rev=1584737&r1=1584736&r2=1584737&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1584592/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/1.8.x-r1584592/subversion/mod_dav_svn/lock.c Fri Apr  4 15:07:08 2014
@@ -453,7 +453,8 @@ get_locks(dav_lockdb *lockdb,
      lock.  For the --force case, this is required and for the non-force case,
      we allow the filesystem to produce a better error for svn clients.
   */
-  if (info->r->method_number == M_LOCK)
+  if (info->r->method_number == M_LOCK
+      && resource->info->repos->is_svn_client)
     {
       *locks = NULL;
       return 0;
@@ -594,7 +595,8 @@ has_locks(dav_lockdb *lockdb, const dav_
      lock.  For the --force case, this is required and for the non-force case,
      we allow the filesystem to produce a better error for svn clients.
   */
-  if (info->r->method_number == M_LOCK)
+  if (info->r->method_number == M_LOCK
+      && resource->info->repos->is_svn_client)
     {
       *locks_present = 0;
       return 0;

Modified: subversion/branches/1.8.x-r1584592/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x-r1584592/subversion/tests/cmdline/lock_tests.py?rev=1584737&r1=1584736&r2=1584737&view=diff
==============================================================================
--- subversion/branches/1.8.x-r1584592/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/1.8.x-r1584592/subversion/tests/cmdline/lock_tests.py Fri Apr  4 15:07:08
2014
@@ -1890,6 +1890,46 @@ def drop_locks_on_parent_deletion(sbox):
                                         wc_dir)
 	
 										
+@Issue(3515)
+@SkipUnless(svntest.main.is_ra_type_dav)
+def dav_lock_refresh(sbox):
+  "refresh timeout of DAV lock"
+
+  import httplib
+  from urlparse import urlparse
+  import base64
+
+  sbox.build(create_wc = False)
+
+  # Acquire lock on 'iota'
+  svntest.main.run_lock_helper(sbox.repo_dir, 'iota', 'jconstant', 3600)
+
+  # Try to refresh lock using 'If' header
+  loc = urlparse(sbox.repo_url)
+
+  if loc.scheme == 'http':
+    h = httplib.HTTPConnection(loc.hostname, loc.port)
+  else:
+    h = httplib.HTTPSConnection(loc.hostname, loc.port)
+
+  lock_token = svntest.actions.run_and_parse_info(sbox.repo_url + '/iota')[0]['Lock Token']
+
+  lock_headers = {
+    'Authorization': 'Basic ' + base64.b64encode('jconstant:rayjandom'),
+    'If': '(<' + lock_token + '>)',
+    'Timeout': 'Second-7200'
+  }
+
+  # Enabling the following line makes this test easier to debug
+  h.set_debuglevel(9)
+
+  h.request('LOCK', sbox.repo_url + '/iota', '', lock_headers)
+
+  # XFAIL Refreshing of DAV lock fails with error '412 Precondition Failed'
+  r = h.getresponse()
+  if r.status != httplib.OK:
+    raise svntest.Failure('Lock refresh failed: %d %s' % (r.status, r.reason))
+
 ########################################################################
 # Run the tests
 
@@ -1943,6 +1983,7 @@ test_list = [ None,
               lock_unlock_deleted,
               commit_stolen_lock,
               drop_locks_on_parent_deletion,
+              dav_lock_refresh,
             ]
 
 if __name__ == '__main__':



Mime
View raw message