Parent: [95e11b] (diff)

Download this file

reactors.py    25 lines (19 with data), 583 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import logging
import pylons
from allura.lib.decorators import audit, react
from allura import model as M
log = logging.getLogger(__name__)
@audit('scm.hg.init')
def init(routing_key, data):
repo = pylons.c.app.repo
repo.init()
M.Notification.post_user(
pylons.c.user, repo, 'created',
text='Hg repository created')
@audit('scm.hg.clone')
def clone(routing_key, data):
repo = pylons.c.app.repo
repo.init_as_clone(data['cloned_from'])
M.Notification.post_user(
pylons.c.user, repo, 'created',
text='Hg repository created')