comparison hgext/schemes.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 46ba2cdda476
children e77cee5de1c7
comparison
equal deleted inserted replaced
34644:c0a6c19690ff 34645:75979c8d4572
114 114
115 def extsetup(ui): 115 def extsetup(ui):
116 schemes.update(dict(ui.configitems('schemes'))) 116 schemes.update(dict(ui.configitems('schemes')))
117 t = templater.engine(lambda x: x) 117 t = templater.engine(lambda x: x)
118 for scheme, url in schemes.items(): 118 for scheme, url in schemes.items():
119 if (pycompat.osname == 'nt' and len(scheme) == 1 and scheme.isalpha() 119 if (pycompat.iswindows and len(scheme) == 1 and scheme.isalpha()
120 and os.path.exists('%s:\\' % scheme)): 120 and os.path.exists('%s:\\' % scheme)):
121 raise error.Abort(_('custom scheme %s:// conflicts with drive ' 121 raise error.Abort(_('custom scheme %s:// conflicts with drive '
122 'letter %s:\\\n') % (scheme, scheme.upper())) 122 'letter %s:\\\n') % (scheme, scheme.upper()))
123 hg.schemes[scheme] = ShortRepository(url, scheme, t) 123 hg.schemes[scheme] = ShortRepository(url, scheme, t)
124 124