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

Re: Another working copy library

From: Mattias Engdegård <mattias_at_virtutech.se>
Date: 2007-01-28 15:31:12 CET

Filipe Fernandes <fernandes.fd@gmail.com> writes:

>It's true... search for '.svn' towards the top and once it's found you got
>your working copy. And it's likely very fast as you say, but the search would
>have to be done every time, and I wonder what that would be like.

I suggest you write a small test program to do just that. Most likely you will
find that it is a lot faster than you thought.

Compare this task to the traditional Unix implementation of the getcwd() call:

1. stat the current directory (".") to find out its device and inode.
2. readdir ".." to find the name corresponding to the inode just recorded.
3. remember the name as a path component
4. iterate from 1, prefixing all filenames by "../", until the root is reached

This is a lot more work than merely finding the nearest .svn directory higher
up in the hierarchy, because it requires several syscalls (including a full
readdir) on every level all the way to the root. Yet most people would not
necessarily consider a getcwd() upon opening a window to be excessive.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 28 15:31:49 2007

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.