##// 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:

r31958:de5c9d0e default
r42021:2dbdb9ab default
Show More
memory.py
31 lines | 1023 B | text/x-python | PythonLexer
# memory.py - track memory usage
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''helper extension to measure memory usage
Reads current and peak memory usage from ``/proc/self/status`` and
prints it to ``stderr`` on exit.
'''
from __future__ import absolute_import
def memusage(ui):
"""Report memory usage of the current process."""
result = {'peak': 0, 'rss': 0}
with open('/proc/self/status', 'r') as status:
# This will only work on systems with a /proc file system
# (like Linux).
for line in status:
parts = line.split()
key = parts[0][2:-1].lower()
if key in result:
result[key] = int(parts[1])
ui.write_err(", ".join(["%s: %.1f MiB" % (k, v / 1024.0)
for k, v in result.iteritems()]) + "\n")
def extsetup(ui):
ui.atexit(memusage, ui)