Mercurial > kallithea
annotate rhodecode/lib/hooks.py @ 2602:17083006a33d beta
Added cleanup repos script that allows to cleanup removed repos from rhodecode
older than given amount of time units.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 14 Jul 2012 18:53:39 +0200 |
parents | c35980ae7958 |
children | c0ec29b20eb6 |
rev | line source |
---|---|
913
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
1 # -*- coding: utf-8 -*- |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
2 """ |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
3 rhodecode.lib.hooks |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
4 ~~~~~~~~~~~~~~~~~~~ |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
5 |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
6 Hooks runned by rhodecode |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1114
diff
changeset
|
7 |
913
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
8 :created_on: Aug 6, 2010 |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
9 :author: marcink |
1824
89efedac4e6c
2012 copyrights
Marcin Kuzminski <marcin@python-works.com>
parents:
1814
diff
changeset
|
10 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com> |
913
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
11 :license: GPLv3, see COPYING for more details. |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
12 """ |
1206
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
13 # This program is free software: you can redistribute it and/or modify |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
14 # it under the terms of the GNU General Public License as published by |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
15 # the Free Software Foundation, either version 3 of the License, or |
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
16 # (at your option) any later version. |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1114
diff
changeset
|
17 # |
392
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 # This program is distributed in the hope that it will be useful, |
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
21 # GNU General Public License for more details. |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1114
diff
changeset
|
22 # |
392
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
23 # You should have received a copy of the GNU General Public License |
1206
a671db5bdd58
fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents:
1203
diff
changeset
|
24 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
913
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
25 import os |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
26 import sys |
2324
1dbf07735af4
save full raw id in push log data for much faster revision lookup
Marcin Kuzminski <marcin@python-works.com>
parents:
2236
diff
changeset
|
27 import binascii |
1dbf07735af4
save full raw id in push log data for much faster revision lookup
Marcin Kuzminski <marcin@python-works.com>
parents:
2236
diff
changeset
|
28 from inspect import isfunction |
392
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
29 |
1415
677408ee9355
fixed hooks for mercurial 1.9
Marcin Kuzminski <marcin@python-works.com>
parents:
1307
diff
changeset
|
30 from mercurial.scmutil import revrange |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
31 from mercurial.node import nullrev |
2324
1dbf07735af4
save full raw id in push log data for much faster revision lookup
Marcin Kuzminski <marcin@python-works.com>
parents:
2236
diff
changeset
|
32 |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
33 from rhodecode.lib import helpers as h |
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
34 from rhodecode.lib.utils import action_logger |
2404
a3efdd61a21f
Git Hooks are automatically installed in new repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2402
diff
changeset
|
35 from rhodecode.lib.vcs.backends.base import EmptyChangeset |
392
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
36 |
1307 | 37 |
2196
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
38 def _get_scm_size(alias, root_path): |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
39 |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
40 if not alias.startswith('.'): |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
41 alias += '.' |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
42 |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
43 size_scm, size_root = 0, 0 |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
44 for path, dirs, files in os.walk(root_path): |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
45 if path.find(alias) != -1: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
46 for f in files: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
47 try: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
48 size_scm += os.path.getsize(os.path.join(path, f)) |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
49 except OSError: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
50 pass |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
51 else: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
52 for f in files: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
53 try: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
54 size_root += os.path.getsize(os.path.join(path, f)) |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
55 except OSError: |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
56 pass |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
57 |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
58 size_scm_f = h.format_byte_size(size_scm) |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
59 size_root_f = h.format_byte_size(size_root) |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
60 size_total_f = h.format_byte_size(size_root + size_scm) |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
61 |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
62 return size_scm_f, size_root_f, size_total_f |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
63 |
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
64 |
392
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
65 def repo_size(ui, repo, hooktype=None, **kwargs): |
1722
e7eef7a1db6a
#235 forking page repo group selection
Marcin Kuzminski <marcin@python-works.com>
parents:
1416
diff
changeset
|
66 """ |
e7eef7a1db6a
#235 forking page repo group selection
Marcin Kuzminski <marcin@python-works.com>
parents:
1416
diff
changeset
|
67 Presents size of repository after push |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1114
diff
changeset
|
68 |
913
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
69 :param ui: |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
70 :param repo: |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
71 :param hooktype: |
d173938d711b
filled in some docs for hooks
Marcin Kuzminski <marcin@python-works.com>
parents:
902
diff
changeset
|
72 """ |
392
b27d32cb3157
Implemented hooks system,
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
73 |
2196
7ccf403b9c3f
made repo-size hook more generic
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
74 size_hg_f, size_root_f, size_total_f = _get_scm_size('.hg', repo.root) |
1814
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
75 |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
76 last_cs = repo[len(repo) - 1] |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
77 |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
78 msg = ('Repository size .hg:%s repo:%s total:%s\n' |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
79 'Last revision is now r%s:%s\n') % ( |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
80 size_hg_f, size_root_f, size_total_f, last_cs.rev(), last_cs.hex()[:12] |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
81 ) |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
82 |
9de452afbe01
small change for post update hook that displays repository size
Marcin Kuzminski <marcin@python-works.com>
parents:
1722
diff
changeset
|
83 sys.stdout.write(msg) |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
84 |
1307 | 85 |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
86 def log_pull_action(ui, repo, **kwargs): |
1722
e7eef7a1db6a
#235 forking page repo group selection
Marcin Kuzminski <marcin@python-works.com>
parents:
1416
diff
changeset
|
87 """ |
e7eef7a1db6a
#235 forking page repo group selection
Marcin Kuzminski <marcin@python-works.com>
parents:
1416
diff
changeset
|
88 Logs user last pull action |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1114
diff
changeset
|
89 |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
90 :param ui: |
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
91 :param repo: |
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
92 """ |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
93 extras = dict(repo.ui.configitems('rhodecode_extras')) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
94 username = extras['username'] |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
95 repository = extras['repository'] |
2203
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
96 scm = extras['scm'] |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
97 action = 'pull' |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
98 |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
99 action_logger(username, action, repository, extras['ip'], commit=True) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
100 # extension hook call |
2406
7be31af5bc78
changed scope of calling EXTENSIONS from rhodecode for githooks to be able to execute them
Marcin Kuzminski <marcin@python-works.com>
parents:
2404
diff
changeset
|
101 from rhodecode import EXTENSIONS |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
102 callback = getattr(EXTENSIONS, 'PULL_HOOK', None) |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
103 |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
104 if isfunction(callback): |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
105 kw = {} |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
106 kw.update(extras) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
107 callback(**kw) |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
108 return 0 |
503
3d6d548ad3cc
Added user action mapper to map push to changeset.
Marcin Kuzminski <marcin@python-works.com>
parents:
392
diff
changeset
|
109 |
1307 | 110 |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
111 def log_push_action(ui, repo, **kwargs): |
1722
e7eef7a1db6a
#235 forking page repo group selection
Marcin Kuzminski <marcin@python-works.com>
parents:
1416
diff
changeset
|
112 """ |
e7eef7a1db6a
#235 forking page repo group selection
Marcin Kuzminski <marcin@python-works.com>
parents:
1416
diff
changeset
|
113 Maps user last push action to new changeset id, from mercurial |
1203
6832ef664673
source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents:
1114
diff
changeset
|
114 |
604
5cc96df705b9
fixed @repo into :repo for docs
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
115 :param ui: |
2236
37c143aa8616
fixes issue #436 git push error
Marcin Kuzminski <marcin@python-works.com>
parents:
2203
diff
changeset
|
116 :param repo: repo object containing the `ui` object |
503
3d6d548ad3cc
Added user action mapper to map push to changeset.
Marcin Kuzminski <marcin@python-works.com>
parents:
392
diff
changeset
|
117 """ |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
118 |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
119 extras = dict(repo.ui.configitems('rhodecode_extras')) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
120 username = extras['username'] |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
121 repository = extras['repository'] |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
122 action = extras['action'] + ':%s' |
2203
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
123 scm = extras['scm'] |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
124 |
2203
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
125 if scm == 'hg': |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
126 node = kwargs['node'] |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
127 |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
128 def get_revs(repo, rev_opt): |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
129 if rev_opt: |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
130 revs = revrange(repo, rev_opt) |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
131 |
2203
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
132 if len(revs) == 0: |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
133 return (nullrev, nullrev) |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
134 return (max(revs), min(revs)) |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
135 else: |
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
136 return (len(repo) - 1, 0) |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
137 |
2203
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
138 stop, start = get_revs(repo, [node + ':']) |
2324
1dbf07735af4
save full raw id in push log data for much faster revision lookup
Marcin Kuzminski <marcin@python-works.com>
parents:
2236
diff
changeset
|
139 h = binascii.hexlify |
2407
8a68e0292232
Change git & hg hooks to post. They shouldn't block as they are used just for logging actions. Futhermore post hooks have access to changesets, so it's much better flexible
Marcin Kuzminski <marcin@python-works.com>
parents:
2406
diff
changeset
|
140 revs = [h(repo[r].node()) for r in xrange(start, stop + 1)] |
2203
d9972f76322e
added emulation of pull hook for git-backend, and dummy git-push hook
Marcin Kuzminski <marcin@python-works.com>
parents:
2196
diff
changeset
|
141 elif scm == 'git': |
2402
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
142 revs = kwargs.get('_git_revs', []) |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
143 if '_git_revs' in kwargs: |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
144 kwargs.pop('_git_revs') |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
145 |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
146 action = action % ','.join(revs) |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
147 |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
148 action_logger(username, action, repository, extras['ip'], commit=True) |
675
59670f091c76
bugfix, repo_size crashed when broken symlinks where inside a repository.
Marcin Kuzminski <marcin@python-works.com>
parents:
654
diff
changeset
|
149 |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
150 # extension hook call |
2406
7be31af5bc78
changed scope of calling EXTENSIONS from rhodecode for githooks to be able to execute them
Marcin Kuzminski <marcin@python-works.com>
parents:
2404
diff
changeset
|
151 from rhodecode import EXTENSIONS |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
152 callback = getattr(EXTENSIONS, 'PUSH_HOOK', None) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
153 if isfunction(callback): |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
154 kw = {'pushed_revs': revs} |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
155 kw.update(extras) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
156 callback(**kw) |
654
7f5976da192c
#48 rewrite action loggers into hooks with all changesets that are inside a push
Marcin Kuzminski <marcin@python-works.com>
parents:
629
diff
changeset
|
157 return 0 |
1972
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
158 |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
159 |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
160 def log_create_repository(repository_dict, created_by, **kwargs): |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
161 """ |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
162 Post create repository Hook. This is a dummy function for admins to re-use |
2109 | 163 if needed. It's taken from rhodecode-extensions module and executed |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
164 if present |
1972
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
165 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1972
diff
changeset
|
166 :param repository: dict dump of repository object |
1972
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
167 :param created_by: username who created repository |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
168 :param created_date: date of creation |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
169 |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
170 available keys of repository_dict: |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
171 |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
172 'repo_type', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
173 'description', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
174 'private', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
175 'created_on', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
176 'enable_downloads', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
177 'repo_id', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
178 'user_id', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
179 'enable_statistics', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
180 'clone_uri', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
181 'fork_id', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
182 'group_id', |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
183 'repo_name' |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
184 |
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
185 """ |
2406
7be31af5bc78
changed scope of calling EXTENSIONS from rhodecode for githooks to be able to execute them
Marcin Kuzminski <marcin@python-works.com>
parents:
2404
diff
changeset
|
186 from rhodecode import EXTENSIONS |
2105
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
187 callback = getattr(EXTENSIONS, 'CREATE_REPO_HOOK', None) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
188 if isfunction(callback): |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
189 kw = {} |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
190 kw.update(repository_dict) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
191 kw.update({'created_by': created_by}) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
192 kw.update(kwargs) |
926f55b038bc
added initial rc-extension module
Marcin Kuzminski <marcin@python-works.com>
parents:
1982
diff
changeset
|
193 return callback(**kw) |
1972
27abf546aa8a
#348 added post-create repository hook
Marcin Kuzminski <marcin@python-works.com>
parents:
1824
diff
changeset
|
194 |
1982
87f0800abc7b
#227 Initial version of repository groups permissions system
Marcin Kuzminski <marcin@python-works.com>
parents:
1972
diff
changeset
|
195 return 0 |
2402
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
196 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
197 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
198 def handle_git_post_receive(repo_path, revs, env): |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
199 """ |
2407
8a68e0292232
Change git & hg hooks to post. They shouldn't block as they are used just for logging actions. Futhermore post hooks have access to changesets, so it's much better flexible
Marcin Kuzminski <marcin@python-works.com>
parents:
2406
diff
changeset
|
200 A really hacky method that is runned by git post-receive hook and logs |
2409
761e00380370
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2408
diff
changeset
|
201 an push action together with pushed revisions. It's executed by subprocess |
761e00380370
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2408
diff
changeset
|
202 thus needs all info to be able to create a on the fly pylons enviroment, |
761e00380370
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2408
diff
changeset
|
203 connect to database and run the logging code. Hacky as sh*t but works. |
2402
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
204 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
205 :param repo_path: |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
206 :type repo_path: |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
207 :param revs: |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
208 :type revs: |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
209 :param env: |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
210 :type env: |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
211 """ |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
212 from paste.deploy import appconfig |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
213 from sqlalchemy import engine_from_config |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
214 from rhodecode.config.environment import load_environment |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
215 from rhodecode.model import init_model |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
216 from rhodecode.model.db import RhodeCodeUi |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
217 from rhodecode.lib.utils import make_ui |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
218 from rhodecode.model.db import Repository |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
219 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
220 path, ini_name = os.path.split(env['RHODECODE_CONFIG_FILE']) |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
221 conf = appconfig('config:%s' % ini_name, relative_to=path) |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
222 load_environment(conf.global_conf, conf.local_conf) |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
223 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
224 engine = engine_from_config(conf, 'sqlalchemy.db1.') |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
225 init_model(engine) |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
226 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
227 baseui = make_ui('db') |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
228 repo = Repository.get_by_full_path(repo_path) |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
229 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
230 _hooks = dict(baseui.configitems('hooks')) or {} |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
231 # if push hook is enabled via web interface |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
232 if _hooks.get(RhodeCodeUi.HOOK_PUSH): |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
233 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
234 extras = { |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
235 'username': env['RHODECODE_USER'], |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
236 'repository': repo.repo_name, |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
237 'scm': 'git', |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
238 'action': 'push', |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
239 'ip': env['RHODECODE_CONFIG_IP'], |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
240 } |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
241 for k, v in extras.items(): |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
242 baseui.setconfig('rhodecode_extras', k, v) |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
243 repo = repo.scm_instance |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
244 repo.ui = baseui |
2404
a3efdd61a21f
Git Hooks are automatically installed in new repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2402
diff
changeset
|
245 old_rev, new_rev, ref = revs |
a3efdd61a21f
Git Hooks are automatically installed in new repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2402
diff
changeset
|
246 if old_rev == EmptyChangeset().raw_id: |
a3efdd61a21f
Git Hooks are automatically installed in new repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2402
diff
changeset
|
247 cmd = "for-each-ref --format='%(refname)' 'refs/heads/*'" |
a3efdd61a21f
Git Hooks are automatically installed in new repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2402
diff
changeset
|
248 heads = repo.run_git_command(cmd)[0] |
a3efdd61a21f
Git Hooks are automatically installed in new repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2402
diff
changeset
|
249 heads = heads.replace(ref, '') |
2408
89875fb6739a
fixed issue with git-hook when pushing new heads
Marcin Kuzminski <marcin@python-works.com>
parents:
2407
diff
changeset
|
250 heads = ' '.join(map(lambda c: c.strip('\n').strip(), |
89875fb6739a
fixed issue with git-hook when pushing new heads
Marcin Kuzminski <marcin@python-works.com>
parents:
2407
diff
changeset
|
251 heads.splitlines())) |
89875fb6739a
fixed issue with git-hook when pushing new heads
Marcin Kuzminski <marcin@python-works.com>
parents:
2407
diff
changeset
|
252 cmd = ('log ' + new_rev + |
89875fb6739a
fixed issue with git-hook when pushing new heads
Marcin Kuzminski <marcin@python-works.com>
parents:
2407
diff
changeset
|
253 ' --reverse --pretty=format:"%H" --not ' + heads) |
2404
a3efdd61a21f
Git Hooks are automatically installed in new repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2402
diff
changeset
|
254 else: |
2408
89875fb6739a
fixed issue with git-hook when pushing new heads
Marcin Kuzminski <marcin@python-works.com>
parents:
2407
diff
changeset
|
255 cmd = ('log ' + old_rev + '..' + new_rev + |
89875fb6739a
fixed issue with git-hook when pushing new heads
Marcin Kuzminski <marcin@python-works.com>
parents:
2407
diff
changeset
|
256 ' --reverse --pretty=format:"%H"') |
2402
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
257 git_revs = repo.run_git_command(cmd)[0].splitlines() |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
258 |
2eeb2ed72e55
Added handling of git hooks, extract pushed revisions and store them inside
Marcin Kuzminski <marcin@python-works.com>
parents:
2324
diff
changeset
|
259 log_push_action(baseui, repo, _git_revs=git_revs) |