i've got a problem
i want to use a website to do a checkin and checkout on my svn server. i already got everthing to the point where i can do a checkout using jQuery. my remaining problem is with the handling of the MERGE process. within the MERGE svn transmits a chunked response. but my console just reports Bad Request. wireshark told m that the Transfer-Encoding is chunked. but i couldn't set it to chunked. if i set the contentType to chunked the body is chunked not the transfere-encoding. and jquery.ajax() doesn't provide something as Transfer-Encoding. trying to put it into the headers didn't work as well...it didn't even show this header
my checkin code:
$.ajax({
type: "OPTIONS",
url: baseURL,
contentType: "text/xml",
data: '<?xml version="1.0" encoding="utf-8" ?><D:options xmlns:D="DAV:"><D:activity-collection-set></D:activity-collection-set></D:options>',
success: function(data1, status, jqxhr){
$.ajax({
type: "POST",
url: baseURL + "/!svn/me",
contentType: "application/vnd.svn-skel",
data: "(create-txn-with-props (svn:txn-user-agent 40 SVN/1.8.9(i686-pc-linux-gnu) serf/1.3.4 svn:log function svn:txn-client-compat-version 5 1.8.9))",
success: function(data2, status, jqxhr){
rev = jqxhr.getResponseHeader('SVN-Txn-Name');
newdata = new XMLSerializer().serializeToString(xmlString["context"]);
hashResult = calcMD5(newdata);
$.ajax({
type: "PUT",
url: baseURL + "/!svn/txr/" + rev + file + ".xml",
headers: {"X-SVN-Version-Name": latestRev, "X-SVN-Base-Fulltext-MD5":hashBase, "X-SVN-Result-Fulltext-MD5": hashResult},
contentType: "text/xml",
data: newdata,
success: function(data3, status, jqxhr){
chunked1 = '<?xml version="1.0" encoding="utf-8"?><D:merge xmlns:D="DAV:"><D:source><D:href>/svn/check/!svn/txn/' + rev + '</D:href></D:source><D:no-auto-merge></D:no-auto-merge><D:no-checkout></D:no-checkout><D:prop><D:checked-in></D:checked-in><D:version-name></D:version-name><D:resourcetype></D:resourcetype><D:creationdate></D:creationdate><D:creator-displayname>';
chunked2 = '</D:creator-displayname></D:prop></D:merge>';
length1 = chunked1.length;
length2 = chunked2.length;
$.ajax({
type: "MERGE",
url: baseURL,
headers: {"X-SVN-Options": "release-locks"},
contentType: "text/xml",
data: length1 + chunked1 + length2 + chunked2,
success: function(data4, status, jqxhr){
alert('file submitted');
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + ' at MERGE \n' + textStatus);
}
});
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + ' at PUT\n' + textStatus);
$.ajax({
type: "DELETE",
url: baseURL + "/!svn/txn/" + rev,
success: function(data3, status, jqxhr){
alert('file deleted');
}
});
}
});
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + ' at POST\n' + textStatus);
}
});
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + ' at OPTIONS\n' + textStatus);
}
});
EDIT: corrected some mistakes in my code changed the problemfocus from PUT to MERGE, because i found the problem the problem was that i transmitted within the "X-SVN-Version-Name" not just the number but 'number', therefore the error "File is out of Date"