mercurial/extensions.py
changeset 12779 891ddf76b73e
parent 11521 3efadce5b346
child 13191 1aea66b71f4f
equal deleted inserted replaced
12778:dce09f82f619 12779:891ddf76b73e
    44     if name.startswith('hgext.') or name.startswith('hgext/'):
    44     if name.startswith('hgext.') or name.startswith('hgext/'):
    45         shortname = name[6:]
    45         shortname = name[6:]
    46     else:
    46     else:
    47         shortname = name
    47         shortname = name
    48     if shortname in _extensions:
    48     if shortname in _extensions:
    49         return
    49         return _extensions[shortname]
    50     _extensions[shortname] = None
    50     _extensions[shortname] = None
    51     if path:
    51     if path:
    52         # the module will be loaded in sys.modules
    52         # the module will be loaded in sys.modules
    53         # choose an unique name so that it doesn't
    53         # choose an unique name so that it doesn't
    54         # conflicts with other modules
    54         # conflicts with other modules
    64             mod = importh("hgext.%s" % name)
    64             mod = importh("hgext.%s" % name)
    65         except ImportError:
    65         except ImportError:
    66             mod = importh(name)
    66             mod = importh(name)
    67     _extensions[shortname] = mod
    67     _extensions[shortname] = mod
    68     _order.append(shortname)
    68     _order.append(shortname)
       
    69     return mod
    69 
    70 
    70 def loadall(ui):
    71 def loadall(ui):
    71     result = ui.configitems("extensions")
    72     result = ui.configitems("extensions")
    72     newindex = len(_order)
    73     newindex = len(_order)
    73     for (name, path) in result:
    74     for (name, path) in result: