mercurial/hgweb/hgweb_mod.py
branchstable
changeset 18515 bf8bbbf4aa45
parent 18429 e9ea0f0f05e7
child 18521 0af2fe7b3274
equal deleted inserted replaced
18514:2a1fac3650a5 18515:bf8bbbf4aa45
    22     'listkeys': 'pull',
    22     'listkeys': 'pull',
    23     'unbundle': 'push',
    23     'unbundle': 'push',
    24     'pushkey': 'push',
    24     'pushkey': 'push',
    25 }
    25 }
    26 
    26 
    27 def makebreadcrumb(url):
    27 def makebreadcrumb(url, prefix=''):
    28     '''Return a 'URL breadcrumb' list
    28     '''Return a 'URL breadcrumb' list
    29 
    29 
    30     A 'URL breadcrumb' is a list of URL-name pairs,
    30     A 'URL breadcrumb' is a list of URL-name pairs,
    31     corresponding to each of the path items on a URL.
    31     corresponding to each of the path items on a URL.
    32     This can be used to create path navigation entries.
    32     This can be used to create path navigation entries.
    33     '''
    33     '''
    34     if url.endswith('/'):
    34     if url.endswith('/'):
    35         url = url[:-1]
    35         url = url[:-1]
       
    36     if prefix:
       
    37         url = '/' + prefix + url
    36     relpath = url
    38     relpath = url
    37     if relpath.startswith('/'):
    39     if relpath.startswith('/'):
    38         relpath = relpath[1:]
    40         relpath = relpath[1:]
    39 
    41 
    40     breadcrumb = []
    42     breadcrumb = []