Re: http-request PUT
i searched for a library to do this process but i couldn't find one the only library which looked helpful was this one: https://github.com/sara-nl/js-webdav-client but it didn't help... in case you had other libraries in mind i would be grateful to know, because since 4 to 5 days i'm searching for solutions right...i completly forgot to explain what i want to do... sorry for that okay i'm currently working on an arch linux vm on this vm i installed apache with svn - nobody else has curently access to this server, just me on my desktop (not within the vm) i try to to checkout an xml file (with keywords filed out) and show it within a table this task is already finished so right now i want to edit this file and commit it to the svn server in the end i want other users to access this file and edit it too in short: i want to use an html website to get an xml file from svn, edit it within my website an commit it to the server i'm providing some pseudo code with youngestRevision = 1040, cause i think the original code is a bit too big currently i'm using jquery to achieve this so within the get i do an OPTIONS to get the Youngest-Revision (1040), a PROPFIND, REPORT (for keywords) and a GET right now i do a calcMD5 on the xml String for the HashBase (the MD5 is the same as the one i get from the svn checkout) then i draw the table of the persons which i defined within the xml with some input fields i edit the xml-String after that i click a submit button OPTIONS, POST: URL: /svn/testfolder/!svn/me contentType: application/vnd.svn-skel BodyData: (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) PUT: URL: /svn/testfolder/!svn/txr/1040-uy/Test.xml contentType: text/xml headers X-SVN-Version-Name: 1040, X-SVN-Base-Fulltext-MD5: (HashBase) X-SVN-Result-Fulltext-MD5: (MD5 of the altered file) BodyData: alteredXmlString maybe this helps if the original source helps, here is my current source of the commit: http://stackoverflow.com/questions/24865265/how-to-do-svn-http-request-checkin-commit-within-html but until now nobody could really help me 2014-07-24 21:03 GMT+02:00 Ben Reser b...@reser.org: On 7/24/14 12:44 AM, merch store wrote: i thought the same, but i use the youngest revision i get from the OPTIONS the SVN-Txn-Name which i get from the POST request and need for the PUT is the same revision as the youngest revision is it possible that i need the revision in which my xml was edited the last time? or that the url for POST and PUT needs the following revision of the youngest revision? but if thats the case then i won't get the SVN-Txn-Name from the POST request, because it returns only the Txn-Name of the youngest rev not of the next rev I think you're confusing two different bases here. The transaction has a base, which happens to be included in the transation name (though this is an implementation detail and isn't something a client can count on). The base of a transaction is always the youngest revision at the time the transaction is created. However, the base of the file you're sending with PUT is not necessarily the same as the transaction base. Instead it should be the revision of the file that you modified to get the version you're about to commit (i.e. the version of the file that you checked out). If that happens to be the same as the transaction base that's fine. But in a busy repository it's likely not to be. You can mostly skip the out of date checks (i.e. you want to commit your new file regardless of what's there and possibly lose other changes people have made) you can do so by providing the youngest version you got from OPTIONS in X-SVN-Version-Name for the file, sending full text and not a delta, and NOT sending the X-SVN-Base-Fulltext-MD5 (since you may not even know it and it's not required). However, even this can fail with an out of date check if someone else happens to commit a change to that file while you're transmitting your commit. It'd probably be a lot easier to help you if you explain precisely what you're working on. Your description of want to do a checking from an html-site is far from being specific. You mention implementing a checkout but it's not clear if you have a working copy (I'm guessing not since doing that is far more complicated than the protocol). If you don't have a working copy then you need some way of storing the base information (something a working copy does for you) if you don't want to just overwrite whatever is in the repository. This however seems like an X-Y problem to me.[1] Unless your project absolutely can't do it I'd also strongly suggest that you use our library (or bindings) to do the actual communication with the server. We also have the svnmucc utility which is intended to support commits that aren't being done out of a working copy. If nothing else it may be
Re: http-request PUT
On 25.07.2014 10:39, merch store wrote: i searched for a library to do this process but i couldn't find one the only library which looked helpful was this one: https://github.com/sara-nl/js-webdav-client but it didn't help... in case you had other libraries in mind i would be grateful to know, because since 4 to 5 days i'm searching for solutions right...i completly forgot to explain what i want to do... sorry for that okay i'm currently working on an arch linux vm on this vm i installed apache with svn - nobody else has curently access to this server, just me on my desktop (not within the vm) i try to to checkout an xml file (with keywords filed out) and show it within a table this task is already finished so right now i want to edit this file and commit it to the svn server in the end i want other users to access this file and edit it too in short: i want to use an html website to get an xml file from svn, edit it within my website an commit it to the server You're still not telling what you want to do; just what you're doing. WHY do you want to write a Subversion client in JavaScript, instead of using our libraries or bindings to do that on the server? -- Brane -- Branko Čibej | Director of Subversion WANdisco | Realising the impossibilities of Big Data e. br...@wandisco.com
Re: http-request PUT
okay i found my mistake... in the X-SVN-Version-Name i've put a ' ' around the revision... because of that svn couldn't read it therefor the error... thanks for the help 2014-07-25 10:39 GMT+02:00 merch store primusma...@gmail.com: i searched for a library to do this process but i couldn't find one the only library which looked helpful was this one: https://github.com/sara-nl/js-webdav-client but it didn't help... in case you had other libraries in mind i would be grateful to know, because since 4 to 5 days i'm searching for solutions right...i completly forgot to explain what i want to do... sorry for that okay i'm currently working on an arch linux vm on this vm i installed apache with svn - nobody else has curently access to this server, just me on my desktop (not within the vm) i try to to checkout an xml file (with keywords filed out) and show it within a table this task is already finished so right now i want to edit this file and commit it to the svn server in the end i want other users to access this file and edit it too in short: i want to use an html website to get an xml file from svn, edit it within my website an commit it to the server i'm providing some pseudo code with youngestRevision = 1040, cause i think the original code is a bit too big currently i'm using jquery to achieve this so within the get i do an OPTIONS to get the Youngest-Revision (1040), a PROPFIND, REPORT (for keywords) and a GET right now i do a calcMD5 on the xml String for the HashBase (the MD5 is the same as the one i get from the svn checkout) then i draw the table of the persons which i defined within the xml with some input fields i edit the xml-String after that i click a submit button OPTIONS, POST: URL: /svn/testfolder/!svn/me contentType: application/vnd.svn-skel BodyData: (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) PUT: URL: /svn/testfolder/!svn/txr/1040-uy/Test.xml contentType: text/xml headers X-SVN-Version-Name: 1040, X-SVN-Base-Fulltext-MD5: (HashBase) X-SVN-Result-Fulltext-MD5: (MD5 of the altered file) BodyData: alteredXmlString maybe this helps if the original source helps, here is my current source of the commit: http://stackoverflow.com/questions/24865265/how-to-do-svn-http-request-checkin-commit-within-html but until now nobody could really help me 2014-07-24 21:03 GMT+02:00 Ben Reser b...@reser.org: On 7/24/14 12:44 AM, merch store wrote: i thought the same, but i use the youngest revision i get from the OPTIONS the SVN-Txn-Name which i get from the POST request and need for the PUT is the same revision as the youngest revision is it possible that i need the revision in which my xml was edited the last time? or that the url for POST and PUT needs the following revision of the youngest revision? but if thats the case then i won't get the SVN-Txn-Name from the POST request, because it returns only the Txn-Name of the youngest rev not of the next rev I think you're confusing two different bases here. The transaction has a base, which happens to be included in the transation name (though this is an implementation detail and isn't something a client can count on). The base of a transaction is always the youngest revision at the time the transaction is created. However, the base of the file you're sending with PUT is not necessarily the same as the transaction base. Instead it should be the revision of the file that you modified to get the version you're about to commit (i.e. the version of the file that you checked out). If that happens to be the same as the transaction base that's fine. But in a busy repository it's likely not to be. You can mostly skip the out of date checks (i.e. you want to commit your new file regardless of what's there and possibly lose other changes people have made) you can do so by providing the youngest version you got from OPTIONS in X-SVN-Version-Name for the file, sending full text and not a delta, and NOT sending the X-SVN-Base-Fulltext-MD5 (since you may not even know it and it's not required). However, even this can fail with an out of date check if someone else happens to commit a change to that file while you're transmitting your commit. It'd probably be a lot easier to help you if you explain precisely what you're working on. Your description of want to do a checking from an html-site is far from being specific. You mention implementing a checkout but it's not clear if you have a working copy (I'm guessing not since doing that is far more complicated than the protocol). If you don't have a working copy then you need some way of storing the base information (something a working copy does for you) if you don't want to just overwrite whatever is in the repository. This however seems like an X-Y problem to me.[1] Unless your project
Re: http-request PUT
i thought the same, but i use the youngest revision i get from the OPTIONS the SVN-Txn-Name which i get from the POST request and need for the PUT is the same revision as the youngest revision is it possible that i need the revision in which my xml was edited the last time? or that the url for POST and PUT needs the following revision of the youngest revision? but if thats the case then i won't get the SVN-Txn-Name from the POST request, because it returns only the Txn-Name of the youngest rev not of the next rev
Re: http-request PUT
On 7/24/14 12:44 AM, merch store wrote: i thought the same, but i use the youngest revision i get from the OPTIONS the SVN-Txn-Name which i get from the POST request and need for the PUT is the same revision as the youngest revision is it possible that i need the revision in which my xml was edited the last time? or that the url for POST and PUT needs the following revision of the youngest revision? but if thats the case then i won't get the SVN-Txn-Name from the POST request, because it returns only the Txn-Name of the youngest rev not of the next rev I think you're confusing two different bases here. The transaction has a base, which happens to be included in the transation name (though this is an implementation detail and isn't something a client can count on). The base of a transaction is always the youngest revision at the time the transaction is created. However, the base of the file you're sending with PUT is not necessarily the same as the transaction base. Instead it should be the revision of the file that you modified to get the version you're about to commit (i.e. the version of the file that you checked out). If that happens to be the same as the transaction base that's fine. But in a busy repository it's likely not to be. You can mostly skip the out of date checks (i.e. you want to commit your new file regardless of what's there and possibly lose other changes people have made) you can do so by providing the youngest version you got from OPTIONS in X-SVN-Version-Name for the file, sending full text and not a delta, and NOT sending the X-SVN-Base-Fulltext-MD5 (since you may not even know it and it's not required). However, even this can fail with an out of date check if someone else happens to commit a change to that file while you're transmitting your commit. It'd probably be a lot easier to help you if you explain precisely what you're working on. Your description of want to do a checking from an html-site is far from being specific. You mention implementing a checkout but it's not clear if you have a working copy (I'm guessing not since doing that is far more complicated than the protocol). If you don't have a working copy then you need some way of storing the base information (something a working copy does for you) if you don't want to just overwrite whatever is in the repository. This however seems like an X-Y problem to me.[1] Unless your project absolutely can't do it I'd also strongly suggest that you use our library (or bindings) to do the actual communication with the server. We also have the svnmucc utility which is intended to support commits that aren't being done out of a working copy. If nothing else it may be instructive to you as to how to handle this. [1] http://mywiki.wooledge.org/XyProblem
Re: http-request PUT
i already implemented every request needed checkout: OPTIONS, PROPFIND, OPTIONS, REPORT, GET checkin: OPTIONS, POST, PUT, (if succeeded: MERGE, otherwise: DELETE) currently my console says my xml file is out of date i think i've done everthing like svn (checked with wireshark what svn does) the url within PUT is correct, as headers i send the X-SVN-Version-Name, the X-SVN-Base-Fulltext-MD5 and the X-SVN-Result-Fulltext-MD5 contentType is application/vnd.svn-svndiff i think there are 2 possible mistakes first: svn thinks i want to check in an out of date data, so i have to tell svn it's not out of date second: the contentType is not application/vnd.svn-svndiff with the first one i dont know how to do that and with the second one i don't know what content it is just text/xml? after changing the contenttype to text/xml it still says .xml is out of date 2014-07-22 20:22 GMT+02:00 Philip Martin philip.mar...@wandisco.com: merch store primusma...@gmail.com writes: i want to do a checkin from an html-site. i already implemented the checkout so i roughly know how to implent http-requests. right now i nearly finished the task, i've got just one problem within the PUT methode. during the PUT you have to send a body which is a diff. but i don't know how svn solved this problem. i searched through the sources of svn but it was written in c (and little bit to complex to get an overview) and in multiple steps. does anybody know how to create the necessary diff or any other ways to solve this problem? PUT doesn't have to send a diff, sending the full text of the file works. The diff format is described here: http://svn.apache.org/repos/asf/subversion/trunk/notes/svndiff Note that a single PUT will be rejected unless the Apache server has enabled SVNAutoversioning for the repository. Without SVNAutoversioning you must send multiple requests to create a revision: POST, PUT and MERGE; or MKAKTIVITY, CHECKOUT, PUT and MERGE. Writing your own HTTP commit is not trivial, you should consider using the Subversion bindings. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*
AW: http-request PUT
Hi, merch store, which md5 sum are you sending as X-SVN-Base-Fulltext-MD5? The one of the latest revision in the repository? Best regards Markus Schaber CODESYS® a trademark of 3S-Smart Software Solutions GmbH Inspiring Automation Solutions 3S-Smart Software Solutions GmbH Dipl.-Inf. Markus Schaber | Product Development Core Technology Memminger Str. 151 | 87439 Kempten | Germany Tel. +49-831-54031-979 | Fax +49-831-54031-50 E-Mail: m.scha...@codesys.commailto:m.scha...@codesys.com | Web: codesys.comhttp://www.codesys.com | CODESYS store: store.codesys.comhttp://store.codesys.com CODESYS forum: forum.codesys.comhttp://forum.codesys.com Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Von: merch store [mailto:primusma...@gmail.com] Gesendet: Mittwoch, 23. Juli 2014 10:31 An: Philip Martin; users@subversion.apache.org Betreff: Re: http-request PUT i already implemented every request needed checkout: OPTIONS, PROPFIND, OPTIONS, REPORT, GET checkin: OPTIONS, POST, PUT, (if succeeded: MERGE, otherwise: DELETE) currently my console says my xml file is out of date i think i've done everthing like svn (checked with wireshark what svn does) the url within PUT is correct, as headers i send the X-SVN-Version-Name, the X-SVN-Base-Fulltext-MD5 and the X-SVN-Result-Fulltext-MD5 contentType is application/vnd.svn-svndiff i think there are 2 possible mistakes first: svn thinks i want to check in an out of date data, so i have to tell svn it's not out of date second: the contentType is not application/vnd.svn-svndiff with the first one i dont know how to do that and with the second one i don't know what content it is just text/xml? after changing the contenttype to text/xml it still says .xml is out of date 2014-07-22 20:22 GMT+02:00 Philip Martin philip.mar...@wandisco.commailto:philip.mar...@wandisco.com: merch store primusma...@gmail.commailto:primusma...@gmail.com writes: i want to do a checkin from an html-site. i already implemented the checkout so i roughly know how to implent http-requests. right now i nearly finished the task, i've got just one problem within the PUT methode. during the PUT you have to send a body which is a diff. but i don't know how svn solved this problem. i searched through the sources of svn but it was written in c (and little bit to complex to get an overview) and in multiple steps. does anybody know how to create the necessary diff or any other ways to solve this problem? PUT doesn't have to send a diff, sending the full text of the file works. The diff format is described here: http://svn.apache.org/repos/asf/subversion/trunk/notes/svndiff Note that a single PUT will be rejected unless the Apache server has enabled SVNAutoversioning for the repository. Without SVNAutoversioning you must send multiple requests to create a revision: POST, PUT and MERGE; or MKAKTIVITY, CHECKOUT, PUT and MERGE. Writing your own HTTP commit is not trivial, you should consider using the Subversion bindings. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*
Re: http-request PUT
during the checkout i get through the responsebody of options (by searching for SVN-Youngest-Rev) the latest revision on this revision i do a get and after that a calcMD5 on the xml i get from this revision so basically yes before the commit i alter the xml-string, do another calcMD5 on the new string and try to commit it 2014-07-23 14:51 GMT+02:00 Markus Schaber m.scha...@codesys.com: Hi, merch store, which md5 sum are you sending as X-SVN-Base-Fulltext-MD5? The one of the latest revision in the repository? Best regards Markus Schaber *CODESYS®* a trademark of 3S-Smart Software Solutions GmbH *Inspiring Automation Solutions * -- 3S-Smart Software Solutions GmbH Dipl.-Inf. Markus Schaber | Product Development Core Technology Memminger Str. 151 | 87439 Kempten | Germany Tel. +49-831-54031-979 | Fax +49-831-54031-50 E-Mail: m.scha...@codesys.com | Web: codesys.com http://www.codesys.com | CODESYS store: store.codesys.com CODESYS forum: forum.codesys.com *Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner* | *Trade register: Kempten HRB 6186* | *Tax ID No.: DE 167014915* * -- * *This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.* *Von:* merch store [mailto:primusma...@gmail.com] *Gesendet:* Mittwoch, 23. Juli 2014 10:31 *An:* Philip Martin; users@subversion.apache.org *Betreff:* Re: http-request PUT i already implemented every request needed checkout: OPTIONS, PROPFIND, OPTIONS, REPORT, GET checkin: OPTIONS, POST, PUT, (if succeeded: MERGE, otherwise: DELETE) currently my console says my xml file is out of date i think i've done everthing like svn (checked with wireshark what svn does) the url within PUT is correct, as headers i send the X-SVN-Version-Name, the X-SVN-Base-Fulltext-MD5 and the X-SVN-Result-Fulltext-MD5 contentType is application/vnd.svn-svndiff i think there are 2 possible mistakes first: svn thinks i want to check in an out of date data, so i have to tell svn it's not out of date second: the contentType is not application/vnd.svn-svndiff with the first one i dont know how to do that and with the second one i don't know what content it is just text/xml? after changing the contenttype to text/xml it still says .xml is out of date 2014-07-22 20:22 GMT+02:00 Philip Martin philip.mar...@wandisco.com: merch store primusma...@gmail.com writes: i want to do a checkin from an html-site. i already implemented the checkout so i roughly know how to implent http-requests. right now i nearly finished the task, i've got just one problem within the PUT methode. during the PUT you have to send a body which is a diff. but i don't know how svn solved this problem. i searched through the sources of svn but it was written in c (and little bit to complex to get an overview) and in multiple steps. does anybody know how to create the necessary diff or any other ways to solve this problem? PUT doesn't have to send a diff, sending the full text of the file works. The diff format is described here: http://svn.apache.org/repos/asf/subversion/trunk/notes/svndiff Note that a single PUT will be rejected unless the Apache server has enabled SVNAutoversioning for the repository. Without SVNAutoversioning you must send multiple requests to create a revision: POST, PUT and MERGE; or MKAKTIVITY, CHECKOUT, PUT and MERGE. Writing your own HTTP commit is not trivial, you should consider using the Subversion bindings. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*
AW: http-request PUT
Hi, merch store, I'm not into the details of the protocol, but my guess is that you should send the new, updated checksum only for X-SVN-Result-Fulltext-MD5 and not for X-SVN-Base-Fulltext-MD5. Best regards Markus Schaber CODESYS® a trademark of 3S-Smart Software Solutions GmbH Inspiring Automation Solutions 3S-Smart Software Solutions GmbH Dipl.-Inf. Markus Schaber | Product Development Core Technology Memminger Str. 151 | 87439 Kempten | Germany Tel. +49-831-54031-979 | Fax +49-831-54031-50 E-Mail: m.scha...@codesys.commailto:m.scha...@codesys.com | Web: codesys.comhttp://www.codesys.com | CODESYS store: store.codesys.comhttp://store.codesys.com CODESYS forum: forum.codesys.comhttp://forum.codesys.com Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Von: merch store [mailto:primusma...@gmail.com] Gesendet: Mittwoch, 23. Juli 2014 15:07 An: Markus Schaber Cc: users@subversion.apache.org Betreff: Re: http-request PUT during the checkout i get through the responsebody of options (by searching for SVN-Youngest-Rev) the latest revision on this revision i do a get and after that a calcMD5 on the xml i get from this revision so basically yes before the commit i alter the xml-string, do another calcMD5 on the new string and try to commit it 2014-07-23 14:51 GMT+02:00 Markus Schaber m.scha...@codesys.commailto:m.scha...@codesys.com: Hi, merch store, which md5 sum are you sending as X-SVN-Base-Fulltext-MD5? The one of the latest revision in the repository? Best regards Markus Schaber CODESYS® a trademark of 3S-Smart Software Solutions GmbH Inspiring Automation Solutions 3S-Smart Software Solutions GmbH Dipl.-Inf. Markus Schaber | Product Development Core Technology Memminger Str. 151 | 87439 Kempten | Germany Tel. +49-831-54031-979tel:%2B49-831-54031-979 | Fax +49-831-54031-50tel:%2B49-831-54031-50 E-Mail: m.scha...@codesys.commailto:m.scha...@codesys.com | Web: codesys.comhttp://www.codesys.com | CODESYS store: store.codesys.comhttp://store.codesys.com CODESYS forum: forum.codesys.comhttp://forum.codesys.com Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Von: merch store [mailto:primusma...@gmail.commailto:primusma...@gmail.com] Gesendet: Mittwoch, 23. Juli 2014 10:31 An: Philip Martin; users@subversion.apache.orgmailto:users@subversion.apache.org Betreff: Re: http-request PUT i already implemented every request needed checkout: OPTIONS, PROPFIND, OPTIONS, REPORT, GET checkin: OPTIONS, POST, PUT, (if succeeded: MERGE, otherwise: DELETE) currently my console says my xml file is out of date i think i've done everthing like svn (checked with wireshark what svn does) the url within PUT is correct, as headers i send the X-SVN-Version-Name, the X-SVN-Base-Fulltext-MD5 and the X-SVN-Result-Fulltext-MD5 contentType is application/vnd.svn-svndiff i think there are 2 possible mistakes first: svn thinks i want to check in an out of date data, so i have to tell svn it's not out of date second: the contentType is not application/vnd.svn-svndiff with the first one i dont know how to do that and with the second one i don't know what content it is just text/xml? after changing the contenttype to text/xml it still says .xml is out of date 2014-07-22 20:22 GMT+02:00 Philip Martin philip.mar...@wandisco.commailto:philip.mar...@wandisco.com: merch store primusma...@gmail.commailto:primusma...@gmail.com writes: i want to do a checkin from an html-site. i already implemented the checkout so i roughly know how to implent http-requests. right now i nearly finished the task, i've got just one problem within the PUT methode. during the PUT you have to send a body which is a diff. but i don't know how svn solved this problem. i searched through the sources of svn but it was written in c (and little bit to complex to get an overview) and in multiple steps. does anybody know how to create the necessary diff or any other ways to solve this problem? PUT doesn't have to send a diff, sending the full text of the file works. The diff format is described here: http://svn.apache.org
Re: http-request PUT
thanks for this idea, i tried it but the same error occured with wireshark i checked what svn roughly does and there it said that it transmitted the latest revision via X-SVN-Version-Name, the md5 of the latest revision via X-SVN-Base-Fulltext-MD5 and the md5 of the altered version via X-SVN-Result-Fulltext-MD5 i guess svn needs the md5 of the old version to verify that i want to overwrite this file, or just to check wether something was altered or not because if you want to do a commit while nothing was altered, svn doesn't do a anything as far as i could follow 2014-07-23 15:13 GMT+02:00 Markus Schaber m.scha...@codesys.com: Hi, merch store, I'm not into the details of the protocol, but my guess is that you should send the new, updated checksum only for X-SVN-Result-Fulltext-MD5 and not for X-SVN-Base-Fulltext-MD5. Best regards Markus Schaber *CODESYS®* a trademark of 3S-Smart Software Solutions GmbH *Inspiring Automation Solutions * -- 3S-Smart Software Solutions GmbH Dipl.-Inf. Markus Schaber | Product Development Core Technology Memminger Str. 151 | 87439 Kempten | Germany Tel. +49-831-54031-979 | Fax +49-831-54031-50 E-Mail: m.scha...@codesys.com | Web: codesys.com http://www.codesys.com | CODESYS store: store.codesys.com CODESYS forum: forum.codesys.com *Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner* | *Trade register: Kempten HRB 6186* | *Tax ID No.: DE 167014915* * -- * *This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.* *Von:* merch store [mailto:primusma...@gmail.com] *Gesendet:* Mittwoch, 23. Juli 2014 15:07 *An:* Markus Schaber *Cc:* users@subversion.apache.org *Betreff:* Re: http-request PUT during the checkout i get through the responsebody of options (by searching for SVN-Youngest-Rev) the latest revision on this revision i do a get and after that a calcMD5 on the xml i get from this revision so basically yes before the commit i alter the xml-string, do another calcMD5 on the new string and try to commit it 2014-07-23 14:51 GMT+02:00 Markus Schaber m.scha...@codesys.com: Hi, merch store, which md5 sum are you sending as X-SVN-Base-Fulltext-MD5? The one of the latest revision in the repository? Best regards Markus Schaber *CODESYS®* a trademark of 3S-Smart Software Solutions GmbH *Inspiring Automation Solutions * -- 3S-Smart Software Solutions GmbH Dipl.-Inf. Markus Schaber | Product Development Core Technology Memminger Str. 151 | 87439 Kempten | Germany Tel. +49-831-54031-979 | Fax +49-831-54031-50 E-Mail: m.scha...@codesys.com | Web: codesys.com http://www.codesys.com | CODESYS store: store.codesys.com CODESYS forum: forum.codesys.com *Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner* | *Trade register: Kempten HRB 6186* | *Tax ID No.: DE 167014915* * -- * *This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.* *Von:* merch store [mailto:primusma...@gmail.com] *Gesendet:* Mittwoch, 23. Juli 2014 10:31 *An:* Philip Martin; users@subversion.apache.org *Betreff:* Re: http-request PUT i already implemented every request needed checkout: OPTIONS, PROPFIND, OPTIONS, REPORT, GET checkin: OPTIONS, POST, PUT, (if succeeded: MERGE, otherwise: DELETE) currently my console says my xml file is out of date i think i've done everthing like svn (checked with wireshark what svn does) the url within PUT is correct, as headers i send the X-SVN-Version-Name, the X-SVN-Base-Fulltext-MD5 and the X-SVN-Result-Fulltext-MD5 contentType is application/vnd.svn-svndiff i think there are 2 possible mistakes first: svn thinks i want to check in an out of date data, so i have to tell svn it's not out of date second: the contentType is not application/vnd.svn-svndiff with the first one i dont know how to do that and with the second one i don't know what content it is just text/xml? after changing the contenttype to text/xml it still says .xml is out of date 2014-07-22 20:22 GMT+02:00 Philip Martin philip.mar...@wandisco.com: merch store primusma...@gmail.com writes: i want to do a checkin from an html-site. i already implemented the checkout so i roughly know how to implent http-requests. right now i nearly finished the task, i've got just one problem within the PUT methode
Re: http-request PUT
merch store primusma...@gmail.com writes: thanks for this idea, i tried it but the same error occured with wireshark i checked what svn roughly does and there it said that it transmitted the latest revision via X-SVN-Version-Name, the md5 of the latest revision via X-SVN-Base-Fulltext-MD5 and the md5 of the altered version via X-SVN-Result-Fulltext-MD5 i guess svn needs the md5 of the old version to verify that i want to overwrite this file, or just to check wether something was altered or not because if you want to do a commit while nothing was altered, svn doesn't do a anything as far as i could follow The server uses the base MD5 checksum to verify that the existing file in the repository has the expected content. The result MD5 checksum is used to verify that an expanded svndiff has the expected content. The server does not use the checksums to check whether something was altered--the server will accept commits that change a file text to the same content. If you are getting error 170004 out of date then it means the revision you are sending in X-SVN-Version-Name is older/lower than the most recent change to the file in the repository. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*
Re: http-request PUT
merch store primusma...@gmail.com writes: i want to do a checkin from an html-site. i already implemented the checkout so i roughly know how to implent http-requests. right now i nearly finished the task, i've got just one problem within the PUT methode. during the PUT you have to send a body which is a diff. but i don't know how svn solved this problem. i searched through the sources of svn but it was written in c (and little bit to complex to get an overview) and in multiple steps. does anybody know how to create the necessary diff or any other ways to solve this problem? PUT doesn't have to send a diff, sending the full text of the file works. The diff format is described here: http://svn.apache.org/repos/asf/subversion/trunk/notes/svndiff Note that a single PUT will be rejected unless the Apache server has enabled SVNAutoversioning for the repository. Without SVNAutoversioning you must send multiple requests to create a revision: POST, PUT and MERGE; or MKAKTIVITY, CHECKOUT, PUT and MERGE. Writing your own HTTP commit is not trivial, you should consider using the Subversion bindings. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*
http-request PUT
i want to do a checkin from an html-site. i already implemented the checkout so i roughly know how to implent http-requests. right now i nearly finished the task, i've got just one problem within the PUT methode. during the PUT you have to send a body which is a diff. but i don't know how svn solved this problem. i searched through the sources of svn but it was written in c (and little bit to complex to get an overview) and in multiple steps. does anybody know how to create the necessary diff or any other ways to solve this problem?