Mercurial > kallithea
comparison rhodecode/lib/hooks.py @ 1307:c1516b35f91d beta
pep8ify
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 03 May 2011 16:54:43 +0200 |
parents | a671db5bdd58 |
children | 677408ee9355 |
comparison
equal
deleted
inserted
replaced
1306:6e1d24503383 | 1307:c1516b35f91d |
---|---|
30 from mercurial.node import nullrev | 30 from mercurial.node import nullrev |
31 | 31 |
32 from rhodecode.lib import helpers as h | 32 from rhodecode.lib import helpers as h |
33 from rhodecode.lib.utils import action_logger | 33 from rhodecode.lib.utils import action_logger |
34 | 34 |
35 | |
35 def repo_size(ui, repo, hooktype=None, **kwargs): | 36 def repo_size(ui, repo, hooktype=None, **kwargs): |
36 """Presents size of repository after push | 37 """Presents size of repository after push |
37 | 38 |
38 :param ui: | 39 :param ui: |
39 :param repo: | 40 :param repo: |
61 size_root_f = h.format_byte_size(size_root) | 62 size_root_f = h.format_byte_size(size_root) |
62 size_total_f = h.format_byte_size(size_root + size_hg) | 63 size_total_f = h.format_byte_size(size_root + size_hg) |
63 sys.stdout.write('Repository size .hg:%s repo:%s total:%s\n' \ | 64 sys.stdout.write('Repository size .hg:%s repo:%s total:%s\n' \ |
64 % (size_hg_f, size_root_f, size_total_f)) | 65 % (size_hg_f, size_root_f, size_total_f)) |
65 | 66 |
67 | |
66 def log_pull_action(ui, repo, **kwargs): | 68 def log_pull_action(ui, repo, **kwargs): |
67 """Logs user last pull action | 69 """Logs user last pull action |
68 | 70 |
69 :param ui: | 71 :param ui: |
70 :param repo: | 72 :param repo: |
76 action = 'pull' | 78 action = 'pull' |
77 | 79 |
78 action_logger(username, action, repository, extra_params['ip']) | 80 action_logger(username, action, repository, extra_params['ip']) |
79 | 81 |
80 return 0 | 82 return 0 |
83 | |
81 | 84 |
82 def log_push_action(ui, repo, **kwargs): | 85 def log_push_action(ui, repo, **kwargs): |
83 """Maps user last push action to new changeset id, from mercurial | 86 """Maps user last push action to new changeset id, from mercurial |
84 | 87 |
85 :param ui: | 88 :param ui: |