Philip Martin <philip.mar...@wandisco.com> writes:

> What sort of URI do we have to supply?  Will a session relative <f> do?
> Or a server relative </obj/repo/A/f>?  Or a full scheme/host/port/path?

RFC 2518 says:

9.4 If Header

   If = "If" ":" ( 1*No-tag-list | 1*Tagged-list)
   No-tag-list = List
   Tagged-list = Resource 1*List
   Resource = Coded-URL
   List = "(" 1*(["Not"](State-token | "[" entity-tag "]")) ")"
   State-token = Coded-URL
   Coded-URL = "<" absoluteURI ">"

   Note that the absoluteURI production is defined in [RFC2396].

and 2396 says

   absoluteURI   = scheme ":" ( hier_part | opaque_part )

so how about this patch:

Index: subversion/libsvn_ra_serf/commit.c
===================================================================
--- subversion/libsvn_ra_serf/commit.c  (revision 1488294)
+++ subversion/libsvn_ra_serf/commit.c  (working copy)
@@ -804,8 +804,15 @@
       if (token)
         {
           const char *token_header;
+          const char *token_uri;
+          apr_uri_t uri = commit_ctx->session->session_url;
 
-          token_header = apr_pstrcat(pool, "(<", token, ">)", (char *)NULL);
+          uri.path = (char *)svn_path_url_add_component2(uri.path, relpath,
+                                                         pool);
+          token_uri = apr_uri_unparse(pool, &uri, 0);
+
+          token_header = apr_pstrcat(pool, "<", token_uri, "> (<", token, ">)",
+                                     (char *)NULL);
           serf_bucket_headers_set(headers, "If", token_header);
         }
     }


-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download

Reply via email to