开发者

Subversion - Timestamp changes, but content does not

I think this is hard to describe, but I will try:

We're using Subversion an Buildtools. When we make a Build from our Project, several files will be overwritten, of course. So the timestamp of these files changes, but the content might be the same as before.

An svn diff will display the following for exanple: - test.txt changed - 100 lines removed - 100 line开发者_开发技巧s added

Is there a possability to make subversion only look at the content of files and ignore the timestamp of files?

Thanks!


This doesn't exactly answer you question, but...

Traditionally, you would avoid adding generated files to version control.

Instead, only the source files are added, and the files are then generated on the destination.

There are some situations where that rule would be broken, but my first question would be to ask what would happen to your build process (especially on a clean machine) if you simply removed the files in question from Subversion.


If an svn diff reports changes, then the file content has changed, not just the timestamp. It may only be whitespace changes or more likely EOL changes. But they're still changes and Subversion correctly reports them.

Here's a detailed description on how Subversion determines whether a file has changed or not.


are some of your users working on windows and some e.g. on linux? then I'd guess you forgot to set the svn:eol-style property to 'native' (see subversion manual)


I think there's a weird/rare bug in SVN (or something "odd" on the server side) - I have a similar-sounding problem (detailed toward the end). One possible workaround is to use a "touch -r untouched-file target-file" after the timestamps have changed (Maybe as a result of a build script?) in order to revert the timestamps back to what SVN is expecting.

This is the situation I have here (It's weird, inexplicable and reproducible): Subversion v1.6.11 and v1.8.8 on two different Linux boxes (2.6.32 and 3.13.0 kernels respectively). Looks like a weird bug in SVN.

If I touch the timestamps of two particular files, then SVN reports the files as changed and shows a 1:1 diff (i.e. every line changed to itself). Most other files are impervious to this process (That's one "weird" part).

If I issue "touch -r original copy" (where "original" is a file with the original file's checkout timestamp), SVN reports them as unchanged again.

If I do an MD5 sum, du -b, ls -l and diff between the two timestamps of the file, they are identical (Other than timestamps, obviously). Svn proplist/propget only report svn:eol-style = native (These are svg files, fwiw).

So in my case, line-breaks are definitely not the issue, but SVN's treatment of timestamp changes on two particular files only is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