Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/scmposix.py @ 34647:dacfcdd8b94e
codemod: use pycompat.isdarwin
This is done by:
sed -i "s/pycompat\.sysplatform == 'darwin'/pycompat.isdarwin/" **/*.py
Plus a manual change to `sslutil.py` which involves indentation change that
cannot be done by `sed`.
Differential Revision: https://phab.mercurial-scm.org/D1035
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 12 Oct 2017 23:34:34 -0700 |
parents | d74b0cff94a9 |
children | 57875cf423c9 |
comparison
equal
deleted
inserted
replaced
34646:238abf65a8ad | 34647:dacfcdd8b94e |
---|---|
44 return path | 44 return path |
45 | 45 |
46 def userrcpath(): | 46 def userrcpath(): |
47 if pycompat.sysplatform == 'plan9': | 47 if pycompat.sysplatform == 'plan9': |
48 return [encoding.environ['home'] + '/lib/hgrc'] | 48 return [encoding.environ['home'] + '/lib/hgrc'] |
49 elif pycompat.sysplatform == 'darwin': | 49 elif pycompat.isdarwin: |
50 return [os.path.expanduser('~/.hgrc')] | 50 return [os.path.expanduser('~/.hgrc')] |
51 else: | 51 else: |
52 confighome = encoding.environ.get('XDG_CONFIG_HOME') | 52 confighome = encoding.environ.get('XDG_CONFIG_HOME') |
53 if confighome is None or not os.path.isabs(confighome): | 53 if confighome is None or not os.path.isabs(confighome): |
54 confighome = os.path.expanduser('~/.config') | 54 confighome = os.path.expanduser('~/.config') |