Commit Graph

16 Commits

Author SHA1 Message Date
Sebastian Sdorra
fddb3ddc1f removed debugging log file from mercurial hooks 2019-02-25 11:33:40 +01:00
Sebastian Sdorra
13adf4b234 fixed PreReceiveRepositoryHooks for newer versions of mercurial 2019-02-20 11:56:10 +01:00
Sebastian Sdorra
b231499cd0 merge with branch 1.x 2019-01-29 09:42:03 +01:00
René Pfeuffer
bc629ec648 Send repository id with hg hook request 2018-11-27 14:06:11 +01:00
Matt Harbison
405dd67275 ensure each message line printed in the Mercurial hook gets a trailing newline
I noticed that the exception printed in the previous commit started on the same
line as the print for the `str(e)` case right before it.  Since this also prints
the content of urllib2.URLError.read(), it seems better to remove any existing
newline and re-add it, than to just assume the `str(e)` case was the only
problem.
2018-06-22 16:42:05 -04:00
Matt Harbison
2d103b7f95 optionally print tracebacks when the Mercurial hook swallows an exception
If `ui.traceback=True` is set on the server, this prints the stacktrace for the
exception on the client side.  Otherwise, nothing happens.  I tried allowing the
exception to propagate back to Mercurial, but then the client sees this message
with 4.4.2 and 4.6.1:

    abort: remote error:
    Mercurial/Python process ends with return code 1

Something odd changed when upgrading from CentOS 7.4 to 7.5 around forwarding
requests from the loopback address that I don't fully understand.  First, we
were getting a ValueError from inside `opener.open()` saying that 'localhost'
didn't match the host listed in the SSL certificate.  That wasn't visible until
adding this.

Then what happened is a connection refused out of the same function, so the
traceback is added to the other handler too.  Running the equivalent command on
the command line from the 'vcs' host stopped working in 7.5:

  $ curl https://vcs.domain.com/hook/hg/?ping=true
  curl: (7) Failed connect to vcs.domain.com:443; Connection refused

But it works when run on another machine targeting that same 'vcs' host.  Adding
another firewall rule allows everything to work from the 'vcs' host again:

  $ iptables -t nat -I OUTPUT -p tcp -o lo --dport 443 -j REDIRECT --to-ports 8443
2018-06-22 16:33:52 -04:00
Sebastian Sdorra
5637c1a8a2 allow multi line mercurial messages 2013-10-01 21:40:27 +02:00
Sebastian Sdorra
bf4d5b4e83 merge with branch issue-424 2013-08-09 11:11:40 +02:00
Sebastian Sdorra
e1667c6e39 use str(e) if e.read() and e.conn is not available on scmhooks.py 2013-08-08 15:49:42 +02:00
Sebastian Sdorra
eec1d32daf print messages even if the push is aborted 2013-07-27 17:18:38 +02:00
Sebastian Sdorra
86bd700bf6 implement new hook api for mercurial repositories 2013-07-22 11:40:03 +02:00
Sebastian Sdorra
6d96cbd872 ignore global proxy settings for mercurial hooks 2013-04-17 21:07:22 +02:00
Sebastian Sdorra
db5a17fa9e send mercurial hook error messages to client 2013-04-02 21:57:23 +02:00
Sebastian Sdorra
a5fa1fc007 improve mercurial hook error handling 2012-06-02 15:06:59 +02:00
Sebastian Sdorra
c81ac284f8 use urllib2 for urlopen to be more campatible to different python versions 2012-05-29 16:33:08 +02:00
Sebastian Sdorra
f41f3274b9 rename hook.py to scmhooks.py 2012-02-12 17:18:04 +01:00