You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Assaf Berg <as...@gmail.com> on 2005/07/06 13:10:54 UTC

Inconsistency handling binary files

It seems like changes to binary files without changing the modification time 
of the file will not be detected by svn diff or even svn status and svn 
update commands (i'm using subversion v1.1.3). This can happen when you copy 
files around, which preserves their timestamps by default. Only after 
'touch'-ing the file I can see it has changed and am able to commit it.
Aside of all of this being annoying it is also confusing because when 
migrating from CVS to SVN you notice that text files are no longer marked as 
changed only because their timestamp changed. You realize that subversion 
decides a file is changed by examining its contents, therefore confusion 
arises in the case I described above of changing a binary file. I would 
expect it to behave in the same way...

Thanks,
Assaf Berg

Re: Inconsistency handling binary files

Posted by Ben Collins-Sussman <su...@collab.net>.
On Jul 6, 2005, at 8:10 AM, Assaf Berg wrote:

> It seems like changes to binary files without changing the  
> modification time of the file will not be detected by svn diff or  
> even svn status and svn update commands (i'm using subversion  
> v1.1.3). This can happen when you copy files around, which  
> preserves their timestamps by default. Only after 'touch'-ing the  
> file I can see it has changed and am able to commit it.

svn, just like cvs, uses the timestamp to decide if a file is changed  
or not.  The algorithm looks something like:

    if (timestamp unchanged)
       return UNCHANGED
    else if (filesize changed)
       return CHANGED
    else
       compare byte-for-byte with text-base


So yes, if you change the file, but not the timestamp, both cvs and  
svn will fail to notice the file changed.  Don't Do That.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org