[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Setting svn:eol-style

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-12-03 23:22:10 CET

On Wed, 2003-12-03 at 14:08, Rusk, Patrick wrote:

> Do I have to do a "svn propset" on each individual text file in my
> repository?

For text files that are already under version control? Yes. This is
your only choice. Use a bunch of commandline tools (find | xargs svn
propset), or write a shell script to help.

> Or is there a way to apply it to the repository as a whole, so
> that it is automatically applied to all text files, but not binary files?
>

"Propset" is a local mod, so it can only happen in a working copy,
followed by a commit. At the moment, there's no way to make the svn
commandline client modify file props (or contents) directly against the
repository.

> If I have to do it individually to files, is there some way to ensure that
> any text file checked it gets this property set? Otherwise, we're bound to
> forget to set it frequently.

Yes, it's a new feature in your ~/.subversion/config file, not yet
documented in the Book. Enable the "auto-props" feature and set
patterns accordingly. Any time you 'svn add' a text file, it will
automatically set properties for you. Here's the excerpt from a modern
~/.subversion/config file:

### Set enable-auto-props to 'yes' to enable automatic properties
### for 'svn add' and 'svn import', it defaults to 'no'.
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes

### Section for configuring automatic properties.
### The format of the entries is:
### file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain * as wildcard. All entries
### which match will be applied to the file.
[auto-props]
*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
*.dsp = svn:eol-style=CRLF
*.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=native
*.png = svn:mimetype=image/png
*.jpg = svn:mimetype=image/jpeg
Makefile = svn:eol-style=native

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 3 23:22:52 2003

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.