Mercurial > hg
annotate hgext/logtoprocess.py @ 30817:2b279126b8f5
revlog: use compression engine APIs for decompression
Now that compression engines declare their header in revlog chunks
and can decompress revlog chunks, we refactor revlog.decompress()
to use them.
Making full use of the property that revlog compressor objects are
reusable, revlog instances now maintain a dict mapping an engine's
revlog header to a compressor object. This is not only a performance
optimization for engines where compressor object reuse can result in
better performance, but it also serves as a cache of header values
so we don't need to perform redundant lookups against the compression
engine manager. (Yes, I measured and the overhead of a function call
versus a dict lookup was observed.)
Replacing the previous inline lookup table with a dict lookup was
measured to make chunk reading ~2.5% slower on changelogs and ~4.5%
slower on manifests. So, the inline lookup table has been mostly
preserved so we don't lose performance. This is unfortunate. But
many decompression operations complete in microseconds, so Python
attribute lookup, dict lookup, and function calls do matter.
The impact of this change on mozilla-unified is as follows:
$ hg perfrevlogchunks -c
! chunk
! wall 1.953663 comb 1.950000 user 1.920000 sys 0.030000 (best of 6)
! wall 1.946000 comb 1.940000 user 1.910000 sys 0.030000 (best of 6)
! chunk batch
! wall 1.791075 comb 1.800000 user 1.760000 sys 0.040000 (best of 6)
! wall 1.785690 comb 1.770000 user 1.750000 sys 0.020000 (best of 6)
$ hg perfrevlogchunks -m
! chunk
! wall 2.587262 comb 2.580000 user 2.550000 sys 0.030000 (best of 4)
! wall 2.616330 comb 2.610000 user 2.560000 sys 0.050000 (best of 4)
! chunk batch
! wall 2.427092 comb 2.420000 user 2.400000 sys 0.020000 (best of 5)
! wall 2.462061 comb 2.460000 user 2.400000 sys 0.060000 (best of 4)
Changelog chunk reading is slightly faster but manifest reading is
slower. What gives?
On this repo, 99.85% of changelog entries are zlib compressed (the 'x'
header). On the manifest, 67.5% are zlib and 32.4% are '\0'. This patch
swapped the test order of 'x' and '\0' so now 'x' is tested first. This
makes changelogs faster since they almost always hit the first branch.
This makes a significant percentage of manifest '\0' chunks slower
because that code path now performs an extra test. Yes, I too can't
believe we're able to measure the impact of an if..elif with simple
string compares. I reckon this code would benefit from being written
in C...
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 13 Jan 2017 19:58:00 -0800 |
parents | 1c5cbf28f007 |
children | 8e7feaad2d8d |
rev | line source |
---|---|
28901
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
1 # logtoprocess.py - send ui.log() data to a subprocess |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
2 # |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
3 # Copyright 2016 Facebook, Inc. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
4 # |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
5 # This software may be used and distributed according to the terms of the |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
6 # GNU General Public License version 2 or any later version. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
7 """Send ui.log() data to a subprocess (EXPERIMENTAL) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
8 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
9 This extension lets you specify a shell command per ui.log() event, |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
10 sending all remaining arguments to as environment variables to that command. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
11 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
12 Each positional argument to the method results in a `MSG[N]` key in the |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
13 environment, starting at 1 (so `MSG1`, `MSG2`, etc.). Each keyword argument |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
14 is set as a `OPT_UPPERCASE_KEY` variable (so the key is uppercased, and |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
15 prefixed with `OPT_`). The original event name is passed in the `EVENT` |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
16 environment variable, and the process ID of mercurial is given in `HGPID`. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
17 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
18 So given a call `ui.log('foo', 'bar', 'baz', spam='eggs'), a script configured |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
19 for the `foo` event can expect an environment with `MSG1=bar`, `MSG2=baz`, and |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
20 `OPT_SPAM=eggs`. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
21 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
22 Scripts are configured in the `[logtoprocess]` section, each key an event name. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
23 For example:: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
24 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
25 [logtoprocess] |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
26 commandexception = echo "$MSG2$MSG3" > /var/log/mercurial_exceptions.log |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
27 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
28 would log the warning message and traceback of any failed command dispatch. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
29 |
30332
318a24b52eeb
spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents:
29841
diff
changeset
|
30 Scripts are run asynchronously as detached daemon processes; mercurial will |
28901
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
31 not ensure that they exit cleanly. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
32 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
33 """ |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
34 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
35 from __future__ import absolute_import |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
36 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
37 import itertools |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
38 import os |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
39 import platform |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
40 import subprocess |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
41 import sys |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
42 |
30638
1c5cbf28f007
py3: replace os.environ with encoding.environ (part 5 of 5)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30332
diff
changeset
|
43 from mercurial import encoding |
1c5cbf28f007
py3: replace os.environ with encoding.environ (part 5 of 5)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30332
diff
changeset
|
44 |
29841
d5883fd055c6
extensions: change magic "shipped with hg" string
Augie Fackler <augie@google.com>
parents:
29463
diff
changeset
|
45 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
28901
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
46 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
47 # be specifying the version(s) of Mercurial they are tested with, or |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
48 # leave the attribute unspecified. |
29841
d5883fd055c6
extensions: change magic "shipped with hg" string
Augie Fackler <augie@google.com>
parents:
29463
diff
changeset
|
49 testedwith = 'ships-with-hg-core' |
28901
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
50 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
51 def uisetup(ui): |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
52 if platform.system() == 'Windows': |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
53 # no fork on Windows, but we can create a detached process |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
54 # https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863.aspx |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
55 # No stdlib constant exists for this value |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
56 DETACHED_PROCESS = 0x00000008 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
57 _creationflags = DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
58 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
59 def runshellcommand(script, env): |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
60 # we can't use close_fds *and* redirect stdin. I'm not sure that we |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
61 # need to because the detached process has no console connection. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
62 subprocess.Popen( |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
63 script, shell=True, env=env, close_fds=True, |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
64 creationflags=_creationflags) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
65 else: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
66 def runshellcommand(script, env): |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
67 # double-fork to completely detach from the parent process |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
68 # based on http://code.activestate.com/recipes/278731 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
69 pid = os.fork() |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
70 if pid: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
71 # parent |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
72 return |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
73 # subprocess.Popen() forks again, all we need to add is |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
74 # flag the new process as a new session. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
75 if sys.version_info < (3, 2): |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
76 newsession = {'preexec_fn': os.setsid} |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
77 else: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
78 newsession = {'start_new_session': True} |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
79 try: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
80 # connect stdin to devnull to make sure the subprocess can't |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
81 # muck up that stream for mercurial. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
82 subprocess.Popen( |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
83 script, shell=True, stdin=open(os.devnull, 'r'), env=env, |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
84 close_fds=True, **newsession) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
85 finally: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
86 # mission accomplished, this child needs to exit and not |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
87 # continue the hg process here. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
88 os._exit(0) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
89 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
90 class logtoprocessui(ui.__class__): |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
91 def log(self, event, *msg, **opts): |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
92 """Map log events to external commands |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
93 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
94 Arguments are passed on as environment variables. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
95 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
96 """ |
29463
4cf0542dcbe7
logtoprocess: do not leak the ui object in uisetup
Jun Wu <quark@fb.com>
parents:
28901
diff
changeset
|
97 script = self.config('logtoprocess', event) |
28901
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
98 if script: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
99 if msg: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
100 # try to format the log message given the remaining |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
101 # arguments |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
102 try: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
103 # Python string formatting with % either uses a |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
104 # dictionary *or* tuple, but not both. If we have |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
105 # keyword options, assume we need a mapping. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
106 formatted = msg[0] % (opts or msg[1:]) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
107 except (TypeError, KeyError): |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
108 # Failed to apply the arguments, ignore |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
109 formatted = msg[0] |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
110 messages = (formatted,) + msg[1:] |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
111 else: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
112 messages = msg |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
113 # positional arguments are listed as MSG[N] keys in the |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
114 # environment |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
115 msgpairs = ( |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
116 ('MSG{0:d}'.format(i), str(m)) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
117 for i, m in enumerate(messages, 1)) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
118 # keyword arguments get prefixed with OPT_ and uppercased |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
119 optpairs = ( |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
120 ('OPT_{0}'.format(key.upper()), str(value)) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
121 for key, value in opts.iteritems()) |
30638
1c5cbf28f007
py3: replace os.environ with encoding.environ (part 5 of 5)
Pulkit Goyal <7895pulkit@gmail.com>
parents:
30332
diff
changeset
|
122 env = dict(itertools.chain(encoding.environ.items(), |
28901
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
123 msgpairs, optpairs), |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
124 EVENT=event, HGPID=str(os.getpid())) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
125 # Connect stdin to /dev/null to prevent child processes messing |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
126 # with mercurial's stdin. |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
127 runshellcommand(script, env) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
128 return super(logtoprocessui, self).log(event, *msg, **opts) |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
129 |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
130 # Replace the class for this instance and all clones created from it: |
a368da441b32
logtoprocess: new experimental extension
Martijn Pieters <mjpieters@fb.com>
parents:
diff
changeset
|
131 ui.__class__ = logtoprocessui |