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

Re: bug in svn diff and related?

From: Travis P <svn_at_castle.fastmail.fm>
Date: 2005-03-15 22:23:50 CET

On Mar 15, 2005, at 8:31 AM, Ben Collins-Sussman wrote:

> Yes, there is a common function used throughout the svn codebase --
> its only purpose is to return a "yes" or "no" answer to the question,
> "has this file been changed by the user?" I think it's called
> svn_wc_text_modified_p().
>
> The algorithm is extremely similar to what CVS does:
>
> stat working and textbase files.
> if (mtimes of working and textbase are equal):
> return NOT_CHANGED;
> else if (filesizes of working and textbase are unequal):
> return CHANGED;
> else
> compare the files byte-by-byte. /* very slow */
>
> This function is used by 'svn status', 'svn commit', 'svn update', and
> many other commands. Without the mtime check, these command commands
> would be EXTREMELY slow.

Ben,

I'm curious why you don't use this alternative heuristic as less likely
to return a false answer and no slower (I'm making the common
assumption that getting mtime and size are both stat operations that
are fetched in one operation):

    if (filesizes of working and textbase are unequal):
         return CHANGED;
    else if (mtimes of working and textbase are equal):
         return NOT_CHANGED;
    else
         compare the files byte-by-byte. /* very slow */

-Travis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 15 22:26:01 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.