$ git clone https://github.com/m-tmatma/svnmailerまたは
$ svn co https://github.com/m-tmatma/svnmailer/trunkまたは
https://github.com/m-tmatma/svnmailer にアクセスして Download ZIP をクリックします。
オリジナルのバージョンの svnmailer は以下から入手可能です。
http://opensource.perlig.de/en/svnmailer/
[root ~]# yum install subversion-python.x86_64
参照
python setup.py install--root を指定することによってインストール先を変更できます。
python setup.py install --root /home/svnuser/root
設定ファイル(svnmailer.conf) を編集する必要があります。
default_charsets の設定で適用したい文字コードを指定する。https://github.com/m-tmatma/svnmailer/blob/master/test/default_charsets.conf
svnmailer.conf
[general] #sendmail_command = /usr/sbin/sendmail smtp_host = localhost [defaults] default_charsets = utf-8 shift-jis euc-jp show_applied_charset = yes mail_transfer_encoding = 8bit from_addr = %(author)s@example.org to_addr = commit@example.org generate_diffs = add copy modify propchange for_repos = .*/(?Pfrom_addr, to_addr, smtp_host を適切なものに変更する.*) commit_subject_prefix = [%(project)s commit] propchange_subject_prefix = [%(project)s propchange] lock_subject_prefix = [%(project)s lock] unlock_subject_prefix = [%(project)s unlock]
$ svn-mailer --help
Usage: svn-mailer <options>
Options:
--version show program's version number and exit
-h, --help show this help message and exit
COMMON PARAMETERS:
--debug Run in debug mode (means basically that all messages are sent to STDOUT)
-d REPOSITORY, --repository=REPOSITORY
The repository directory
-f CONFIG, --config=CONFIG
The configuration file
-e PATH_ENCODING, --path-encoding=PATH_ENCODING
Specifies the character encoding to be used for filenames. By default the encoding is tried to be
determined automatically depending on the locale.
BEHAVIOUR OPTIONS:
The behaviour options are mutually exclusive, i.e. the last one wins.
-c, --commit This is a regular commit of versioned data (post-commit hook). This is default.
-p, --propchange This is a modification of unversioned properties (post-revprop-change hook)
-l, --lock (svn 1.2 and later) This is a locking call (post-lock hook)
-u, --unlock (svn 1.2 and later) This is a unlocking call (post-unlock hook)
SUPPLEMENTAL PARAMETERS:
-r REVISION, --revision=REVISION
The modified/committed revision number
-a AUTHOR, --author=AUTHOR
The author of the modification
-n PROPNAME, --propname=PROPNAME
The name of the modified property
-o ACTION, --action=ACTION
(svn 1.2 and later) The property change action
Alternatively you can use the old style compatibility command lines (options described above don't apply then):
svn-mailer commit <repos> <revision> [<config>]
svn-mailer propchange <repos> <revision> <author> <propname> [<config>]
svn 1.2 and later:
svn-mailer propchange2 <repos> <revision> <author> <propname> <action> [<config>]
svn-mailer lock <repos> <author> [<config>]
svn-mailer unlock <repos> <author> [<config>]
svn-mailer は mailer.py 互換の引数に対応しているのと拡張のパラメータに対応しています。
svn-mailer --commit --repository svnrepos --revision 869 --config simple.conf --debug
#!/bin/sh REPOS="$1" REV="$2" /usr/bin/svn-mailer commit "$REPOS" "$REV" "$REPOS/svnmailer.conf" &
#!/bin/sh REPOS="$1" REV="$2" /usr/bin/svn-mailer --commit --repository "$REPOS" --revision "$REV" --config "$REPOS/svnmailer.conf" &
#!/bin/sh REPOS="$1" REV="$2" export PYTHONPATH=/home/svnuser/root/usr/lib/python2.7/site-packages /home/svnuser/root/usr/bin/svn-mailer --commit --repository "$REPOS" --revision "$REV" --config "$REPOS/svnmailer.conf" &