When running an external hook, the file hook.py uses util.system(), which,
in turn, uses subprocess.call().
This loses track of anything printed by the hook as an error message and the
end user is left alone with an error code.
Shouldn't it use popen instead and redirect sys.stderr to ui.write() ??
This is the way SVN hooks works and its very valuable.
PS:
A workaround would be to use internal hooks in which a reference to the ui
is provided, but I don't want to go down that route for several reasons:
1. To ease the install process, our Windows boxes use the standard
TortoiseHg installer and therefore don't use our Python version already
installed elsewhere
2. Besides the function in the 'commands' module, there is no real API
(which is guaranteed to work in future releases... or to be deprecated slowly) |