Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/hg/bin/irchook.py

Issue 8327353: Crawler backend (Closed)
Patch Set: Created Sept. 27, 2012, 6:22 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld