mercurial/templatekw.py
changeset 47032 6ce1af5f0764
parent 47012 d55b71393907
child 47033 824ee4aaa09b
equal deleted inserted replaced
47031:820fe29d0fd8 47032:6ce1af5f0764
    25     registrar,
    25     registrar,
    26     scmutil,
    26     scmutil,
    27     templateutil,
    27     templateutil,
    28     util,
    28     util,
    29 )
    29 )
    30 from .utils import stringutil
    30 from .utils import (
       
    31     stringutil,
       
    32     urlutil,
       
    33 )
    31 
    34 
    32 _hybrid = templateutil.hybrid
    35 _hybrid = templateutil.hybrid
    33 hybriddict = templateutil.hybriddict
    36 hybriddict = templateutil.hybriddict
    34 hybridlist = templateutil.hybridlist
    37 hybridlist = templateutil.hybridlist
    35 compatdict = templateutil.compatdict
    38 compatdict = templateutil.compatdict
   658     """A dictionary of repository locations defined in the [paths] section
   661     """A dictionary of repository locations defined in the [paths] section
   659     of your configuration file."""
   662     of your configuration file."""
   660     repo = context.resource(mapping, b'repo')
   663     repo = context.resource(mapping, b'repo')
   661     # see commands.paths() for naming of dictionary keys
   664     # see commands.paths() for naming of dictionary keys
   662     paths = repo.ui.paths
   665     paths = repo.ui.paths
   663     urls = util.sortdict(
   666     all_paths = urlutil.list_paths(repo.ui)
   664         (k, p.rawloc) for k, p in sorted(pycompat.iteritems(paths))
   667     urls = util.sortdict((k, p.rawloc) for k, p in all_paths)
   665     )
       
   666 
   668 
   667     def makemap(k):
   669     def makemap(k):
   668         p = paths[k]
   670         p = paths[k]
   669         d = {b'name': k, b'url': p.rawloc}
   671         d = {b'name': k, b'url': p.rawloc}
   670         d.update((o, v) for o, v in sorted(pycompat.iteritems(p.suboptions)))
   672         d.update((o, v) for o, v in sorted(pycompat.iteritems(p.suboptions)))