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

Re: [bug] backwards compatibility APIs in 1.2 aren't really

From: Stephen Davis <subversion_at_soundgeek.org>
Date: 2005-06-23 22:47:20 CEST

On Jun 23, 2005, at 11:21 AM, kfogel@collab.net wrote:

> Stephen Davis <subversion@soundgeek.org> writes:
>
>> In 1.2, a bunch of the APIs adopted a peg_revision argument and the
>> implementations of the backwards-compatibility code for the 1.1. APIs
>> just call the new versions like so:
>>
>> svn_client_cat( stream, path, revision, context, pool )
>> {
>> return svn_client_cat2( stream, path, revision, revision,
>> context, pool );
>> }
>>
>> [It is not possible to produce a script with the 1.2 client that will
>> reproduce the error since this is at the API level so I'll just list
>> the appropriate pseudo-steps.]
>>
>> 1. create a repository
>> 2. Add a file to trunk, let's call it test.c (r1)
>> 3. Create a branch in branches/broken (r2)
>> 4. Modify test.c in the branch (r3)
>> 5. Set up and call to svn_client_cat() like so:
>> svn_opt_revision rev = { svn_opt_revision_number,
>> { 1 } };
>> svn_client_cat( stream, ./test.c, &rev, ctx, pool )
>>
>> You'll get an error like:
>>
>> svn: File not found: revision 1, path '/branches/broken/test.c'
>>
>> What you need to pass in the compatibility wrapper is
>> svn_opt_unspecified for the peg_revision argument to
>> svn_client_cat2().
>>
>> Note that you can reproduce the behavior by doing:
>>
>> svn cat -r 1 test.c@1
>>
>> but in this case, that is the correct behavior since that's what you
>> explicitly told it. However, it mimics what "svn cat -r 1 test.c"
>> would do if it were calling the svn_client_cat() function, not
>> svn_client_cat2().
>>
>> In addition, the 1.2 svn log *command* appears to have this bug too.
>>
>> svn log -r 1 test.c
>>
>> svn: File not found: revision 1, path '/branches/broken/test.c'
>>
>> If you do, "svn log -r 1:BASE test.c" then it works.
>>
>> Per the issue tracker guidelines, I'm posting this here first but
>> it's pretty clear that it's a bug. :-)
>>
>
> Thanks for the investigation. This probably will lead to filing a
> bug, and thence quickly to fixing, since it's so simple, but first:
>
> $ svn info README
> Path: README
> Name: README
> URL: http://svn.collab.net/repos/svn/trunk/README
> Repository Root: http://svn.collab.net/repos/svn
> Repository UUID: 65390229-12b7-0310-b90b-f21a5aa7ec8e
> Revision: 15156
> Node Kind: file
> Schedule: normal
> Last Changed Author: kfogel
> Last Changed Rev: 12812
> Last Changed Date: 2005-01-21 14:33:50 -0600 (Fri, 21 Jan 2005)
> Text Last Updated: 2005-04-01 16:28:41 -0600 (Fri, 01 Apr 2005)
> Properties Last Updated: 2005-04-01 16:28:41 -0600 (Fri, 01 Apr
> 2005)
> Checksum: ef2f4639c3ebe8c7490ed064a6b11311
> $ svn log -r1 README
>
> ----------------------------------------------------------------------
> --
> r1 | svn | 2001-08-30 23:24:14 -0500 (Thu, 30 Aug 2001) | 1 line
>
> Initial import.
>
> ----------------------------------------------------------------------
> --
> $
>
> That's with head of trunk today. I don't have a 1.2 subversion
> around, but can you tell us the output of 'svn info test.c' in your
> last recipe above?
>
> I've added dev@ to the recipients, by the way. You can take users@
> off on your next reply, I just wanted to let people there know that
> this had been acknowledged over on dev@.

[Please cc me moving forward since I am not on the dev list]

The errors only occur if you're in a branch wc. My actual test
repository is more complicated than the steps I showed but I'll
provide as much info as I can.

I created the branch in r54 and committed one file on the branch to
bring me to r55.

************** in a branch wc **************

[SoundGeek ~/Development/Test/Work/ProjA]$ svn ls -v
      54 stephen 2456 Jun 21 08:41 AACDecoder.h
      28 stephen 16893 Feb 06 02:37 AACUtilities.cpp
      55 stephen 572 Jun 21 08:42 HelloWorld.c
      34 stephen 133903 Feb 11 13:55 ProjA.mcp
      49 stephen 201 May 20 08:30 bob.cpp
      44 stephen 57 May 09 14:38 joe.cpp

========================================================
[SoundGeek ~/Development/Test/Work/ProjA]$ svn log HelloWorld.c
------------------------------------------------------------------------
r55 | stephen | 2005-06-21 08:42:54 -0700 (Tue, 21 Jun 2005) | 1 line

