Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.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 | 238abf65a8ad |
children | be6aa0cff8ea |
comparison
equal
deleted
inserted
replaced
34646:238abf65a8ad | 34647:dacfcdd8b94e |
---|---|
1559 function if need.''' | 1559 function if need.''' |
1560 return path.split(pycompat.ossep) | 1560 return path.split(pycompat.ossep) |
1561 | 1561 |
1562 def gui(): | 1562 def gui(): |
1563 '''Are we running in a GUI?''' | 1563 '''Are we running in a GUI?''' |
1564 if pycompat.sysplatform == 'darwin': | 1564 if pycompat.isdarwin: |
1565 if 'SSH_CONNECTION' in encoding.environ: | 1565 if 'SSH_CONNECTION' in encoding.environ: |
1566 # handle SSH access to a box where the user is logged in | 1566 # handle SSH access to a box where the user is logged in |
1567 return False | 1567 return False |
1568 elif getattr(osutil, 'isgui', None): | 1568 elif getattr(osutil, 'isgui', None): |
1569 # check if a CoreGraphics session is available | 1569 # check if a CoreGraphics session is available |