##// END OF EJS Templates
inno: remove w9xpopen.exe...
inno: remove w9xpopen.exe w9xpopen.exe is a utility program shipped with Python <3.4 (https://bugs.python.org/issue14470 tracked its removal). The program was used by subprocess to wrap invoked processes on Windows 95 and 98 or when command.com was used in order to work around a redirect bug. The workaround is only used on ancient Windows versions - versions that we shouldn't see in 2019. While Python 2.7's subprocess module still references w9xpopen.exe, not shipping it shouldn't matter unless we're running an ancient version of Windows. Python will raise an exception if w9xpopen.exe can't be found. It's highly unlikely anyone is using current Mercurial releases on these ancient Windows versions. So remove w9xpopen.exe from the Inno installer. .. bc:: The 32-bit Windows Inno installers no longer distribute w9xpopen.exe. This should only impact people running Mercurial on Windows 95, 98, or ME. Differential Revision: https://phab.mercurial-scm.org/D6068

File last commit:

r39434:45279028 default
r42021:2dbdb9ab default
Show More
tracing.py
44 lines | 1.3 KiB | text/x-python | PythonLexer
# Support code for event tracing in Mercurial. Lives in demandimport
# so it can also be used in demandimport.
#
# Copyright 2018 Google LLC.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import contextlib
import os
_pipe = None
_checked = False
@contextlib.contextmanager
def log(whencefmt, *whenceargs):
global _pipe, _session, _checked
if _pipe is None:
if _checked:
yield
return
_checked = True
if 'HGCATAPULTSERVERPIPE' not in os.environ:
yield
return
_pipe = open(os.environ['HGCATAPULTSERVERPIPE'], 'w', 1)
_session = os.environ.get('HGCATAPULTSESSION', 'none')
whence = whencefmt % whenceargs
try:
# Both writes to the pipe are wrapped in try/except to ignore
# errors, as we can see mysterious errors in here if the pager
# is active. Presumably other conditions could trigger
# problems too.
try:
_pipe.write('START %s %s\n' % (_session, whence))
except IOError:
pass
yield
finally:
try:
_pipe.write('END %s %s\n' % (_session, whence))
except IOError:
pass