##// END OF EJS Templates
util: adjust 'datapath' to be correct in a frozen OS X package...
util: adjust 'datapath' to be correct in a frozen OS X package Apparently unlike py2exe, py2app copies the Mercurial source tree as-is to a Contents/Resources subdirectory of an app bundle, and places its binary stub in Contents/MacOS. (The Windows install has the 'hgext' and 'mercurial' modules in 'lib/library.zip', while the help and templates subdirectories have been moved out of the mercurial directory to the root of the installation. I assume that the python code living in a zip file is why "py2exe doesn't support __file__".) Therefore, prior to this change, Mercurial in a frozen app bundle on OS X would go looking for help *.txt, templates and locale info in Contents/MacOS, where they don't exist. There are only a handful of places that test for frozen, and not all of them are wrong for OS X, so it seems wiser to handle them on a case by case basis, rather that try to change mainfrozen(). The remaining cases are: 1) util.hgexecutable() wrongly points to the bundled python executable, and affects $HG in util.system() launched processes (e.g. external hooks) 2) util.hgcmd() wrongly points to the bundled python executable, but it seems to only affect 'hg serve -d' 3) hook._pythonhook() may be OK, since I didn't see anything outrageous when printing sys.path from an internal hook. I'm not sure if this special case is needed on OS X though. 4) sslutil._plainapplepython() is OK, because sys.executable is not /usr/bin/python, nor is it in /System/Library/Frameworks

File last commit:

r25514:9b1a8ce1 default
r27764:dd0c5f4d default
Show More
map-cmdline.default
75 lines | 2.8 KiB | text/plain | TextLexer
# Base templates. Due to name clashes with existing keywords, we have
# to replace some keywords with 'lkeyword', for 'labelled keyword'
changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{summary}\n'
changeset_quiet = '{lnode}'
changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{lfiles}{lfile_copies_switch}{description}\n'
changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
# File templates
lfiles = '{if(files,
label("ui.note log.files",
"files: {files}\n"))}'
lfile_mods = '{if(file_mods,
label("ui.debug log.files",
"files: {file_mods}\n"))}'
lfile_adds = '{if(file_adds,
label("ui.debug log.files",
"files+: {file_adds}\n"))}'
lfile_dels = '{if(file_dels,
label("ui.debug log.files",
"files-: {file_dels}\n"))}'
lfile_copies_switch = '{if(file_copies_switch,
label("ui.note log.copies",
"copies: {file_copies_switch
% ' {name} ({source})'}\n"))}'
# General templates
cset = '{label("log.changeset changeset.{phase}",
"changeset: {rev}:{node|short}")}\n'
lphase = '{label("log.phase",
"phase: {phase}")}\n'
fullcset = '{label("log.changeset changeset.{phase}",
"changeset: {rev}:{node}")}\n'
parent = '{label("log.parent changeset.{phase}",
"parent: {rev}:{node|formatnode}")}\n'
lnode = '{label("log.node",
"{rev}:{node|short}")}\n'
manifest = '{label("ui.debug log.manifest",
"manifest: {rev}:{node}")}\n'
branch = '{label("log.branch",
"branch: {branch}")}\n'
tag = '{label("log.tag",
"tag: {tag}")}\n'
bookmark = '{label("log.bookmark",
"bookmark: {bookmark}")}\n'
user = '{label("log.user",
"user: {author}")}\n'
summary = '{if(desc|strip, "{label('log.summary',
'summary: {desc|firstline}')}\n")}'
ldate = '{label("log.date",
"date: {date|date}")}\n'
extra = '{label("ui.debug log.extra",
"extra: {key}={value|stringescape}")}\n'
description = '{if(desc|strip, "{label('ui.note log.description',
'description:')}
{label('ui.note log.description',
'{desc|strip}')}\n\n")}'
status = '{status} {path}\n{if(copy, " {copy}\n")}'