[svk-devel] Problem in SVN::Mirror::Ra.pm
Rolf Schäuble
mailinglists at rschaeuble.de
Wed Nov 1 13:23:13 EST 2006
Hi,
It took me a few days longer than I though, but well, here's the patch.
I have just fixed the case that I could test. But there's still an
'else' branch for older clients. When I tested that locally by
forcing the else-branch to be executed, it failed. But since I can't
test with an older client right now, I've just let that code unchanged.
Best regards
Rolf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SVN-Mirror-Ra-get_log-failes.patch
Type: application/octet-stream
Size: 1291 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/svk-devel/attachments/20061101/55fc38a6/SVN-Mirror-Ra-get_log-failes.obj
-------------- next part --------------
Am 28.10.2006 um 07:51 schrieb Chia-Liang Kao:
> Thanks so much for looking into this. I noticed the problem a while
> ago with newer client library, and I think this is like what you said,
> client/server version combination problems. Also the behaviour is
> different depending on which ra transport is being used :(
>
> One of the reasons that get_latest_revnum is messy is that it's so
> hard to setup automated tests for different versions of client and
> server to test with. I might try to do something on this next week,
> or at least apply your patch..
>
> On 26/10/06, Rolf Sch?uble <mailinglists at rschaeuble.de> wrote:
>> Over the last days, I was hunting down two problems that I had with
>> SVK. It turned out to be a problem in SVN::Mirror::Ra.pm. I don't
>> know if this is the right place for reports on that code, but since
>> the code was written by the author of svk, I will start here.
>> Please tell me if it would be better to report it on a subversion
>> mailing list.
>>
>> The first problem was what I reported in a mail to this list with the
>> title "Error on svk sync -s". After I have first found (and fixed)
>> the second problem, I now understand what was going on. The client
>> was sending a log request for the revision range -1:-1 to the
>> subversion server, which responded with an empty answer. I just don't
>> know why it always worked when I tried it from work. Maybe because of
>> the combination of client and server svn libs? Unfortunately, I don't
>> know which version of svn that server runs; it doesn't report it in
>> its answers.
>>
>> The second problem I had was using 'sync -s' on the URL http://
>> svn.python.org/projects/python/trunk (this server is running svn
>> 1.1.4). Here the problem was different. SVK spent hours communicating
>> with the svn server, but never achieved anything. After sniffing the
>> network connection, I found that it sent the same sequence of REPORT
>> and a few PROPGET (I think that was it, if someone asks for it, I can
>> provide the ethereal logs) over and over again.
>> After this, I started to write a small test client, just using the
>> SVN::* classes directly, to track down the problem. In the end I
>> found it in SVN::Mirror::Ra.pm. In get_latest_rev(), it ran into the
>> until/if block, where it sends a log request in the range -1:-1. This
>> request is answered with an empty response by the server, so $rev
>> stays undefined. This causes the "until (defined $ref)" loop to run
>> again and again and again.....
>> I fixed this by changing that get_log call to query for the range
>> -1:0. That seems to work, both over dav as well as on local
>> repositories. I haven't tried it over svnserver yet, though.
>>
>> There are a few points about get_latest_rev which I don't understand:
>>
>> - Why did this work ever before? Was there a change in some version
>> of subversion, redefining the meaning of -1:-1?
>> - What is the line
>> my $_start = $self->{rsource} =~ m/^file/ ? 0 : -1;
>> good for? Especially when my 'fix' is to always use the value '0'.
>> - Would my change break anything? I changed the get_log call to this:
>> $ra->get_log ([''], $ra->get_latest_revnum, 0, 1, 0, 1, sub
>> { $rev = $_[1] });
>> always querying the log in the range -1:0. It would be especially
>> interesting to know if that doesn't work with older clients or
>> servers. I can't really test this myself right now.
>> - Does anyone know a bit more about the problem that long comment in
>> get_latest_rev refers to? I think it's missing a few details. Also,
>> the until/else block looks a bit strange to me. And when I tested it,
>> it didn't work.
>>
>> I will send a patch with my changes this weekend. But since I know
>> much too less about SVN and SVK, it would be great to get some
>> comments and answers.
>>
>> Thanks
>> Rolf
>>
>> _______________________________________________
>> svk-devel mailing list
>> svk-devel at bestpractical.com
>> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/svk-devel
>>
> _______________________________________________
> svk-devel mailing list
> svk-devel at bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/svk-devel
More information about the svk-devel
mailing list