branch checkin test
------------------------------------------------------------------------
r54 | stephen | 2005-06-21 08:41:25 -0700 (Tue, 21 Jun 2005) | 2 lines

Make a test branch.

------------------------------------------------------------------------
r52 | stephen | 2005-06-13 11:47:31 -0700 (Mon, 13 Jun 2005) | 1 line

?\191?\255?\208$
------------------------------------------------------------------------
r46 | stephen | 2005-05-14 11:22:08 -0700 (Sat, 14 May 2005) | 1 line

Fix the build.
------------------------------------------------------------------------
r40 | stephen | 2005-05-09 14:03:52 -0700 (Mon, 09 May 2005) | 1 line

breakage

     <snip>

------------------------------------------------------------------------
r12 | stephen | 2005-01-13 05:56:26 -0800 (Thu, 13 Jan 2005) | 1 line

First check-in.

========================================================
[SoundGeek ~/Development/Test/Work/ProjA]$ svn info HelloWorld.c
Path: HelloWorld.c
Name: HelloWorld.c
URL: file:///Users/stephen/Development/Test/svntest/branches/test/
ProjA/HelloWorld.c
Repository UUID: b5ec2128-ebec-0310-b373-ae7cc6f00d9a
Revision: 55
Node Kind: file
Schedule: normal
Last Changed Author: stephen
Last Changed Rev: 55
Last Changed Date: 2005-06-21 08:42:54 -0700 (Tue, 21 Jun 2005)
Text Last Updated: 2005-06-21 08:42:54 -0700 (Tue, 21 Jun 2005)
Properties Last Updated: 2005-06-21 08:42:03 -0700 (Tue, 21 Jun 2005)
Checksum: 846b059378bb651c7c94d6f597227837

========================================================
[SoundGeek ~/Development/Test/Work/ProjA]$ svn cat -r 32 HelloWorld.c@32
svn: File not found: revision 32, path '/branches/test/ProjA/
HelloWorld.c'

========================================================
[SoundGeek ~/Development/Test/Work/ProjA]$ svn log -r 32 HelloWorld.c
svn: File not found: revision 32, path '/branches/test/ProjA/
HelloWorld.c'

************ in a trunk WC **************

========================================================
[il0103a-dhcp85 ~/Development/Test/Work2/ProjA]$ svn ls -v
      53 stephen 2456 Jun 13 12:49 AACDecoder.h
      28 stephen 16893 Feb 06 02:37 AACUtilities.cpp
      52 stephen 544 Jun 13 11:47 HelloWorld.c
      34 stephen 133903 Feb 11 13:55 ProjA.mcp
      49 stephen 201 May 20 08:30 bob.cpp
      44 stephen 57 May 09 14:38 joe.cpp

========================================================
[il0103a-dhcp85 ~/Development/Test/Work2/ProjA]$ svn log HelloWorld.c
------------------------------------------------------------------------
r52 | stephen | 2005-06-13 11:47:31 -0700 (Mon, 13 Jun 2005) | 1 line

?\191?\255?\208$
------------------------------------------------------------------------
r46 | stephen | 2005-05-14 11:22:08 -0700 (Sat, 14 May 2005) | 1 line

Fix the build.
------------------------------------------------------------------------
r40 | stephen | 2005-05-09 14:03:52 -0700 (Mon, 09 May 2005) | 1 line

breakage

     <snip>

------------------------------------------------------------------------
r12 | stephen | 2005-01-13 05:56:26 -0800 (Thu, 13 Jan 2005) | 1 line

First check-in.

========================================================
[il0103a-dhcp85 ~/Development/Test/Work2/ProjA]$ svn info HelloWorld.c
Path: HelloWorld.c
Name: HelloWorld.c
URL: file:///Users/stephen/Development/Test/svntest/trunk/ProjA/
HelloWorld.c
Repository UUID: b5ec2128-ebec-0310-b373-ae7cc6f00d9a
Revision: 55
Node Kind: file
Schedule: normal
Last Changed Author: stephen
Last Changed Rev: 52
Last Changed Date: 2005-06-13 11:47:31 -0700 (Mon, 13 Jun 2005)
Text Last Updated: 2005-06-23 13:26:47 -0700 (Thu, 23 Jun 2005)
Properties Last Updated: 2005-06-23 13:26:47 -0700 (Thu, 23 Jun 2005)
Checksum: 7a93cb5be493a85c0b1cf74b4c78d081

========================================================
[il0103a-dhcp85 ~/Development/Test/Work2/ProjA]$ svn cat -r 32
HelloWorld.c@32
     < file contents displayed correctly >

hth,
stephen
Received on Thu Jun 23 23:28:02 2005

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

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