You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/08/10 19:03:37 UTC

svn commit: r984122 [20/40] - in /subversion/branches/ignore-mergeinfo: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/generator/util/ build/hudson/ build/hudson/jobs/ build/hudson/jobs/subversion-1.6...

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/lock.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/lock.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/lock.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * lock.c :  routines for managing lock states in the DAV server
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -276,7 +276,7 @@ do_lock(svn_lock_t **lock,
      " <D:locktype><D:write /></D:locktype>" DEBUG_CR
      "%s" /* maybe owner */
      "</D:lockinfo>",
-     comment ? apr_pstrcat(pool, 
+     comment ? apr_pstrcat(pool,
                            "<D:owner>",
                            apr_xml_quote_string(pool, comment, 0),
                            "</D:owner>",
@@ -307,6 +307,16 @@ do_lock(svn_lock_t **lock,
 
  cleanup:
   svn_ra_neon__request_destroy(req);
+
+  /* 405 == Method Not Allowed (Occurs when trying to lock a working
+     copy path which no longer exists at HEAD in the repository. */
+  if (code == 405)
+    {
+      svn_error_clear(err);
+      err = svn_error_createf(SVN_ERR_FS_OUT_OF_DATE, NULL,
+                              _("Lock request failed: %d %s"),
+                              code, req->code_desc);
+    }
   return err;
 }
 

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/log.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/log.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/log.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * log.c :  routines for requesting and parsing log reports
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/merge.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/merge.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/merge.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * merge.c :  routines for performing a MERGE server requests
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/mergeinfo.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/mergeinfo.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/mergeinfo.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * mergeinfo.c :  routines for requesting and parsing mergeinfo reports
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/options.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/options.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * options.c :  routines for performing OPTIONS server requests
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/props.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/props.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * props.c :  routines for fetching DAV properties
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/ra_neon.h?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/ra_neon.h Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * ra_neon.h : Private declarations for the Neon-based DAV RA module.
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/replay.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/replay.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/replay.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * replay.c :  routines for replaying revisions
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/session.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/session.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/session.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/session.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * session.c :  routines for maintaining sessions state (to the DAV server)
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -1176,7 +1176,8 @@ static const svn_ra__vtable_t neon_vtabl
   svn_ra_neon__replay,
   svn_ra_neon__has_capability,
   svn_ra_neon__replay_range,
-  svn_ra_neon__get_deleted_rev
+  svn_ra_neon__get_deleted_rev,
+  NULL  /* svn_ra_neon__obliterate_node_rev */
 };
 
 svn_error_t *

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/util.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_neon/util.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * util.c :  utility functions for the RA/DAV library
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth.c Tue Aug 10 17:03:06 2010
@@ -1,10 +1,10 @@
 /* auth.c:  ra_serf authentication handling
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -33,6 +33,7 @@
 
 /*** Forward declarations. ***/
 
+#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
 static svn_error_t *
 handle_basic_auth(svn_ra_serf__handler_t *ctx,
                   serf_request_t *request,
@@ -51,6 +52,7 @@ setup_request_basic_auth(svn_ra_serf__co
                          const char *method,
                          const char *uri,
                          serf_bucket_t *hdrs_bkt);
+#endif
 
 static svn_error_t *
 handle_proxy_basic_auth(svn_ra_serf__handler_t *ctx,
@@ -82,6 +84,8 @@ default_auth_response_handler(svn_ra_ser
 
 /*** Global variables. ***/
 static const svn_ra_serf__auth_protocol_t serf_auth_protocols[] = {
+#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
+  /* serf handles Basic authentication. */
   {
     401,
     "Basic",
@@ -100,6 +104,7 @@ static const svn_ra_serf__auth_protocol_
     setup_request_proxy_basic_auth,
     default_auth_response_handler,
   },
+#endif
 #ifdef SVN_RA_SERF_SSPI_ENABLED
   {
     401,
@@ -120,6 +125,7 @@ static const svn_ra_serf__auth_protocol_
     default_auth_response_handler,
   },
 #endif /* SVN_RA_SERF_SSPI_ENABLED */
+#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
   {
     401,
     "Digest",
@@ -129,6 +135,7 @@ static const svn_ra_serf__auth_protocol_
     svn_ra_serf__setup_request_digest_auth,
     svn_ra_serf__validate_response_digest_auth,
   },
+#endif
 #ifdef SVN_RA_SERF_HAVE_GSSAPI
   {
     401,
@@ -137,7 +144,7 @@ static const svn_ra_serf__auth_protocol_
     svn_ra_serf__init_kerb_connection,
     svn_ra_serf__handle_kerb_auth,
     svn_ra_serf__setup_request_kerb_auth,
-    svn_ra_serf__validate_response_kerb_auth,    
+    svn_ra_serf__validate_response_kerb_auth,
   },
 #endif /* SVN_RA_SERF_HAVE_GSSAPI */
 
@@ -281,7 +288,7 @@ handle_auth_header(void *baton,
         }
     }
 
-  /* If a matching protocol handler was found, we can stop iterating 
+  /* If a matching protocol handler was found, we can stop iterating
      over the response headers - so return a non-0 value. */
   return proto_found;
 }
@@ -356,6 +363,7 @@ svn_ra_serf__handle_auth(int code,
   return SVN_NO_ERROR;
 }
 
+#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
 static svn_error_t *
 handle_basic_auth(svn_ra_serf__handler_t *ctx,
                   serf_request_t *request,
@@ -496,6 +504,7 @@ setup_request_basic_auth(svn_ra_serf__co
 
   return SVN_NO_ERROR;
 }
+#endif
 
 static svn_error_t *
 handle_proxy_basic_auth(svn_ra_serf__handler_t *ctx,

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * auth_digest.c : digest authn implementation
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -125,7 +125,7 @@ build_auth_header(serf_digest_context_t 
   svn_stringbuf_t *hdr;
   const char *ha2;
   const char *response;
-  unsigned char response_hdr[APR_MD5_DIGESTSIZE]; 
+  unsigned char response_hdr[APR_MD5_DIGESTSIZE];
   const char *response_hdr_hex;
   apr_status_t status;
 
@@ -191,7 +191,7 @@ build_auth_header(serf_digest_context_t 
       svn_stringbuf_appendcstr(hdr, context->algorithm);
       svn_stringbuf_appendcstr(hdr, "\"");
     }
-  
+
   return hdr->data;
 }
 
@@ -221,9 +221,9 @@ svn_ra_serf__handle_digest_auth(svn_ra_s
   /* Need a copy cuz we're going to write NUL characters into the string.  */
   attrs = apr_pstrdup(pool, auth_attr);
 
-  /* We're expecting a list of key=value pairs, separated by a comma. 
+  /* We're expecting a list of key=value pairs, separated by a comma.
      Ex. realm="SVN Digest",
-         nonce="f+zTl/leBAA=e371bd3070adfb47b21f5fc64ad8cc21adc371a5", 
+         nonce="f+zTl/leBAA=e371bd3070adfb47b21f5fc64ad8cc21adc371a5",
          algorithm=MD5, qop="auth" */
   for ( ; (key = apr_strtok(attrs, ",", &nextkv)) != NULL; attrs = NULL)
     {
@@ -249,7 +249,7 @@ svn_ra_serf__handle_digest_auth(svn_ra_s
               val++;
             }
         }
-      
+
       if (svn_cstring_casecmp(key, "realm") == 0)
         realm_name = val;
       else if (svn_cstring_casecmp(key, "nonce") == 0)
@@ -260,7 +260,7 @@ svn_ra_serf__handle_digest_auth(svn_ra_s
         qop = val;
       else if (svn_cstring_casecmp(key, "opaque") == 0)
         opaque = val;
-      
+
       /* Ignore all unsupported attributes. */
     }
   if (!realm_name)
@@ -269,7 +269,7 @@ svn_ra_serf__handle_digest_auth(svn_ra_s
         (SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
          _("Missing 'realm' attribute in Authorization header"));
     }
-  
+
   if (session->repos_url.port_str)
     {
       port = session->repos_url.port;
@@ -278,7 +278,7 @@ svn_ra_serf__handle_digest_auth(svn_ra_s
     {
       port = apr_uri_port_of_scheme(session->repos_url.scheme);
     }
-  
+
   session->realm = apr_psprintf(session->pool, "<%s://%s:%d> %s",
                                 session->repos_url.scheme,
                                 session->repos_url.hostname,
@@ -318,7 +318,7 @@ svn_ra_serf__handle_digest_auth(svn_ra_s
   simple_creds = creds;
 
   /* Store the digest authentication parameters in the context relative
-     to this connection, so we can use it to create the Authorization header 
+     to this connection, so we can use it to create the Authorization header
      when setting up requests. */
   if (conn->auth_context)
     context = conn->auth_context;
@@ -372,7 +372,7 @@ svn_ra_serf__setup_request_digest_auth(s
     {
       /* Build a new Authorization header. */
       conn->auth_header = "Authorization";
-      conn->auth_value = build_auth_header(context, uri, method, 
+      conn->auth_value = build_auth_header(context, uri, method,
                                            context->pool);
 
       serf_bucket_headers_setn(hdrs_bkt, conn->auth_header, conn->auth_value);
@@ -409,8 +409,8 @@ svn_ra_serf__validate_response_digest_au
   if (! auth_attr)
     return SVN_NO_ERROR;
 
-  /* We're expecting a list of key=value pairs, separated by a comma. 
-     Ex. rspauth="8a4b8451084b082be6b105e2b7975087", 
+  /* We're expecting a list of key=value pairs, separated by a comma.
+     Ex. rspauth="8a4b8451084b082be6b105e2b7975087",
          cnonce="346531653132652d303033392d3435", nc=00000007,
          qop=auth */
   for ( ; (key = apr_strtok(auth_attr, ",", &nextkv)) != NULL; auth_attr = NULL)
@@ -437,7 +437,7 @@ svn_ra_serf__validate_response_digest_au
               val++;
             }
         }
-      
+
       if (strcmp(key, "rspauth") == 0)
         rspauth = val;
       else if (strcmp(key, "qop") == 0)
@@ -446,7 +446,7 @@ svn_ra_serf__validate_response_digest_au
         nc_str = val;
     }
 
-  if (rspauth) 
+  if (rspauth)
     {
       const char *ha2, *tmp, *resp_hdr_hex;
       unsigned char resp_hdr[APR_MD5_DIGESTSIZE];

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.h?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_digest.h Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * auth_digest.h : Private declarations for digest authentication.
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -30,7 +30,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-/* Stores the context information related to Digest authentication. 
+/* Stores the context information related to Digest authentication.
    The context is per connection. */
 typedef struct
 {

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * auth_kerb.c : Kerberos authn implementation
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -34,9 +34,9 @@
 #include "auth_kerb.h"
 
 /** These functions implements Kerberos authentication, using GSS-API
- *  (RFC 2743). The message-exchange is documented in RFC 4559. 
- * 
- * Note: this implementation uses gssapi and only works on *nix. For 
+ *  (RFC 2743). The message-exchange is documented in RFC 4559.
+ *
+ * Note: this implementation uses gssapi and only works on *nix. For
  * the Windows Kerberos client check win32_auth_sspi.c.
  * ### TODO: Windows Kerberos client isn't implemented in ra_serf ATM.
  **/
@@ -58,10 +58,10 @@
  * - Authentication Server (AS): verifies users during login
  * - Ticket-Granting Server (TGS): issues proof of identity tickets
  * - HTTP server (S)
- * 
+ *
  * Steps:
  * 0. User logs in to the AS and receives a TGS ticket. On workstations
- * where the login program doesn't support Kerberos, the user can use 
+ * where the login program doesn't support Kerberos, the user can use
  * 'kinit'.
  *
  * 1. C  --> S:    GET
@@ -70,7 +70,7 @@
  *                 WWW-Authenticate: Negotiate
  *
  * -> Svn contacts the TGS to request a session key for the HTTP service
- *    @ target host. The returned session key is encrypted with the HTTP 
+ *    @ target host. The returned session key is encrypted with the HTTP
  *    service's secret key, so we can safely send it to the server.
  *
  * 2. C  --> S:    GET
@@ -78,7 +78,7 @@
  *                 gss_api_ctx->state = gss_api_auth_in_progress;
  *
  *    C <--  S:    200 OK
- *                 WWW-Authenticate: Negotiate <Base64 encoded server 
+ *                 WWW-Authenticate: Negotiate <Base64 encoded server
  *                                              authentication data>
  *
  * -> The server returned a key to proof itself to us. We check this key
@@ -93,7 +93,7 @@
  * be authenticated without needing to pass the WWW-Authenticate header.
  *
  * Note: Step 1 of the handshake will only happen on the first connection, once
- * we know the server requires Kerberos authentication, the initial requests 
+ * we know the server requires Kerberos authentication, the initial requests
  * on the other connections will include a session key, so we start  at
  * step 2 in the handshake.
  * ### TODO: Not implemented yet!

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.h?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/auth_kerb.h Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * auth_kerb.h : Private declarations for Kerberos authentication.
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/blame.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/blame.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/blame.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * blame.c :  entry point for blame RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/commit.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/commit.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * commit.c :  entry point for commit RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -271,8 +271,8 @@ handle_checkout(serf_request_t *request,
   svn_error_t *err = svn_ra_serf__handle_status_only(request, response,
                                                      &ctx->progress, pool);
 
-  /* These handler functions are supposed to return an APR_EOF status 
-     wrapped in a svn_error_t to indicate to serf that the response was 
+  /* These handler functions are supposed to return an APR_EOF status
+     wrapped in a svn_error_t to indicate to serf that the response was
      completely read. While we have to return this status code to our
      caller, we should treat it as the normal case for now. */
   if (err && ! APR_STATUS_IS_EOF(err->apr_err))
@@ -284,14 +284,18 @@ handle_checkout(serf_request_t *request,
       serf_bucket_t *hdrs;
       apr_uri_t uri;
       const char *location;
+      apr_status_t status;
 
       hdrs = serf_bucket_response_get_headers(response);
       location = serf_bucket_headers_get(hdrs, "Location");
       if (!location)
-        {
-          SVN_ERR_MALFUNCTION();
-        }
-      apr_uri_parse(pool, location, &uri);
+        return svn_error_create(SVN_ERR_RA_DAV_MALFORMED_DATA, err,
+                                _("No Location header received"));
+
+      status = apr_uri_parse(pool, location, &uri);
+
+      if (status)
+        err = svn_error_compose_create(svn_error_wrap_apr(status, NULL), err);
 
       ctx->resource_url = svn_uri_canonicalize(uri.path, ctx->pool);
     }
@@ -482,13 +486,33 @@ get_version_url(const char **checked_in_
     {
       svn_ra_serf__propfind_context_t *propfind_ctx;
       apr_hash_t *props;
+      const char *propfind_url;
 
       props = apr_hash_make(pool);
 
       propfind_ctx = NULL;
-      svn_ra_serf__deliver_props(&propfind_ctx, props, session,
-                                 conn, session->repos_url.path,
-                                 base_revision, "0",
+      if (SVN_IS_VALID_REVNUM(base_revision))
+        {
+          const char *bc_url, *bc_relpath;
+
+          /* mod_dav_svn can't handle the "Label:" header that
+             svn_ra_serf__deliver_props() is going to try to use for
+             this lookup, so we'll do things the hard(er) way, by
+             looking up the version URL from a resource in the
+             baseline collection. */
+          SVN_ERR(svn_ra_serf__get_baseline_info(&bc_url, &bc_relpath,
+                                                 session, conn,
+                                                 session->repos_url.path,
+                                                 base_revision, NULL, pool));
+          propfind_url = svn_path_url_add_component2(bc_url, bc_relpath, pool);
+        }
+      else
+        {
+          propfind_url = session->repos_url.path;
+        }
+
+      svn_ra_serf__deliver_props(&propfind_ctx, props, session, conn,
+                                 propfind_url, base_revision, "0",
                                  checked_in_props, FALSE, NULL, pool);
 
       SVN_ERR(svn_ra_serf__wait_for_props(propfind_ctx, session, pool));
@@ -496,7 +520,7 @@ get_version_url(const char **checked_in_
       /* We wouldn't get here if the url wasn't found (404), so the checked-in
          property should have been set. */
       root_checkout =
-          svn_ra_serf__get_ver_prop(props, session->repos_url.path,
+          svn_ra_serf__get_ver_prop(props, propfind_url,
                                     base_revision, "DAV:", "checked-in");
 
       if (!root_checkout)
@@ -660,7 +684,7 @@ setup_proppatch_headers(serf_bucket_t *h
   if (SVN_IS_VALID_REVNUM(proppatch->base_revision))
     {
       serf_bucket_headers_set(headers, SVN_DAV_VERSION_NAME_HEADER,
-                              apr_psprintf(pool, "%ld", 
+                              apr_psprintf(pool, "%ld",
                                            proppatch->base_revision));
     }
 
@@ -1081,7 +1105,7 @@ open_root(void *edit_baton,
 
       handler->response_handler = post_response_handler;
       handler->response_baton = prc;
-    
+
       svn_ra_serf__request_create(handler);
 
       SVN_ERR(svn_ra_serf__context_run_wait(&post_ctx->done, ctx->session,
@@ -1145,7 +1169,7 @@ open_root(void *edit_baton,
                                 _("The OPTIONS response did not include the "
                                   "requested activity-collection-set value"));
 
-      ctx->activity_url = 
+      ctx->activity_url =
         svn_path_url_add_component2(activity_str, svn_uuid_generate(ctx->pool),
                                     ctx->pool);
       ctx->activity_url_len = strlen(ctx->activity_url);
@@ -1161,7 +1185,7 @@ open_root(void *edit_baton,
 
       handler->response_handler = svn_ra_serf__handle_status_only;
       handler->response_baton = mkact_ctx;
-    
+
       svn_ra_serf__request_create(handler);
 
       SVN_ERR(svn_ra_serf__context_run_wait(&mkact_ctx->done, ctx->session,
@@ -1178,7 +1202,7 @@ open_root(void *edit_baton,
         }
 
       /* Now go fetch our VCC and baseline so we can do a CHECKOUT. */
-      SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, ctx->session, 
+      SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, ctx->session,
                                         ctx->conn, ctx->pool));
 
       props = apr_hash_make(ctx->pool);
@@ -1212,8 +1236,8 @@ open_root(void *edit_baton,
       dir->changed_props = apr_hash_make(dir->pool);
       dir->removed_props = apr_hash_make(dir->pool);
 
-      SVN_ERR(get_version_url(&dir->url, dir->commit->session, 
-                              dir->commit->conn, dir->name, 
+      SVN_ERR(get_version_url(&dir->url, dir->commit->session,
+                              dir->commit->conn, dir->name,
                               dir->base_revision, ctx->checked_in_url,
                               dir->pool));
       ctx->checked_in_url = dir->url;
@@ -1282,7 +1306,7 @@ delete_entry(const char *path,
 
   if (USING_HTTPV2_COMMIT_SUPPORT(dir->commit))
     {
-      delete_target = svn_path_url_add_component2(dir->commit->txn_root_url, 
+      delete_target = svn_path_url_add_component2(dir->commit->txn_root_url,
                                                   path, dir->pool);
     }
   else
@@ -1392,7 +1416,7 @@ add_directory(const char *path,
     }
   else
     {
-      /* Ensure our parent is checked out. */ 
+      /* Ensure our parent is checked out. */
       SVN_ERR(checkout_dir(parent));
 
       dir->url = svn_path_url_add_component2(parent->commit->checked_in_url,
@@ -1656,7 +1680,7 @@ add_file(const char *path,
 
   while (deleted_parent && deleted_parent[0] != '\0')
     {
-      if (apr_hash_get(dir->commit->deleted_entries, 
+      if (apr_hash_get(dir->commit->deleted_entries,
                        deleted_parent, APR_HASH_KEY_STRING))
         {
           break;
@@ -1750,8 +1774,6 @@ apply_textdelta(void *file_baton,
   file_context_t *ctx = file_baton;
   const svn_ra_callbacks2_t *wc_callbacks;
   void *wc_callback_baton;
-  const char *tempfile_name;
-  svn_checksum_t *checksum;
 
   /* Store the stream in a temporary file; we'll give it to serf when we
    * close this file.
@@ -1764,17 +1786,9 @@ apply_textdelta(void *file_baton,
   wc_callbacks = ctx->commit->session->wc_callbacks;
   wc_callback_baton = ctx->commit->session->wc_callback_baton;
 
-  /* Avoid temp file name collisions by requesting unique temp file name
-     based on the checksum of CTX->NAME. */
-  SVN_ERR(svn_checksum(&checksum, svn_checksum_md5, ctx->name,
-                       strlen(ctx->name), ctx->pool));
-  tempfile_name = apr_psprintf(ctx->pool, "tempfile.%s",
-                               svn_checksum_to_cstring_display(checksum,
-                                                               ctx->pool));
-  SVN_ERR(svn_io_open_uniquely_named(&ctx->svndiff, NULL, NULL,
-                                     tempfile_name, ".tmp",
-                                     svn_io_file_del_on_pool_cleanup,
-                                     ctx->pool, ctx->pool));
+  SVN_ERR(svn_io_open_unique_file3(&ctx->svndiff, NULL, NULL,
+                                   svn_io_file_del_on_pool_cleanup,
+                                   ctx->pool, ctx->pool));
 
   ctx->stream = svn_stream_create(ctx, pool);
   svn_stream_set_write(ctx->stream, svndiff_stream_write);

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/fake_sspi.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/fake_sspi.h?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/fake_sspi.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/fake_sspi.h Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * fake_sspi.h : Fake header to stand in for Windows' sspi.h header
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/get_deleted_rev.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/get_deleted_rev.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/get_deleted_rev.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/get_deleted_rev.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * get_deleted_rev.c :  ra_serf get_deleted_rev API implementation.
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -136,24 +136,21 @@ cdata_getdrev(svn_ra_serf__xml_parser_t 
   return SVN_NO_ERROR;
 }
 
-#define GETDREV_HEADER "<S:get-deleted-rev-report xmlns:S=\"" \
-        SVN_XML_NAMESPACE "\" xmlns:D=\"DAV:\">"
-#define GETDREV_FOOTER "</S:get-deleted-rev-report>"
-
 static serf_bucket_t*
 create_getdrev_body(void *baton,
                     serf_bucket_alloc_t *alloc,
                     apr_pool_t *pool)
 {
-  serf_bucket_t *buckets, *tmp;
+  serf_bucket_t *buckets;
   drev_context_t *drev_ctx = baton;
 
   buckets = serf_bucket_aggregate_create(alloc);
 
-  tmp = SERF_BUCKET_SIMPLE_STRING_LEN(GETDREV_HEADER,
-                                      sizeof(GETDREV_HEADER) - 1,
-                                      alloc);
-  serf_bucket_aggregate_append(buckets, tmp);
+  svn_ra_serf__add_open_tag_buckets(buckets, alloc,
+                                    "S:get-deleted-rev-report",
+                                    "xmlns:S", SVN_XML_NAMESPACE,
+                                    "xmlns:D", "DAV:",
+                                    NULL, NULL);
 
   svn_ra_serf__add_tag_buckets(buckets,
                                "S:path", drev_ctx->path,
@@ -169,10 +166,8 @@ create_getdrev_body(void *baton,
                                apr_ltoa(pool, drev_ctx->end_revision),
                                alloc);
 
-  tmp = SERF_BUCKET_SIMPLE_STRING_LEN(GETDREV_FOOTER,
-                                      sizeof(GETDREV_FOOTER)-1,
-                                      alloc);
-  serf_bucket_aggregate_append(buckets, tmp);
+  svn_ra_serf__add_close_tag_buckets(buckets, alloc,
+                                     "S:get-deleted-rev-report");
 
   return buckets;
 }

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getdate.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getdate.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getdate.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getdate.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * getdate.c :  entry point for get_dated_revision for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocations.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocations.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocations.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocations.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * getlocations.c :  entry point for get_locations RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocationsegments.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocationsegments.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocationsegments.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocationsegments.c Tue Aug 10 17:03:06 2010
@@ -3,10 +3,10 @@
  *                          RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocks.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocks.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocks.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/getlocks.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * getlocks.c :  entry point for get_locks RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/locks.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/locks.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/locks.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/locks.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * locks.c :  entry point for locking RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -383,6 +383,14 @@ handle_lock(serf_request_t *request,
           return err;
         }
 
+      /* 405 == Method Not Allowed (Occurs when trying to lock a working
+         copy path which no longer exists at HEAD in the repository. */
+      if (sl.code == 405)
+        return svn_error_createf(SVN_ERR_FS_OUT_OF_DATE,
+                                 NULL,
+                                 _("Lock request failed: %d %s"),
+                                   ctx->status_code, ctx->reason);
+
       headers = serf_bucket_response_get_headers(response);
 
       val = serf_bucket_headers_get(headers, SVN_DAV_LOCK_OWNER_HEADER);

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/log.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/log.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * log.c :  entry point for log RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -277,7 +277,7 @@ start_log(svn_ra_serf__xml_parser_t *par
         {
           info = push_state(parser, log_ctx, DELETED_PATH);
           info->tmp_path->action = 'D';
-          
+
           SVN_ERR(read_changed_path_attributes(info->tmp_path, attrs));
         }
       else if (strcmp(name.name, "modified-path") == 0)

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/merge.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/merge.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/merge.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * merge.c :  MERGE response parsing functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -329,7 +329,7 @@ end_merge(svn_ra_serf__xml_parser_t *par
               checked_in_str.len = strlen(checked_in);
 
               SVN_ERR(ctx->session->wc_callbacks->push_wc_prop(
-                ctx->session->wc_callback_baton, href, 
+                ctx->session->wc_callback_baton, href,
                 SVN_RA_SERF__WC_CHECKED_IN_URL, &checked_in_str, info->pool));
             }
         }

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/mergeinfo.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/mergeinfo.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * mergeinfo.c : entry point for mergeinfo RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -116,16 +116,17 @@ end_element(svn_ra_serf__xml_parser_t *p
   else if (state == MERGEINFO_ITEM
            && strcmp(name.name, SVN_DAV__MERGEINFO_ITEM) == 0)
     {
-      if (mergeinfo_ctx->curr_info && mergeinfo_ctx->curr_path->len)
+      if (mergeinfo_ctx->curr_info && mergeinfo_ctx->curr_path)
         {
           svn_mergeinfo_t path_mergeinfo;
+
+          SVN_ERR_ASSERT(mergeinfo_ctx->curr_path->data);
           SVN_ERR(svn_mergeinfo_parse(&path_mergeinfo,
                                       mergeinfo_ctx->curr_info->data,
                                       mergeinfo_ctx->pool));
           apr_hash_set(mergeinfo_ctx->result_catalog,
-                       apr_pstrmemdup(mergeinfo_ctx->pool,
-                                      mergeinfo_ctx->curr_path->data,
-                                      mergeinfo_ctx->curr_path->len),
+                       apr_pstrdup(mergeinfo_ctx->pool,
+                                   mergeinfo_ctx->curr_path->data),
                        APR_HASH_KEY_STRING, path_mergeinfo);
         }
       svn_ra_serf__xml_pop_state(parser);

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/options.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/options.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * options.c :  entry point for OPTIONS RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -249,7 +249,7 @@ struct options_response_ctx_t {
   svn_ra_serf__xml_parser_t *parser_ctx;
 
   /* Session into which we'll store server capabilities */
-  svn_ra_serf__session_t *session;      
+  svn_ra_serf__session_t *session;
 
   /* For temporary work only. */
   apr_pool_t *pool;

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/property.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/property.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * property.c : property routines for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -660,7 +660,7 @@ svn_ra_serf__deliver_props(svn_ra_serf__
       if (SVN_IS_VALID_REVNUM(rev))
         {
           SVN_ERR_ASSERT(((*prop_ctx)->label)
-                         && (strcmp((*prop_ctx)->label, 
+                         && (strcmp((*prop_ctx)->label,
                                     apr_ltoa(pool, rev)) == 0));
         }
       else
@@ -1022,7 +1022,7 @@ svn_ra_serf__get_baseline_info(const cha
                                                    revision, "DAV:",
                                                    "baseline-collection");
         }
-      
+
       if (!basecoll_url)
         {
           return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,
@@ -1035,10 +1035,10 @@ svn_ra_serf__get_baseline_info(const cha
       if (latest_revnum)
         {
           const char *version_name;
-          
+
           version_name = svn_ra_serf__get_prop(props, baseline_url,
                                                "DAV:", SVN_DAV__VERSION_NAME);
-          
+
           if (!version_name)
             {
               return svn_error_create(SVN_ERR_RA_DAV_OPTIONS_REQ_FAILED, NULL,

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/ra_serf.h?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/ra_serf.h Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * ra_serf.h : Private declarations for the Serf-based DAV RA module.
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -1402,6 +1402,16 @@ svn_ra_serf__get_deleted_rev(svn_ra_sess
 /*** Authentication handler declarations ***/
 
 /**
+ * Callback function that loads the credentials for Basic and Digest
+ * authentications, both for server and proxy authentication.
+ */
+apr_status_t
+svn_ra_serf__credentials_callback(char **username, char **password,
+                                  serf_request_t *request, void *baton,
+                                  int code, const char *authn_type,
+                                  const char *realm,
+                                  apr_pool_t *pool);
+/**
  * For each authentication protocol we need a handler function of type
  * svn_serf__auth_handler_func_t. This function will be called when an
  * authentication challenge is received in a session.
@@ -1437,7 +1447,7 @@ typedef svn_error_t *
                                   serf_bucket_t *hdrs_bkt);
 
 /**
- * This function will be called when a response is received, so that the 
+ * This function will be called when a response is received, so that the
  * protocol handler can validate the Authentication related response headers
  * (if needed).
  */

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/replay.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/replay.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * replay.c :  entry point for replay RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/serf.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/serf.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * serf.c :  entry point for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -86,7 +86,7 @@ static svn_error_t *
 load_http_auth_types(apr_pool_t *pool, svn_config_t *config,
                      const char *server_group,
                      svn_ra_serf__authn_types *authn_types)
-{                   
+{
   const char *http_auth_types = NULL;
   *authn_types = svn_ra_serf__authn_none;
 
@@ -303,9 +303,15 @@ load_config(svn_ra_serf__session_t *sess
   else
     session->using_proxy = FALSE;
 
-  /* Load the list of support authn types. */
-   SVN_ERR(load_http_auth_types(pool, config, server_group,
-           &session->authn_types));
+  /* Setup authentication. */
+  SVN_ERR(load_http_auth_types(pool, config, server_group,
+                               &session->authn_types));
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+  /* TODO: convert string authn types to SERF_AUTHN bitmask.
+     serf_config_authn_types(session->context, session->authn_types);*/
+  serf_config_credentials_callback(session->context,
+                                   svn_ra_serf__credentials_callback);
+#endif
 
   return SVN_NO_ERROR;
 }
@@ -360,14 +366,12 @@ svn_ra_serf__open(svn_ra_session_t *sess
      older, for root paths url.path will be "", where serf requires "/". */
   if (url.path == NULL || url.path[0] == '\0')
     url.path = apr_pstrdup(serf_sess->pool, "/");
-
-  serf_sess->repos_url = url;
-  serf_sess->repos_url_str = apr_pstrdup(serf_sess->pool, repos_URL);
-
   if (!url.port)
     {
       url.port = apr_uri_port_of_scheme(url.scheme);
     }
+  serf_sess->repos_url = url;
+  serf_sess->repos_url_str = apr_pstrdup(serf_sess->pool, repos_URL);
   serf_sess->using_ssl = (svn_cstring_casecmp(url.scheme, "https") == 0);
 
   serf_sess->capabilities = apr_hash_make(serf_sess->pool);
@@ -430,11 +434,15 @@ svn_ra_serf__open(svn_ra_session_t *sess
     serf_sess->conns[0]->useragent = USER_AGENT;
 
   /* go ahead and tell serf about the connection. */
-  serf_sess->conns[0]->conn =
-      serf_connection_create(serf_sess->context, serf_sess->conns[0]->address,
-                             svn_ra_serf__conn_setup, serf_sess->conns[0],
-                             svn_ra_serf__conn_closed, serf_sess->conns[0],
-                             serf_sess->pool);
+  status =
+    serf_connection_create2(&serf_sess->conns[0]->conn,
+                            serf_sess->context,
+                            url,
+                            svn_ra_serf__conn_setup, serf_sess->conns[0],
+                            svn_ra_serf__conn_closed, serf_sess->conns[0],
+                            serf_sess->pool);
+  if (status)
+    return svn_error_wrap_apr(status, NULL);
 
   /* Set the progress callback. */
   serf_context_set_progress_cb(serf_sess->context, svn_ra_serf__progress,
@@ -509,7 +517,7 @@ svn_ra_serf__rev_proplist(svn_ra_session
   svn_ra_serf__session_t *session = ra_session->priv;
   apr_hash_t *props;
   const char *propfind_path;
-  
+
   props = apr_hash_make(pool);
   *ret_props = apr_hash_make(pool);
 
@@ -1014,7 +1022,8 @@ static const svn_ra__vtable_t serf_vtabl
   svn_ra_serf__replay,
   svn_ra_serf__has_capability,
   svn_ra_serf__replay_range,
-  svn_ra_serf__get_deleted_rev
+  svn_ra_serf__get_deleted_rev,
+  NULL  /* svn_ra_serf__obliterate_node_rev */
 };
 
 svn_error_t *

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/update.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/update.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * update.c :  entry point for update RA functions for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -1756,7 +1756,7 @@ end_report(svn_ra_serf__xml_parser_t *pa
           SVN_ERR(svn_ra_serf__get_relative_path(&fs_path, full_path,
                                                  ctx->sess, NULL, info->pool));
           info->delta_base = svn_string_createf(info->pool, "%s/%ld/%s",
-                                                ctx->sess->rev_root_stub, 
+                                                ctx->sess->rev_root_stub,
                                                 info->base_rev, fs_path);
         }
 
@@ -2127,7 +2127,7 @@ link_path(void *report_baton,
  * if the number of ACTIVE_REQS > REQS_PER_CONN or if there currently is
  * only one main connection open.
  */
-static void
+static svn_error_t *
 open_connection_if_needed(svn_ra_serf__session_t *sess, int active_reqs)
 {
   /* For each REQS_PER_CONN outstanding requests open a new connection, with
@@ -2136,6 +2136,7 @@ open_connection_if_needed(svn_ra_serf__s
       ((active_reqs / REQS_PER_CONN) > sess->num_conns))
     {
       int cur = sess->num_conns;
+      apr_status_t status;
 
       sess->conns[cur] = apr_palloc(sess->pool, sizeof(*sess->conns[cur]));
       sess->conns[cur]->bkt_alloc = serf_bucket_allocator_create(sess->pool,
@@ -2150,13 +2151,17 @@ open_connection_if_needed(svn_ra_serf__s
       sess->conns[cur]->last_status_code = -1;
       sess->conns[cur]->ssl_context = NULL;
       sess->conns[cur]->session = sess;
-      sess->conns[cur]->conn = serf_connection_create(sess->context,
-                                                      sess->conns[cur]->address,
-                                                      svn_ra_serf__conn_setup,
-                                                      sess->conns[cur],
-                                                      svn_ra_serf__conn_closed,
-                                                      sess->conns[cur],
-                                                      sess->pool);
+      status = serf_connection_create2(&sess->conns[cur]->conn,
+                                       sess->context,
+                                       sess->repos_url,
+                                       svn_ra_serf__conn_setup,
+                                       sess->conns[cur],
+                                       svn_ra_serf__conn_closed,
+                                       sess->conns[cur],
+                                       sess->pool);
+      if (status)
+        return svn_error_wrap_apr(status, NULL);
+
       sess->num_conns++;
 
       /* Authentication protocol specific initalization. */
@@ -2166,6 +2171,8 @@ open_connection_if_needed(svn_ra_serf__s
         sess->proxy_auth_protocol->init_conn_func(sess, sess->conns[cur],
                                                   sess->pool);
     }
+
+  return SVN_NO_ERROR;
 }
 
 static svn_error_t *
@@ -2220,7 +2227,7 @@ finish_report(void *report_baton,
   svn_ra_serf__request_create(handler);
 
   /* Open the first extra connection. */
-  open_connection_if_needed(sess, 0);
+  SVN_ERR(open_connection_if_needed(sess, 0));
 
   sess->cur_conn = 1;
   closed_root = FALSE;
@@ -2244,8 +2251,8 @@ finish_report(void *report_baton,
 
       /* Open extra connections if we have enough requests to send. */
       if (sess->num_conns < MAX_NR_OF_CONNS)
-        open_connection_if_needed(sess, report->active_fetches +
-                                        report->active_propfinds);
+        SVN_ERR(open_connection_if_needed(sess, report->active_fetches +
+                                          report->active_propfinds));
 
       /* Switch our connection. */
       if (!report->done)
@@ -2647,7 +2654,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
   if (SVN_IS_VALID_REVNUM(revision))
     {
       const char *baseline_url, *rel_path;
-      
+
       SVN_ERR(svn_ra_serf__get_baseline_info(&baseline_url, &rel_path,
                                              session, conn, fetch_url,
                                              revision, NULL, pool));

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/util.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/util.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * util.c : serf utility routines for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at
@@ -102,7 +102,7 @@ construct_realm(svn_ra_serf__session_t *
     {
       port = apr_uri_port_of_scheme(session->repos_url.scheme);
     }
-  
+
   realm = apr_psprintf(pool, "%s://%s:%d",
                        session->repos_url.scheme,
                        session->repos_url.hostname,
@@ -257,7 +257,7 @@ load_authorities(svn_ra_serf__connection
 /* This ugly ifdef construction can be cleaned up as soon as serf >= 0.4
    gets the minimum supported serf version! */
 
-/* svn_ra_serf__conn_setup is a callback for serf. This function 
+/* svn_ra_serf__conn_setup is a callback for serf. This function
    creates a read bucket and will wrap the write bucket if SSL
    is needed. */
 apr_status_t
@@ -267,7 +267,6 @@ svn_ra_serf__conn_setup(apr_socket_t *so
                         void *baton,
                         apr_pool_t *pool)
 {
-  serf_bucket_t *wb = NULL;
 #else
 /* This is the old API, for compatibility with serf
    versions <= 0.3. */
@@ -288,11 +287,6 @@ svn_ra_serf__conn_setup(apr_socket_t *so
       /* input stream */
       rb = serf_bucket_ssl_decrypt_create(rb, conn->ssl_context,
                                           conn->bkt_alloc);
-#if SERF_VERSION_AT_LEAST(0, 4, 0)
-      /* output stream */
-      *write_bkt = serf_bucket_ssl_encrypt_create(*write_bkt, conn->ssl_context,
-                                                  conn->bkt_alloc);
-#endif
       if (!conn->ssl_context)
         {
           conn->ssl_context = serf_bucket_ssl_encrypt_context_get(rb);
@@ -326,6 +320,12 @@ svn_ra_serf__conn_setup(apr_socket_t *so
                 }
             }
         }
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+      /* output stream */
+      *write_bkt = serf_bucket_ssl_encrypt_create(*write_bkt, conn->ssl_context,
+                                                  conn->bkt_alloc);
+#endif
+
     }
 
 #if SERF_VERSION_AT_LEAST(0, 4, 0)
@@ -333,7 +333,7 @@ svn_ra_serf__conn_setup(apr_socket_t *so
 
   return APR_SUCCESS;
 }
-#else  
+#else
   return rb;
 }
 #endif
@@ -504,11 +504,14 @@ svn_ra_serf__setup_serf_req(serf_request
 {
   serf_bucket_t *hdrs_bkt;
 
-  *req_bkt = serf_bucket_request_create(method, url, body_bkt,
-                                        serf_request_get_alloc(request));
+  *req_bkt =
+    serf_request_bucket_request_create(request, method, url, body_bkt,
+                                       serf_request_get_alloc(request));
 
   hdrs_bkt = serf_bucket_request_get_headers(*req_bkt);
+#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
   serf_bucket_headers_setn(hdrs_bkt, "Host", conn->hostinfo);
+#endif
   serf_bucket_headers_setn(hdrs_bkt, "User-Agent", conn->useragent);
 
   if (content_type)
@@ -553,15 +556,6 @@ svn_ra_serf__setup_serf_req(serf_request
     }
 #endif
 
-  /* Set up Proxy settings */
-  if (conn->session->using_proxy)
-    {
-      char *root = apr_uri_unparse(conn->session->pool,
-                                   &conn->session->repos_url,
-                                   APR_URI_UNP_OMITPATHINFO);
-      serf_bucket_request_set_root(*req_bkt, root);
-    }
-
   if (ret_hdrs_bkt)
     {
       *ret_hdrs_bkt = hdrs_bkt;
@@ -783,7 +777,7 @@ svn_ra_serf__handle_discard_body(serf_re
 
   if (status)
     return svn_error_wrap_apr(status, NULL);
-  
+
   return SVN_NO_ERROR;
 }
 
@@ -1058,6 +1052,7 @@ svn_ra_serf__handle_xml_parser(serf_requ
   apr_status_t status;
   int xml_status;
   svn_ra_serf__xml_parser_t *ctx = baton;
+  svn_error_t *err;
 
   serf_bucket_response_status(response, &sl);
 
@@ -1083,10 +1078,11 @@ svn_ra_serf__handle_xml_parser(serf_requ
             }
         }
 
-      SVN_ERR(svn_error_compose_create(
-          svn_ra_serf__handle_server_error(request, response, pool),
-          svn_ra_serf__handle_discard_body(request, response, NULL, pool)));
+      err = svn_ra_serf__handle_server_error(request, response, pool);
 
+      SVN_ERR(svn_error_compose_create(
+        svn_ra_serf__handle_discard_body(request, response, NULL, pool),
+        err));
       return SVN_NO_ERROR;
     }
 
@@ -1177,6 +1173,85 @@ svn_ra_serf__handle_server_error(serf_re
   return server_err.error;
 }
 
+apr_status_t
+svn_ra_serf__credentials_callback(char **username, char **password,
+                                  serf_request_t *request, void *baton,
+                                  int code, const char *authn_type,
+                                  const char *realm,
+                                  apr_pool_t *pool)
+{
+  svn_ra_serf__handler_t *ctx = baton;
+  svn_ra_serf__session_t *session = ctx->session;
+  void *creds;
+  svn_auth_cred_simple_t *simple_creds;
+  svn_error_t *err;
+
+  if (code == 401)
+    {
+      /* Use svn_auth_first_credentials if this is the first time we ask for
+         credentials during this session OR if the last time we asked
+         session->auth_state wasn't set (eg. if the credentials provider was
+         cancelled by the user). */
+      if (!session->auth_state)
+        {
+          err = svn_auth_first_credentials(&creds,
+                                           &session->auth_state,
+                                           SVN_AUTH_CRED_SIMPLE,
+                                           realm,
+                                           session->wc_callbacks->auth_baton,
+                                           session->pool);
+        }
+      else
+        {
+          err = svn_auth_next_credentials(&creds,
+                                          session->auth_state,
+                                          session->pool);
+        }
+
+      if (err)
+        {
+          ctx->session->pending_error = err;
+          return err->apr_err;
+        }
+
+      session->auth_attempts++;
+
+      if (!creds || session->auth_attempts > 4)
+        {
+          /* No more credentials. */
+          ctx->session->pending_error =
+            svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
+                             "No more credentials or we tried too many times.\n"
+                             "Authentication failed");
+          return SVN_ERR_AUTHN_FAILED;
+        }
+
+      simple_creds = creds;
+      *username = apr_pstrdup(pool, simple_creds->username);
+      *password = apr_pstrdup(pool, simple_creds->password);
+    }
+  else
+    {
+      *username = apr_pstrdup(pool, session->proxy_username);
+      *password = apr_pstrdup(pool, session->proxy_password);
+
+      session->proxy_auth_attempts++;
+
+      if (!session->proxy_username || session->proxy_auth_attempts > 4)
+        {
+          /* No more credentials. */
+          ctx->session->pending_error =
+            svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
+                             "Proxy authentication failed");
+          return SVN_ERR_AUTHN_FAILED;
+        }
+    }
+
+  ctx->conn->last_status_code = code;
+
+  return APR_SUCCESS;
+}
+
 /* Implements the serf_response_handler_t interface.  Wait for HTTP
    response status and headers, and invoke CTX->response_handler() to
    carry out operation-specific processing.  Afterwards, check for
@@ -1245,8 +1320,11 @@ handle_response(serf_request_t *request,
         {
           ctx->session->pending_error =
               svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA,
-                                ctx->session->pending_error,
-                               _("Premature EOF seen from server"));
+                                svn_error_compose_create(
+                                           ctx->session->pending_error,
+                                           svn_error_wrap_apr(status, NULL)),
+                                _("Premature EOF seen from server "
+                                  "(http status=%d)"), sl.code);
           /* This discard may be no-op, but let's preserve the algorithm
              used elsewhere in this function for clarity's sake. */
           svn_ra_serf__response_discard_handler(request, response, NULL, pool);
@@ -1304,7 +1382,7 @@ handle_response(serf_request_t *request,
       ctx->session->pending_error = svn_error_compose_create(
                  svn_ra_serf__handle_server_error(request, response, pool),
                  ctx->session->pending_error);
-          
+
       if (!ctx->session->pending_error)
         {
           ctx->session->pending_error =
@@ -1347,7 +1425,7 @@ handle_response(serf_request_t *request,
           status = err->apr_err;
           if (!SERF_BUCKET_READ_ERROR(err->apr_err))
             {
-              /* These errors are special cased in serf 
+              /* These errors are special cased in serf
                  ### We hope no handler returns these by accident. */
               svn_error_clear(err);
             }
@@ -1623,7 +1701,7 @@ svn_ra_serf__get_relative_path(const cha
                                apr_pool_t *pool)
 {
   const char *decoded_root, *decoded_orig;
-    
+
   if (! session->repos_root.path)
     {
       const char *vcc_url;
@@ -1635,8 +1713,8 @@ svn_ra_serf__get_relative_path(const cha
       /* We don't actually care about the VCC_URL, but this API
          promises to populate the session's root-url cache, and that's
          what we really want. */
-      SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, session, 
-                                        conn ? conn : session->conns[0], 
+      SVN_ERR(svn_ra_serf__discover_vcc(&vcc_url, session,
+                                        conn ? conn : session->conns[0],
                                         pool));
     }
 

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * win32_auth_sspi.c : authn implementation through SSPI
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.h?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/win32_auth_sspi.h Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * win32_auth_sspi.h : Private declarations for Windows SSPI authentication.
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at

Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/xml.c?rev=984122&r1=984121&r2=984122&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_ra_serf/xml.c Tue Aug 10 17:03:06 2010
@@ -2,10 +2,10 @@
  * xml.c :  standard XML parsing routines for ra_serf
  *
  * ====================================================================
- *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    Licensed to the Apache Software Foundation (ASF) under one
  *    or more contributor license agreements.  See the NOTICE file
  *    distributed with this work for additional information
- *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    regarding copyright ownership.  The ASF licenses this file
  *    to you under the Apache License, Version 2.0 (the
  *    "License"); you may not use this file except in compliance
  *    with the License.  You may obtain a copy of the License at