# HG changeset patch # User FUJIWARA Katsunori # Date 1397576244 -32400 # Node ID cc13addbd62bb4fb6a1b295a85d99e95a46c5dfd # Parent 7f875ed19475077e6de38631b5afd0f7b5c9bc4c util: enable "hooks" to return list of the values returned from each hooks diff -r 7f875ed19475 -r cc13addbd62b mercurial/util.py --- a/mercurial/util.py Wed Apr 16 00:37:24 2014 +0900 +++ b/mercurial/util.py Wed Apr 16 00:37:24 2014 +0900 @@ -1996,8 +1996,10 @@ def __call__(self, *args): self._hooks.sort(key=lambda x: x[0]) + results = [] for source, hook in self._hooks: - hook(*args) + results.append(hook(*args)) + return results def debugstacktrace(msg='stacktrace', skip=0, f=sys.stderr, otherf=sys.stdout): '''Writes a message to f (stderr) with a nicely formatted stacktrace.