2

コード レビューなどのために rhodecode インスタンスを実行していますが、ssh 経由でプッシュすると、rhodecode は変更セットを認識しません (hgweb から手動でプルしない限り)。

rhodecode を適切に動作させるには、mercurial または何かに着信フックが必要ですか?

編集

フックincoming.rhodecode = python:rhodecode.lib.hooks.log_push_actionを追加することで、スタックトレースを取得します:

remote:   File "/usr/share/mercurial-server/hg-ssh", line 91, in <module>
remote:     dispatch.dispatch(request(['-R', repo, 'serve', '--stdio']))
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 65, in dispatch
remote:     return _runcatch(req)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 88, in _runcatch
remote:     return _dispatch(req)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 741, in _dispatch
remote:     cmdpats, cmdoptions)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 514, in runcommand
remote:     ret = _runcommand(ui, options, cmd, d)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 831, in _runcommand
remote:     return checkargs()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 802, in checkargs
remote:     return cmdfunc()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in <lambda>
remote:     d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/util.py", line 472, in check
remote:     return func(*args, **kwargs)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/commands.py", line 5211, in serve
remote:     s.serve_forever()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/sshserver.py", line 94, in serve_forever
remote:     while self.serve_one():
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/sshserver.py", line 112, in serve_one
remote:     rsp = wireproto.dispatch(self.repo, self, cmd)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/wireproto.py", line 351, in dispatch
remote:     return func(repo, proto, *args)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/wireproto.py", line 629, in unbundle
remote:     lock.release()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/lock.py", line 143, in release
remote:     callback()
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/localrepo.py", line 2452, in runhooks
remote:     source=srctype, url=url)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/localrepo.py", line 386, in hook
remote:     return hook.hook(self.ui, self, name, throw, **args)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/hook.py", line 181, in hook
remote:     r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) or r
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/hook.py", line 38, in _pythonhook
remote:     obj = __import__(modname)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
remote:     return _import(name, globals, locals, fromlist, level)
remote:   File "/usr/local/lib/python2.7/dist-packages/rhodecode/lib/hooks.py", line 35, in <module>
remote:     from rhodecode.lib.utils import action_logger
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
remote:     mod = _origimport(name, globals, locals)
remote:   File "/usr/local/lib/python2.7/dist-packages/rhodecode/lib/utils.py", line 55, in <module>
remote:     from rhodecode.model.db import Repository, User, RhodeCodeUi, \
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
remote:     mod = _origimport(name, globals, locals)
remote:   File "/usr/local/lib/python2.7/dist-packages/rhodecode/model/db.py", line 147, in <module>
remote:     class RhodeCodeSetting(Base, BaseModel):
remote:   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative.py", line 1343, in __init__
remote:     _as_declarative(cls, classname, cls.__dict__)
remote:   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative.py", line 1082, in _as_declarative
remote:     class_mapped = _is_mapped_class(base)
remote:   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/util.py", line 696, in _is_mapped_class
remote:     manager = attributes.manager_of_class(cls)
remote:   File "/usr/local/lib/python2.7/dist-packages/mercurial/demandimport.py", line 87, in __getattribute__
remote:     return getattr(self._module, attr)
remote: AttributeError: 'module' object has no attribute 'manager_of_class'
abort: unexpected response: empty string
4

1 に答える 1

3

RhodeCode はポスト プッシュ フックを使用してリポジトリのキャッシュを無効にし、プッシュ/プル イベントをジャーナルに保存します。これを克服するためにできることはいくつかあります。

  • vcs_full_cache を無効にし、キャッシュの有効期限を低い値 (60 秒など) に下げます。
  • SSHを介してプッシュするときに適切なRhodeCodeフックを呼び出します。これが最も適切な解決策だと思います
于 2013-01-08T23:02:28.510 に答える