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

Re: external diff headers

From: Ben Collins-Sussman <sussman_at_newton.collab.net>
Date: 2001-01-30 23:51:38 CET

Bruce Korb <bkorb@allegronetworks.com> writes:

> > Here's the idea:
> >
> > The `svn diff' command will decide if the file in question has local
> > mods or not; if so, it will spawn the external diff process. (Our
> > local_mod_p routine already does optimizing things like examining file
> > mtimes and sizes.)
> >
> > This will almost certainly result in a faster `svn diff'. Most of the
> > time we won't even have to spawn the external process now.
> That will make it much more efficient and is a good idea.
> It's not bullet proof, though :-). Just because it has
> been modified doesn't mean it has not been modified back to
> its original state. (Unless, of course, the ``been modified''
> test includes check summing with mtime and size ;-)

Our ``has it been modified'' test *always* gets the right answer. If
the mtimes are different AND the file sizes are the same, the function
just gives up and does a brute-force byte-for-byte comparison.

So, in the *worst* case scenario, we'd end up reading the file twice:
once to determine that it's locally modified, and once to run an
external diff on it. But that's pretty unlikely. Most of the time,
our mtime/size tests will prevent us from reading the file at all.
Should be a big speedup overall.
Received on Sat Oct 21 14:36:20 2006

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.