[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: David James <djames_at_collab.net>
Date: 2006-02-17 05:37:27 CET

On 16 Feb 2006 20:51:16 -0600, kfogel@collab.net <kfogel@collab.net> wrote:
> Julian Foad <julianfoad@btopenworld.com> writes:
> > >>Shouldn't it notice that the file size and date are not as expected
> > >>and return a "modified" status immediately?
> > > Do we record the unmodified working file size for translated files in
> > > .svn/entries? If so, then we could detect modified-ness this way.
> >
> > We don't currently store any size information there. However, I'm now
> > thinking it's not so easy. (It would have been done if it were.)
> > Even if you modify the file by changing some keyword value or EOL
> > style, as long as it translates back to the same pristine text we must
> > report it as unchanged. Therefore the size doesn't tell us anything.
>
> Not so fast...
>
> A size check can tell you if something is definitely modified. It's
> only if the size comes back the same as what you recorded before that
> you have to do further investigation. The algorithm is:
>
> if (timestamp is same)
> return not_modified;
> else if (size differs)
> return modified;
> else
> go_into_expensive_further_investigation();

So if the timestamp is the same, but the size differs, we return "not
modified"? That seems strange to me.

--David

--
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 17 05:37: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.