[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 m odified

From: Thamm, Russell <russell.thamm_at_dsto.defence.gov.au>
Date: 2004-06-24 08:54:36 CEST

Thanks Stefan,

I don't use any Subversion code.

I simply process all the entries files in the .svn directories, calculate
the MD5 checksum for each file and compare it with the checksum stored in
the entries file.

I will try using file dates and sizes to optimise this

Russell

 

-----Original Message-----
From: Stefan Küng [mailto:stefan.kueng@wagner-group.ch]
Sent: Tuesday, 22 June 2004 6:45 PM
To: dev@tortoisesvn.tigris.org
Subject: Re: [TSVN] Algorithm for determining if files are locally
modified

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu Jun 24 09:56:53 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.