Child: [c1c9d7] (diff)

Download this file

post-receive_tmpl    24 lines (19 with data), 579 Bytes

#!$executable
import sys
import json
import urllib2

REPOSITORY='$repository'

def main():
    for line in sys.stdin:
        old, new, ref = line.split()
        print '%s: %s -> %s' % (ref, old, new)
        from allura.command import SendMessageCommand
        cmd = SendMessageCommand('sendmsg')
        msg = dict(hash='%s..%s' % (old, new))
        cmd.parse_args(['-c', REPOSITORY, CONFIG,
                        'react', 'scm.git.refresh_commit',
                        json.dumps(msg)])
        cmd.command()
        print line

if __name__ == '__main__':
    main()