On Fri, Nov 18, 2005 at 05:49:51PM +0100, Tommy Pettersson wrote:
> On Thu, Nov 17, 2005 at 10:25:01PM +0000, Tom Counsell wrote:
> > The problem I have run into is that 'darcs whatsnew' seems to create  
> > a temporary file in the repository directory.  This triggers the  
> > kqueue notification again, and I end up in a loop.
> 
> I think that would be darcs checking the file system where
> the repo is, if nfs and/or mmap() is safe or something else,
> I'm not sure exactly what.

Ah yes.  It's checking if we can safely mmap, or if that could cause us to
be unable to delete directories.  We could have a special version of slurp
for commands like whatsnew that never modify anything.  I think that would
solve this issue, and would also make darcs whatsnew slightly more
efficient, since it wouldn't waste time with the test, and when run on a
read-only repository would be able to use mmap (which currently it doesn't,
since the test would fail).

The catch is code complexity--we'd have to track two versions of
everything... unless we could somehow figure out how to thread the
"read-only"ness of the command down to the slurp in a nice manner.  For
example, perhaps if we were to pass a flag to identifyRepository then
the Repository itself could store information about whether mmap is legal.
This could also help us avoid testing the same directory twice in a single
command.  But on the third (or is it fourth) hand, if we don't *always* do
the test, there is a possibility of introducing one of those
very-hard-to-track-down bugs that the test was intended to eliminate.
-- 
David Roundy
http://www.darcs.net

_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to