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

Re: Re[2]: two file time questions

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-05-27 14:41:12 CEST

On May 27, 2005, at 3:03 AM, chris lueders wrote:
>
>
>> if (timestamp hasn't changed)
>> return NO_CHANGE;
>> else if (filesize has changed)
>> return CHANGED;
>> else
>> compare byte-by-byte.
>>
>
> why not use
>
> if (filesize has changed)
> return CHANGED;
> else if (timestamp hasn't changed)
> return NO_CHANGE;
> else
> compare byte-by-byte.
>
> that will not change the runtime in any significant amount and be
> safer, or am i missing a detail?

It would be slower. We record the working-file's timestamp in the
entries file, which is already loaded into memory. So to check the
timestamp, we only need to stat() the working file. To check
filesizes, we need to do a 2nd stat of the text-base file. Perhaps
this is an argument to store the size of the text-base file in .svn/
entires as well...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri May 27 14:44:00 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.