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

Re: two file time questions

From: Blair Zajac <blair_at_orcaware.com>
Date: 2005-05-26 00:56:59 CEST

Ben Collins-Sussman wrote:
>
> On May 25, 2005, at 11:41 AM, chris lueders wrote:
>
>>
>> i guess svn uses the file time to speed up it's diff process. fine.
>> but why doesn't it use the file size as well?
>
>
> It does use the filesize, but only later on.
>
> The algorithm is:
>
> if (timestamp hasn't changed)
> return NO_CHANGE;
> else if (filesize has changed)
> return CHANGED;
> else
> compare byte-by-byte.

It seems like a good idea to change the first test to this one

    if (timestamp hasn't changed && filesize hasn't changed)
       return NO_CHANGE;
    else if (filesize has changed)
       return CHANGED;
    else
       compare byte-by-byte.

Asumming that stat() was already called before these tests, then its
just safer. Not saying this will ever happen (that the file's timestamp
doesn't change but it's file size does). It won't be CPU expensive.
Just being anal I guess :)

Regards,
Blair

-- 
Blair Zajac, Ph.D.
<blair@orcaware.com>
Subversion and Orca training and consulting
http://www.orcaware.com/svn/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu May 26 00:58:55 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.