##// END OF EJS Templates
namespace: introduce logfmt to show l10n-ed messages for hg log correctly...
namespace: introduce logfmt to show l10n-ed messages for hg log correctly Before this patch, "_()" is used incorrectly for "tag:" and "bookmark:" fields. "changeset_printer()" looks up keys composed at runtime, and it prevents "xgettext" command from getting strings to be translated from source files. Then, *.po files merged with updated "hg.pot" lose msgids for "tag:" and "bookmark:". This patch introduces "logfmt" information into "namespace" to show l10n-ed messages "hg log" (or "changeset_printer()") correctly. For similarity to other namespaces, this patch specifies "logfmt" for "branches" namespace, even though it isn't needed (branch information is handled in "changeset_printer()" specially). To find related code paths out easily, this patch adds "i18n: column positioning ..." comment to the line composing "logfmt" by default, even though this line itself doesn't contain any strings to be translated.

File last commit:

r22583:23c995ed default
r23967:448bb32b stable
Show More
scmposix.py
33 lines | 902 B | text/x-python | PythonLexer
Kevin Bullock
scmutil: split platform-specific bits into their own modules...
r18690 import sys, os
import osutil
def _rcfiles(path):
rcs = [os.path.join(path, 'hgrc')]
rcdir = os.path.join(path, 'hgrc.d')
try:
rcs.extend([os.path.join(rcdir, f)
for f, kind in osutil.listdir(rcdir)
if f.endswith(".rc")])
except OSError:
pass
return rcs
def systemrcpath():
path = []
if sys.platform == 'plan9':
root = 'lib/mercurial'
else:
root = 'etc/mercurial'
# old mod_python does not set sys.argv
if len(getattr(sys, 'argv', [])) > 0:
p = os.path.dirname(os.path.dirname(sys.argv[0]))
Mads Kiilerich
config: don't read the same config file twice...
r22583 if p != '/':
path.extend(_rcfiles(os.path.join(p, root)))
Kevin Bullock
scmutil: split platform-specific bits into their own modules...
r18690 path.extend(_rcfiles('/' + root))
return path
def userrcpath():
if sys.platform == 'plan9':
return [os.environ['home'] + '/lib/hgrc']
else:
return [os.path.expanduser('~/.hgrc')]