[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: http-request PUT

From: Ben Reser <ben_at_reser.org>
Date: Thu, 24 Jul 2014 12:03:52 -0700

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
Received on 2014-07-24 21:04:25 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.