From: Neil Date: Tue, 3 Sep 2013 09:50:30 +0000 (+0200) Subject: Allow irkerhook to be used as a mecurial changegroup hook X-Git-Tag: 2.0~16^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=03994eeff9d0d8c71ba52f78264150bae0f09c13;p=irker.git Allow irkerhook to be used as a mecurial changegroup hook --- diff --git a/irkerhook.py b/irkerhook.py index 4b243a2..d09eb17 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -393,12 +393,20 @@ class HgExtractor(GenericExtractor): return commit def hg_hook(ui, repo, **kwds): - # To be called from a Mercurial "commit" or "incoming" hook. Example - # configuration: + # To be called from a Mercurial "commit", "incoming" or "changegroup" hook. + # Example configuration: # [hooks] # incoming.irker = python:/path/to/irkerhook.py:hg_hook extractor = HgExtractor([(ui, repo)]) - ship(extractor, kwds['node'], False) + start = repo[kwds['node']].rev() + end = len(repo) + if start != end: + # changegroup with multiple commits, so we generate a notification + # for each one + for rev in range(start, end): + ship(extractor, rev, False) + else: + ship(extractor, kwds['node'], False) # The files we use to identify a Subversion repo might occur as content # in a git or hg repo, but the special subdirectories for those are more