hgext/schemes.py
changeset 34645 75979c8d4572
parent 32337 46ba2cdda476
child 36668 e77cee5de1c7
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