comparison mercurial/extensions.py @ 38163:b39958d6b81b

extensions: remove strip_init=True from _disabledpaths() It's no longer used.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 03 May 2018 18:39:58 +0900
parents bdf344aea0ee
children 2c1d983872f6
comparison
equal deleted inserted replaced
38162:bdf344aea0ee 38163:b39958d6b81b
538 assert callable(fn) 538 assert callable(fn)
539 result.append(getattr(fn, '_unboundwrapper', fn)) 539 result.append(getattr(fn, '_unboundwrapper', fn))
540 fn = getattr(fn, '_origfunc', None) 540 fn = getattr(fn, '_origfunc', None)
541 return result 541 return result
542 542
543 def _disabledpaths(strip_init=False): 543 def _disabledpaths():
544 '''find paths of disabled extensions. returns a dict of {name: path} 544 '''find paths of disabled extensions. returns a dict of {name: path}'''
545 removes /__init__.py from packages if strip_init is True'''
546 import hgext 545 import hgext
547 extpath = os.path.dirname( 546 extpath = os.path.dirname(
548 os.path.abspath(pycompat.fsencode(hgext.__file__))) 547 os.path.abspath(pycompat.fsencode(hgext.__file__)))
549 try: # might not be a filesystem path 548 try: # might not be a filesystem path
550 files = os.listdir(extpath) 549 files = os.listdir(extpath)
559 else: 558 else:
560 name = e 559 name = e
561 path = os.path.join(extpath, e, '__init__.py') 560 path = os.path.join(extpath, e, '__init__.py')
562 if not os.path.exists(path): 561 if not os.path.exists(path):
563 continue 562 continue
564 if strip_init:
565 path = os.path.dirname(path)
566 if name in exts or name in _order or name == '__init__': 563 if name in exts or name in _order or name == '__init__':
567 continue 564 continue
568 exts[name] = path 565 exts[name] = path
569 for name, path in _disabledextensions.iteritems(): 566 for name, path in _disabledextensions.iteritems():
570 # If no path was provided for a disabled extension (e.g. "color=!"), 567 # If no path was provided for a disabled extension (e.g. "color=!"),