views:

104

answers:

4

I'm working with a program that writes data to fixed-size binary files that I store in a subversion archive.

The problem, however, is SVN (both the command-line client and TortiseSVN) thinks that since the size of the file didn't change, the file itself didn't change and it shouldn't commit it.

Is there a way to change what diffing method is used, or do I have to resort to hacks such as adding a dummy property to the files?


EDIT: Turns out the solution wasn't becuase of the file-size thing. I just automatically assumed that would be the case, since most nieve diffing altorithims do this all the time. [weasel words]

+3  A: 

Are you absolutely sure that the files did change? Subversion can and does handle binary files and they have an actual diffing algorithm for them; it's not just a look at the file size. Subversion detects file changes to binary files just fine here, even though the size did not change.

Joey
Hahaha, you beat me by 3 seconds :)
Si
I would have been faster, but I read the part in the Subversion book again :)
Joey
+2  A: 

Are you sure the file has changed? i.e. different bytes. I'm pretty sure subversion uses a binary diff algorithm, and doesn't rely on file size.

Si
Subversion *does* compare timestamps, and assumes the file is unchanged if the timestamp has not changed. If the timestamp has changed, it will compare the entire content of the file.
Kevin Reid
Thanks Kevin, edited.
Si
+1  A: 

Resoved on my own.

Turns out that the program that changed the files was also messing with the file's metadata in a way that confused SVN.

MiffTheFox
+4  A: 

See here for a description on how SVN determines whether a file is modified or not.

Stefan