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

Re: [TSVN] Algorithm for determining if files are locally modified

From: Stefan Küng <stefan.kueng_at_wagner-group.ch>
Date: 2004-06-22 11:14:45 CEST

Thamm, Russell wrote:

> Does anyone know what algorithm Tortoise uses to determine which files are locally modified?

Yes. Me, and almost all Subversion developers.

> The MD5 checksum is obviously a definitive but computationally expensive way to do it.

Not more expensive than the algorithm Subversion uses now.

> I have a program that I use to package my applications. One of the things this application
> does is to scan my workspace and determine the current source revision. Currently I use

The current source revision? Did you try SubWCRev?
http://tortoisesvn.tigris.org/download.html (under the "Misc" section)
Also, there is svnversion.exe, which does almost the same.

> MD5 to check if there are any locally modified files. This takes a very long time and
> I was wondering if there was a more quick and dirty way to do this.

More quick? Depends on what optimizations you're doing right now.

What Subversion does right now:
- check the filedates - if they're equal then assume file has _not_
changed and exit
- check the filesize - if they're not equal then the file is changed and
exit
- compare byte by byte of the two files (BASE and WC). As soon as one
byte is found different exit the function --> the files are different.

So you see, only if a file has _only_ the filedate changed the whole
procedure is necessary, in all other cases there are earlier exits of
the function.

Subversion will soon be replacing the last step of this algorithm
(comparing byte by byte) with an MD5 checksum.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Jun 22 12:25:16 2004

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.