简体   繁体   中英

Good way to manage binary files versioning in SVN

I'm using XIB files in Xcode. it's XML file, but actually it's not a simple source code, and its internal structure is organized as hierarchical references. So simple diff/merge model never work.

The problem is SVN treats that XIB files as simple text source code file. I have to avoid this. How to force SVN handle these files always as binary behavior. (lock/unlock model)

If you really need to force SVN to treat some file as binary ones, try to set this property :

svn propset svn:mime-type application/octet-stream filename

Read How does Subversion handle binary files? for more details.

As, Cedric Julien said, you need to set the property svn:mime-type on the file to make sure it's treated as a binary file. Subversion looks at the first X bytes of a file to determine if it's binary or text, and sometimes it doesn't work all the time. I know PDF files can confuse it too.

You need to use a pre-commit hook to make sure that your developers store these files as binary files. The developers can use auto-properties to help them automatically set the svn:mime-type property on XIB and NIBs, but you still need the pre-commit hook to verify that this property is there.

You can use my pre-commit-kitchen-sink-hook.pl which allows you to verify that particular files have a particular property attached to them and that property has a particular value.

match = \.(nib|xib|pdf)$
property = svn:mime-type
value = application/octet-stream
type = string

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM