Index: sitescripts/hg/bin/irchook.py |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/sitescripts/hg/bin/irchook.py |
@@ -0,0 +1,13 @@ |
+import os, subprocess, pipes |
Wladimir Palant
2012/09/27 07:34:17
That's my change, not yours :)
|
+ |
+from sitescripts.utils import get_config |
+ |
+def hook(ui, repo, node=None, **kwargs): |
+ ctx = repo[node] |
+ remote = [get_config().get('irchook', 'remote_command'), |
+ os.path.basename(repo.root), str(ctx.user()), str(ctx), |
+ str(ctx.description())] |
+ remote = ' '.join(map(lambda s: pipes.quote(s), remote)) |
+ |
+ command = ['ssh', get_config().get('irchook', 'remote_host'), remote] |
+ subprocess.call(command) |