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

Re: WC modification detection is reading whole files

From: Peter Samuelson <peter_at_p12n.org>
Date: 2006-02-17 23:25:36 CET

[Ph. Marek]
> How about storing an MD5 of, say, every 64kB of the translated file?
> Then a comparision wouldn't need to compare N bytes to N bytes (with
> approx. 2*N/2 read on average), but could quit after N/2 bytes read
> ... Seems an easy change to me.

I think that's overkill. Caching the mtime and size of the WC file
("translated") ought to be sufficient. Anyone who edits a file but
resets the mtime to its original value counts as "trying to break the
tools" and doesn't deserve special consideration.

I do note that mtime can legitimately go both forward and backward,
like if you use patch -Z or -T on your working copy. So, unlike
'make', the check needs to be for strict equality. (This is a flaw in
the classic 'make' behavior, IMO, but can't be fixed there as 'make'
keeps no state.)

As for resetting the timestamps to match the WC, I think I'm satisfied
knowing that this happens on 'svn cleanup'. This should perhaps be
more prominently documented as a way to speed up the client when you've
touched timestamps unnecessarily in your WC.

Received on Fri Feb 17 23:25:53 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.