Commit Graph

21 Commits

Author SHA1 Message Date
Maxim Khitrov
1cf52a2e29 http: deliver hook output to client 2010-06-30 18:15:23 -05:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Sune Foldager
afbe5c8543 hook: fix bug (reuse of variable) introduced in 4f2cae90dd77
For binary installs, the 'name' argument would be reused as a local variable,
destroying its original value. The patch fixes that, and also avoids copying
sys.path when it's not necessary.
2009-12-21 16:12:43 +01:00
Bryan O'Sullivan
4035f1dfaa Make it possible to debug failed hook imports via use of --traceback
Prior to this change, if a Python hook module failed to load (e.g. due
to an import error or path problem), it was impossible to figure out
why the error occurred, because the ImportErrors that got raised were
caught but never displayed.

If run with --traceback or ui.traceback=True, hg now prints tracebacks
of both of the ImportError instances that get raised before it bails.
2009-11-12 14:05:52 -08:00
Sune Foldager
ba068758a6 hook: only redirect stdout if it and stderr are valid files
When using hgwebdir with WSGI via the IIS ISAPI-WSGI extension, both
stdout and stderr filenos are set to -2, which makes the os.dup call
in hook.py fail.
2009-10-28 21:35:57 +01:00
Steve Borho
c96b2aca86 hook: fix full path imports on Windows (issue1779)
Bottom portion fixes full path imports on source installs on Windows.
The top portion further fixes full path imports on binary installs.

Initial patch by Roman V. Kiseliov
2009-08-05 21:45:54 -05:00
Dirkjan Ochtman
43d9564cff some modernization cleanups, forward compatibility 2009-05-13 14:08:39 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Matt Mackall
de487eacda ui: print_exc() -> traceback() 2009-04-26 16:50:44 -05:00
Alexander Solovyov
609db13729 ability to load hooks from arbitrary python module 2009-03-27 01:28:09 +02:00
Matt Mackall
cb4d50ff04 Introduce HG_PREPEND to solve pretxn races
- add writepending to flush delayed writes to separate file
- add support in hooks for lazy evaluation of callable parameters
- add HG_PENDING to pretxn hooks
  - call writepending if hook is used
  - pass repo root to hook environment
- if HG_PENDING = repo root, we're in pretxn hook
  - read pending data to make pending changesets visible
- filter HG_PENDING in tests/printenv.py
2009-02-16 19:35:07 -06:00
Matt Mackall
7f3bf9b19d error: move SignalInterrupt
now derived from KeyboardInterrupt to simplify catches
2009-01-12 11:48:05 -06:00
Jesse Long
29064bc39c hooks: restore io correctly on exception 2008-11-25 16:40:54 -06:00
Benoit Boissinot
ea7fe6dacc remove unused variables 2008-10-28 19:25:26 +01:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Alexis S. L. Carvalho
e42ba91ec9 hook.py: fix redirections introduced by 59a5ced38398
The only non-obvious part is the use of sys.{__stderr__,__stdout__},
which is needed because sshserver overrides sys.stdout.

This makes a test that I added back in revision d71c96fd819f ineffective.
2008-03-14 21:57:46 -03:00
Matt Mackall
d743a8c08a hooks: fix pre- and post- hooks specified in .hg/hgrc
We were looking up hooks in the wrong ui object. Also, we weren't
handling hooks to commands without a repo.
2008-01-18 09:03:17 -06:00
Matt Mackall
f277b2676b hook: redirect stdout to stderr for ssh and http servers 2008-01-11 13:06:38 -06:00
Matt Mackall
c5b84a3392 hooks: separate hook code into a separate module 2007-06-18 13:24:34 -05:00