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