Getting feedback from web server

Angel Ezquerra angel.ezquerra at
Tue Oct 18 02:06:24 CDT 2011


I am working on a hook that runs on the mercurial web server. This
hook aborts pushes under certain conditions. When a push is aborted
I'd like to have the web server give some feedback to the client, to
inform it of the reasons why the push was aborted.

I first tried using the ui methods (such as ui.warn()). However, the
client does not get those messages. Instead they are just shown on the
web server log. On the other hand if I use print statements they are
shown on the client, prepended  with "remote: ".

My question is: is this the right way to do it? Should I simply use
print statements? What if I wanted to use this same hook function as a
local pre-commit hook, for example)? Wouldn't in that case make more
sense to use ui.warn()? Should I simply check the hook type and source
and do a print or a ui.warn() depending on the context?



More information about the Mercurial-devel mailing list