##// END OF EJS Templates
packaging: support building WiX installers with PyOxidizer...
packaging: support building WiX installers with PyOxidizer We initially implemented PyOxidizer support for Inno installers. That did most of the heavy work of integrating PyOxidizer into the packaging system. Implementing WiX installer support was pretty straightforward. Aspects of this patch look very similar to Inno's. The main difference is the handling of the Visual C++ Redistributable Runtime files. The WiX installer was formerly using merge modules to install the VC++ 9.0 runtime because this feature is supported by the WiX installer (it isn't easily available to Inno installers). Our strategy for the runtime files is to install the vcruntime140.dll file next to hg.exe just like any other file. While we could leverage WiX's functionality for invoking a VCRedist installer, I don't want to deal with the complexity at this juncture. So, we let run_pyoxidizer() copy vcruntime140.dll into the staging directory (like it does for Inno) and our dynamic WiX XML generator picks it up as a regular file and installs it. We did, however, have to teach mercurial.wxs how to conditionally use the merge modules. But this was rather straightforward. Comparing the file layout of the WiX installers before and after: * Various lib/*.{pyd, dll} files no longer exist * python27.dll was replaced by python37.dll * vcruntime140.dll was added All these changes are expected due to the transition to Python 3 and to PyOxidizer, which embeded the .pyd and .dll files in hg.exe. Differential Revision: https://phab.mercurial-scm.org/D8477

File last commit:

r43350:86e4daa2 default
r45274:234882d1 stable
Show More
debugshell.py
65 lines | 1.5 KiB | text/x-python | PythonLexer
Vishakh H
contrib: add debugshell extension
r11633 # debugshell extension
"""a python shell with repo, changelog & manifest objects"""
Pulkit Goyal
debugshell: use absolute_import
r28476 from __future__ import absolute_import
import code
Vishakh H
contrib: add debugshell extension
r11633 import mercurial
Pulkit Goyal
debugshell: use absolute_import
r28476 import sys
Gregory Szorc
debugshell: disable demand importer when importing debugger...
r27721 from mercurial import (
demandimport,
Pulkit Goyal
py3: make contrib/debugshell.py work with Python 3...
r41980 pycompat,
Yuya Nishihara
registrar: move cmdutil.command to registrar module (API)...
r32337 registrar,
Gregory Szorc
debugshell: disable demand importer when importing debugger...
r27721 )
Gregory Szorc
debugshell: declare command using decorator
r21243
cmdtable = {}
Yuya Nishihara
registrar: move cmdutil.command to registrar module (API)...
r32337 command = registrar.command(cmdtable)
Vishakh H
contrib: add debugshell extension
r11633
Augie Fackler
formatting: blacken the codebase...
r43346
Sean Farley
debugshell: abstract out pdb code.interact
r19771 def pdb(ui, repo, msg, **opts):
Vishakh H
contrib: add debugshell extension
r11633 objects = {
'mercurial': mercurial,
'repo': repo,
'cl': repo.changelog,
Durham Goode
manifest: remove last uses of repo.manifest...
r30375 'mf': repo.manifestlog,
Vishakh H
contrib: add debugshell extension
r11633 }
Sean Farley
debugshell: abstract out pdb code.interact
r19771
code.interact(msg, local=objects)
Augie Fackler
formatting: blacken the codebase...
r43346
Sean Farley
debugshell: add function to embed ipython
r19772 def ipdb(ui, repo, msg, **opts):
import IPython
cl = repo.changelog
Durham Goode
manifest: remove last uses of repo.manifest...
r30375 mf = repo.manifestlog
Augie Fackler
formatting: blacken the codebase...
r43346 cl, mf # use variables to appease pyflakes
Sean Farley
debugshell: add function to embed ipython
r19772
IPython.embed()
Augie Fackler
formatting: blacken the codebase...
r43346
Pulkit Goyal
py3: make contrib/debugshell.py work with Python 3...
r41980 @command(b'debugshell|dbsh', [])
Sean Farley
debugshell: abstract out pdb code.interact
r19771 def debugshell(ui, repo, **opts):
Augie Fackler
formatting: blacken the codebase...
r43346 bannermsg = "loaded repo : %s\n" "using source: %s" % (
pycompat.sysstr(repo.root),
mercurial.__path__[0],
)
Sean Farley
debugshell: abstract out pdb code.interact
r19771
Augie Fackler
formatting: blacken the codebase...
r43346 pdbmap = {'pdb': 'code', 'ipdb': 'IPython'}
Sean Farley
debugshell: check ui.debugger for which debugger to use
r19773
Pulkit Goyal
py3: make contrib/debugshell.py work with Python 3...
r41980 debugger = ui.config(b"ui", b"debugger")
Sean Farley
debugshell: check ui.debugger for which debugger to use
r19773 if not debugger:
debugger = 'pdb'
Pulkit Goyal
py3: make contrib/debugshell.py work with Python 3...
r41980 else:
debugger = pycompat.sysstr(debugger)
Sean Farley
debugshell: check ui.debugger for which debugger to use
r19773
# if IPython doesn't exist, fallback to code.interact
try:
Gregory Szorc
debugshell: disable demand importer when importing debugger...
r27721 with demandimport.deactivated():
__import__(pdbmap[debugger])
Sean Farley
debugshell: check ui.debugger for which debugger to use
r19773 except ImportError:
Augie Fackler
cleanup: mark some ui.(status|note|warn|write) calls as not needing i18n...
r43350 ui.warnnoi18n(
Augie Fackler
formatting: blacken the codebase...
r43346 b"%s debugger specified but %s module was not found\n"
% (debugger, pdbmap[debugger])
)
Pulkit Goyal
py3: make contrib/debugshell.py work with Python 3...
r41980 debugger = b'pdb'
Sean Farley
debugshell: check ui.debugger for which debugger to use
r19773
getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts)