Why was Subversion unable to register the modified Microsoft Excel spreadsheet file?

I came across some behavior that I did not expect from Subversion, and I discovered this almost by accident: the modified file is not marked as modified.

I have a unit test containing a Microsoft Excel spreadsheet as an input file. unit test calculates the CRC checksum; my test started crashing due to a change in the checksum.

The test file is stored in SVN and has the MIME type "application / octet-stream" and therefore is considered as a binary SVN file.

I get the same behavior from TortoiseSVN and the SVN command-line client, in this case both are based on SVN 1.6: when a file is opened in Excel, the fact that it is open must be encoded in the file itself; SVN indicates that the file has been modified. However, when the file is closed again (without saving), it seems to return to its unchanged state: i.e. svn status does not display the excel file; svn diff in any case does not output due to binary data.

The trap is that the file is no longer compared to the file stored in the repository. (If a new copy is exported, it is not compared with binary codes for open and closed copies.) The file does not seem to change from the user's point of view, so in a semantic sense, the SVN answer is reasonable. But not syntactically; and SVN is essentially syntactic.

The part for which I cannot find the reason is why SVN does not put the file as modified. I cannot imagine that SVN has a special processing of Excel files (and in any case, the MIME type is not specifically related to MS Excel); the SNV keyword property is not defined. Similarly, I can imagine that Excel does not know anything about the contents of a hidden .svn subdirectory that stores information about a working copy of SVN.

Do you have any clues as to what is going on here?

Thanks Rob.

+7
source share
3 answers

Excel always locks open files by setting the timestamp to the current date. When you close without saving, Excel will return the timestamp back. This causes SVN to ignore the file.

Regarding the modified content, I'm not sure. Can you reproduce the problem?

+3
source

Subversion assumes that the timestamp of the β€œlast modification” does not lie. If the timestamp does not change, the contents of the file are not checked for changes. I think the whole version control system will do this, checking for local changes will be unbearably slow otherwise.

edit: to find out how SVN works in this regard, questions.c in the source SVN Copy Work Library is a good start.

+4
source

Is it possible that the file is locked with excel while it is open, and svn cannot access it to see if it has changed or not?

+1
source

All Articles