
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
154
|
Chapter 7: Advanced Topics
Automatic Property Setting
Properties are a powerful feature of Subversion, acting as key components of many
Subversion features discussed elsewhere in this and other chapters—textual diff and
merge support, keyword substitution, newline translation, etc. But to get the full
benefit of properties, they must be set on the right files and directories. Unfortu-
nately, that can be a step easily forgotten in the routine of things, especially since fail-
ing to set a property doesn’t usually result in an obvious error condition (at least
compared to, say, failing to add a file to version control). To help your properties get
applied to the places that need them, Subversion provides a couple of simple but use-
ful features.
Whenever you introduce a file to version control using the
svn add or svn import
commands, Subversion runs a very basic heuristic to determine if that file consists of
human-readable or non-human-readable content. If the latter is the decision made,
Subversion will automatically set the
svn:mime-type property on that file to
application/octet-stream (the generic this is a collection of bytes MIME type). Of
course, if Subversion guesses incorrectly, or if you wish to set the
svn:mime-type
property to something more precise—perhaps image/png or ...