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

Re: svn_client__get_revision_number() returning -1

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Thu, 15 Apr 2010 12:55:35 +0100

On Wed, 2010-04-14 at 23:06 +0200, neels wrote:
> fyi,
> I found that _get_revision_number()'s -1 revision for added nodes
> would leak at least into an error message from 'svn log'.

I wouldn't count the content of an error message as an API: I'm happy
for that to change.

> Checking that out I noticed that -1 is the revnum returned for
> _revision_unspecified; 'svn log' in that case assumes HEAD. Probably
> other callers do the same or similar things, not checking _unspecified
> explicitly.

It's quite common throughout Subversion to treat SVN_INVALID_REVNUM as
meaning HEAD. The docs should always make it clear whether that's the
case. (If they don't, they need fixing.)

> The problem is that an added node returning SVN_INVALID_REVNUM for
> _revision_base would look like it was _revision_unspecified. Instead,
> svn_client__get_revision_number() asked for an added node's _base
> should probably rather throw an error.

Yes, that might be better, as it seems to be useful to keep the "INVALID
means HEAD" semantic.

- Julian
Received on 2010-04-15 13:56:12 CEST

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.