diff --git a/rhodecode/lib/hooks.py b/rhodecode/lib/hooks.py --- a/rhodecode/lib/hooks.py +++ b/rhodecode/lib/hooks.py @@ -138,7 +138,7 @@ def log_push_action(ui, repo, **kwargs): stop, start = get_revs(repo, [node + ':']) h = binascii.hexlify - revs = (h(repo[r].node()) for r in xrange(start, stop + 1)) + revs = [h(repo[r].node()) for r in xrange(start, stop + 1)] elif scm == 'git': revs = kwargs.get('_git_revs', []) if '_git_revs' in kwargs: @@ -198,7 +198,7 @@ def log_create_repository(repository_dic def handle_git_post_receive(repo_path, revs, env): """ - A really hacky method that is runned by git pre-receive hook and logs + A really hacky method that is runned by git post-receive hook and logs an push action together with pushed revisions. It's runned by subprocess thus needs all info to be able to create a temp pylons enviroment, connect to database and run the logging code. Hacky as sh**t but works. ps. diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -271,7 +271,7 @@ class SimpleGit(BaseVCSController): def _handle_githooks(self, repo_name, action, baseui, environ): """ - Handles pull action, push is handled by pre-receive hook + Handles pull action, push is handled by post-receive hook """ from rhodecode.lib.hooks import log_pull_action service = environ['QUERY_STRING'].split('=') diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -238,7 +238,7 @@ class RhodeCodeUi(Base, BaseModel): HOOK_UPDATE = 'changegroup.update' HOOK_REPO_SIZE = 'changegroup.repo_size' - HOOK_PUSH = 'pretxnchangegroup.push_logger' + HOOK_PUSH = 'changegroup.push_logger' HOOK_PULL = 'preoutgoing.pull_logger' ui_id = Column("ui_id", Integer(), nullable=False, unique=True, default=None, primary_key=True) diff --git a/rhodecode/model/forms.py b/rhodecode/model/forms.py --- a/rhodecode/model/forms.py +++ b/rhodecode/model/forms.py @@ -731,7 +731,7 @@ def ApplicationUiSettingsForm(): paths_root_path = All(ValidPath(), UnicodeString(strip=True, min=1, not_empty=True)) hooks_changegroup_update = OneOf(['True', 'False'], if_missing=False) hooks_changegroup_repo_size = OneOf(['True', 'False'], if_missing=False) - hooks_pretxnchangegroup_push_logger = OneOf(['True', 'False'], if_missing=False) + hooks_changegroup_push_logger = OneOf(['True', 'False'], if_missing=False) hooks_preoutgoing_pull_logger = OneOf(['True', 'False'], if_missing=False) return _ApplicationUiSettingsForm diff --git a/rhodecode/model/repo.py b/rhodecode/model/repo.py --- a/rhodecode/model/repo.py +++ b/rhodecode/model/repo.py @@ -476,7 +476,7 @@ class RepoModel(BaseModel): tmpl = pkg_resources.resource_string( 'rhodecode', jn('config', 'pre_receive_tmpl.py') ) - _hook_file = jn(loc, 'pre-receive') + _hook_file = jn(loc, 'post-receive') with open(_hook_file, 'wb') as f: f.write(tmpl) os.chmod(_hook_file, 0555) diff --git a/rhodecode/templates/admin/settings/settings.html b/rhodecode/templates/admin/settings/settings.html --- a/rhodecode/templates/admin/settings/settings.html +++ b/rhodecode/templates/admin/settings/settings.html @@ -148,8 +148,8 @@
- ${h.checkbox('hooks_pretxnchangegroup_push_logger','True')} - + ${h.checkbox('hooks_changegroup_push_logger','True')} +
${h.checkbox('hooks_preoutgoing_pull_logger','True')}