Download:
child 238:5a4ed43de4c6
parent 236:3f5b52fcf6e1
237:6098f4b17b2f
Anton Shestakov <av6@dwimlabs.net>, Thu, 01 Sep 2016 17:30:18 +0800
queue: guess repo name if it's not in target configuration

1 файлов изменено, 5 вставок(+), 0 удалений(-) [+]
poll-hgweb-queue.py file | annotate | diff | comparison | revisions
--- a/poll-hgweb-queue.py Wed Aug 31 12:55:48 2016 +0800
+++ b/poll-hgweb-queue.py Thu Sep 01 17:30:18 2016 +0800
@@ -18,6 +18,11 @@
parsed = urlparse(target['url'])
if 'source' not in target:
target['source'] = parsed.hostname
+ if 'repo' not in target:
+ path = parsed.path.rstrip('/')
+ if path.endswith('/json-branches'):
+ path = path[:-14].rstrip('/')
+ target['repo'] = path.rpartition('/')[-1]
class CandolintPoller(Application):