Subversion/auto-props/ja

デフォルトでは、Subversionは追加されたファイル上で自動リンクのためにメタデータを設定しません。我々のようなLinux/Unix/MacとWindowsが混在した開発グループにおいて、DOSの行で終わっているいくつかのファイルに驚かせられる可能性があります。

追加したすべてのファイルで手動で設定することを覚えたくない場合、Subversionコンフィギュレーションファイルで"auto-props"機能を有効にすることが出来ます。これによって列の最後、もしくはファイルの拡張子に基づいたMIMEタイプ(バイナリファイル)を設定することが出来ます。

コンフィグファイルを見つける edit

コマンドライン(Unix/Mac) edit

~/.subversion/config or /etc/subversion/config

TortoiseSVN (Windows) edit

%appdata%\subversion\config

設定ダイアログにある'Subversionの設定ファイル'にある'編集'ボタンをクリックします:

 

auto-propsの設定 edit

[miscellany]において次の行をアンコメント/追加します:

enable-auto-props = yes

[auto-props]セクションにおいてデフォルトのビットをアンコメントして次のコードも追加します:

*.css = svn:eol-style=native
*.eot = svn:mime-type=application/vnd.ms-fontobject
*.gif = svn:mime-type=image/gif
*.ico = svn:mime-type=image/vnd.microsoft.icon
*.inc = svn:eol-style=native
*.info = svn:eol-style=native
*.install=svn:eol-style=native
*.java = svn:eol-style=native
*.jpeg = svn:mime-type=image/jpeg
*.jpg = svn:mime-type=image/jpeg
*.js = svn:eol-style=native
*.jsp = svn:eol-style=native
*.module = svn:eol-style=native
*.php5 = svn:eol-style=native
*.php = svn:eol-style=native
*.pl = svn:eol-style=native
*.pm = svn:eol-style=native
*.png = svn:mime-type=image/png
*.py = svn:eol-style=native
*.sh = svn:eol-style=native
*.sql = svn:eol-style=native
*.svg = svn:mime-type=image/svg+xml
*.tpl = svn:eol-style=native
*.ttf = svn:mime-type=application/x-font-ttf
*.txt = svn:eol-style=native
*.woff = svn:mime-type=application/x-woff
*.xcf = svn:mime-type=image/x-xcf
Makefile = svn:eol-style=native
SConscript = svn:eol-style=native
SConstruct = svn:eol-style=native
USERINFO = svn:eol-style=native

Make sure none of the lines start with spaces, or you will get an error message.

壊れたファイルの修正 edit

正しくチェックインされていなかったファイルを見つけた場合に、修正することはそれほど難しいことではありません。

最初に、あなたのプラットフォーム応じて行末を正しいスタイルに変更します。プログラミング用のエディターでは、組み込みのコマンドでスタイルを切り替えられます。あるいは、'fromdos'、'todos'タイプのユーティリティを使用できます。

修正したら、プロパティを設定してチェックインしてください:

 svn propset svn:eol-style native filename
 svn commit filename