Parent: [82e0b8] (diff)

Download this file

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

#!$executable
import sys
import json

REPOSITORY='$repository'
CONFIG='$config'

def main():
    for line in sys.stdin:
        old, new, ref = line.split()
        print '%s: %s -> %s' % (ref, old, new)
        from pyforge.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()