RhodeCode 1.4.4 on CentOS 6.3

久しぶり過ぎて記法忘れたけど今は Markdown とか使えるんですね。記法分からんところがあるので後で整えます。

CentOS 6.3 に RhodeCode 1.4.4 入れた時にいくつかつっかかったのでメモというか隣の人に書けと言われたので書いときます。

むしろ入れたのは隣の人で自分は問題を解決しただけなので実はインストール手順分からないです。

1. 日本語コミットメッセージが文字化ける

$rhodecode_path/env.rhodecode に追記

export HGENCODING="UTF-8"

2. git の repository に push できない

問題

rhodecode.lib.vcs.exceptions.RepositoryError: Couldn't run git command (git -c core.quotepath=false for-each-ref --format='%(refname)' 'refs/heads/*').

こんなの出て push できない。

git に -c オプションが実装されたのは 1.7.4 で CentOS 6.3 にデフォルトで入ってるのが 1.7.1 なので動かないらしーです。

https://groups.google.com/forum/?fromgroups=#!topic/rhodecode/b-16MaCBDTo

解決

rpmforge とかでインストールする

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm
rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
yum erase git
yum install --enablerepo=rpmforge,rpmforge-extras git 

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge#head-f0c3ecee3dbb407e4eed79a56ec0ae92d1398e01

3. git の branch が削除できない?

実は 2. より先に見つけて潰したのでこれに引っかかったかどうかは検証してないけど一応書いとく。

ここらへんを参考に直した

diff

*** lib/celerylib/tasks.py.bak  2012-11-13 17:48:08.243682357 +0900
--- lib/celerylib/tasks.py      2012-11-13 17:50:00.543679086 +0900
***************
*** 403,412 ****
      backend = get_backend(repo_type)

      if repo_type == 'git':
!         backend(safe_str(destination_fork_path), create=True,
                  src_url=safe_str(source_repo_path),
                  update_after_clone=update_after_clone,
                  bare=True)
      elif repo_type == 'hg':
          backend(safe_str(destination_fork_path), create=True,
                  src_url=safe_str(source_repo_path),
--- 403,413 ----
      backend = get_backend(repo_type)

      if repo_type == 'git':
!         r = backend(safe_str(destination_fork_path), create=True,
                  src_url=safe_str(source_repo_path),
                  update_after_clone=update_after_clone,
                  bare=True)
+         ScmModel().install_git_hook(repo=r)
      elif repo_type == 'hg':
          backend(safe_str(destination_fork_path), create=True,
                  src_url=safe_str(source_repo_path),