diff mercurial/scmutil.py @ 34645:75979c8d4572

codemod: use pycompat.iswindows This is done by: sed -i "s/pycompat\.osname == 'nt'/pycompat.iswindows/" **/*.py sed -i "s/pycompat\.osname != 'nt'/not pycompat.iswindows/" **/*.py sed -i 's/pycompat.osname == "nt"/pycompat.iswindows/' **/*.py Differential Revision: https://phab.mercurial-scm.org/D1034
author Jun Wu <quark@fb.com>
date Thu, 12 Oct 2017 23:30:46 -0700
parents b799f11644d8
children eb586ed5d8ce
line wrap: on
line diff
--- a/mercurial/scmutil.py	Thu Oct 12 19:20:04 2017 -0700
+++ b/mercurial/scmutil.py	Thu Oct 12 23:30:46 2017 -0700
@@ -41,7 +41,7 @@
     vfs,
 )
 
-if pycompat.osname == 'nt':
+if pycompat.iswindows:
     from . import scmwindows as scmplatform
 else:
     from . import scmposix as scmplatform
@@ -291,7 +291,7 @@
     val = ui.config('ui', 'portablefilenames')
     lval = val.lower()
     bval = util.parsebool(val)
-    abort = pycompat.osname == 'nt' or lval == 'abort'
+    abort = pycompat.iswindows or lval == 'abort'
     warn = bval or lval == 'warn'
     if bval is None and not (warn or abort or lval == 'ignore'):
         raise error.ConfigError(