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

Need fast ways to get Info once WC-NG is introduced

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Sat, 31 Jul 2010 17:30:33 +0200

Hi,

I think I best first describe what I do in TSVN now:
TSVN has a cache of all working copy statuses which is used by the shell
extension to show the icon overlays. It would be way too slow to fetch
the status every time the shell requests the overlays, so that's why we
have that cache.

The cache itself tries to do as little as possible while still keeping
the status of each item up to date. It gets notified by the OS whenever
a file is changed and decides then whether to re-fetch the status with
the SVN API or not. But even calling the status API in those cases is
too expensive and leads to way too heavy disk access. So the cache does
a very quick check first: it reads the file time of the entries and
props file inside the .svn folder - only if that time has changed it
calls the svn status API. If it hasn't changed and there was no change
notification for a file inside that folder, calling the API isn't necessary.

To clarify this a little bit, imagine the cache gets a change
notification for all 'entries' files in a wc because someone did a
commit or an update.
The problem is that the cache gets such notifications even if the file
content hasn't changed, it's enough if a file was opened with write
access - the notification is sent even if there was no actual write to
the file.
So by checking the file dates of the entries/props files the cache
determines whether a call to the svn API is needed or not for the
subfolders.

Now, as far as I understand it, with WC-NG and the single db design,
there are no files in each wc folder anymore which indicate whether
something affecting the status has changed. There will only be one
single db file for all folders of a wc.

So my first question is: is there a very quick way to find out whether
something status related has changed since a specific time for a
particular wc folder? I haven't found an API so far which I could use
for this. It doesn't have to be reliable, i.e., all I need to know
whether it *may* be that the status have changed, I don't really need to
know whether it *really* has changed because once I get the 'maybe', I
will call the status API and then get the definite answer.

Something else I use quite a lot in TSVN and especially the cache is a
quick check whether a folder is versioned or not, simply by checking
whether an .svn folder exists or not. Again here I only need to know
whether it's *maybe* versioned. If there's no .svn folder, I *know* it's
not versioned but if there is, I call the svn APIs and would get an
error in return if e.g. the .svn folder is empty or corrupted.
But with the single db design, there won't be .svn folders anymore
except for the root of the wc?
So is there an (almost as) fast way to check whether a folder is
versioned or not?

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
Received on 2010-07-31 17:31:16 CEST

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