Mercurial > kallithea
comparison rhodecode/lib/hooks.py @ 3672:55585c86be83 beta
hooks: make_lock is tristate
Missed in 260a7a01.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 04 Apr 2013 17:45:55 +0200 |
parents | 260a7a01b054 |
children | 3563bb7b4b82 dc4644865e8b |
comparison
equal
deleted
inserted
replaced
3671:658ccf9727ef | 3672:55585c86be83 |
---|---|
141 if isfunction(callback): | 141 if isfunction(callback): |
142 kw = {} | 142 kw = {} |
143 kw.update(ex) | 143 kw.update(ex) |
144 callback(**kw) | 144 callback(**kw) |
145 | 145 |
146 if ex.make_lock: | 146 if ex.make_lock is not None and ex.make_lock: |
147 Repository.lock(Repository.get_by_repo_name(ex.repository), user.user_id) | 147 Repository.lock(Repository.get_by_repo_name(ex.repository), user.user_id) |
148 #msg = 'Made lock on repo `%s`' % repository | 148 #msg = 'Made lock on repo `%s`' % repository |
149 #sys.stdout.write(msg) | 149 #sys.stdout.write(msg) |
150 | 150 |
151 if ex.locked_by[0]: | 151 if ex.locked_by[0]: |
200 if isfunction(callback): | 200 if isfunction(callback): |
201 kw = {'pushed_revs': revs} | 201 kw = {'pushed_revs': revs} |
202 kw.update(ex) | 202 kw.update(ex) |
203 callback(**kw) | 203 callback(**kw) |
204 | 204 |
205 if not ex.make_lock: | 205 if ex.make_lock is not None and not ex.make_lock: |
206 Repository.unlock(Repository.get_by_repo_name(ex.repository)) | 206 Repository.unlock(Repository.get_by_repo_name(ex.repository)) |
207 msg = 'Released lock on repo `%s`\n' % ex.repository | 207 msg = 'Released lock on repo `%s`\n' % ex.repository |
208 sys.stdout.write(msg) | 208 sys.stdout.write(msg) |
209 | 209 |
210 if ex.locked_by[0]: | 210 if ex.locked_by[0]: |