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

RE: status information

From: Bert Huijben <bert_at_qqmail.nl>
Date: Thu, 17 Jun 2010 22:08:37 +0200

> -----Original Message-----
> From: Stefan Küng [mailto:tortoisesvn_at_gmail.com]
> Sent: donderdag 17 juni 2010 20:55
> To: C. Michael Pilato
> Cc: Bert Huijben; 'Subversion Development'
> Subject: Re: status information
>
> On 17.06.2010 17:52, C. Michael Pilato wrote:
> > Bert Huijben wrote:
> >> Most simple clients can just use svn_client_status5() and trust the
> results
> >> to be complete like they were used to, but more advanced clients can
> use
> >> svn_wc_walk_status() to get higher performance.
> >>
> >> E.g. If TortoiseSVN or AnkhSVN switched to the wc apis, they can
> just show
> >> the conflicted glyph when it sees the conflict on a 2 GB file,
> instead of
> >> also comparing that file against its base version. And if you run
> status
> >> just to show a glyph for a modification on a subdirectory it is not
> >> necessary to perform comparation on the rest of the files, when you
> found a
> >> single change. (But you would want the conflict results)
> >
> > I really, really don't like the idea of encouraging the continued use
> of WC
> > APIs by third-party consumers. We should begin *right now*
> discouraging its
> > use and simply improving the svn_client API to better serve our
> various
> > clients. (I thought we had, in general, consensed around this plan
> already,
> > but I guess I was wrong.)
>
> Yes, the discussion is here:
> http://svn.haxx.se/dev/archive-2010-04/0171.shtml
> (the apache mailing list archive still doesn't work for me).
>
> May I suggest an approach that doesn't force me to find expensive
> workarounds for more and more missing information the svn APIs return:
> Use a mask parameter which specifies which members of a returned struct
> get filled in by the API and which ones are not. That way, the less one
> specifies in the mask the faster the API returns, but if necessary
> everything necessary can still be returned in one tree walk without the
> need to invoke several other APIs which also do the very same tree
> walk.
>
> If you need an example, have a look at TVM_GETITEM and the TVITEMEX
> struct:
> http://msdn.microsoft.com/en-us/library/bb773758%28v=VS.85%29.aspx
> http://msdn.microsoft.com/en-us/library/bb773459%28v=VS.85%29.aspx
> The mask member specifies which members of the struct will be filled by
> the TVM_GETITEM call.
>
> This also has the advantage that new data can be added later without
> changing the API.

Using flags for this is against the subversion principles, so this would require adding booleans to svn_client_statusX() for every flag on what you want and don't want.

For WC-NG we used a similar approach, but it only works when you are calling an API: allow output arguments to be NULL. But this requires that you are calling the api from the callback. (Which was exactly the plan for every expensive operation; especially if you can't say which value you want for which file/directory)

But before continuing this conversation, can you check if svn_client_status_t (in svn_client.h) contains what you need?

I think we can safely remove the locked boolean from this struct (which requires an additional DB lookup per directory) and you asked for the translated filesize.

(Not sure if the filesize that is still a useful addition for every result as you can obtain such values very cheap via different APIs now, because we don't have to read all entries at once any more. And I don't think you use that value while walking the status, but only after it returned)

        Bert
Received on 2010-06-17 22:09:30 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.