Message11382

Author jan1972
Recipients
Date 2010-01-05.17:30:38
Content
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)
History
Date User Action Args
2010-01-05 17:30:39jan1972setmessageid: <1262712639.52.0.905895509327.issue1971@mercurial.selenic.com>
2010-01-05 17:30:39jan1972linkissue1971 messages
2010-01-05 17:30:38jan1972create