hgext/infinitepush/fileindexapi.py
changeset 37204 0d6c12668691
parent 37187 03ff17a4bf53
child 37811 51dee6fad783
equal deleted inserted replaced
37203:f083e7fd6313 37204:0d6c12668691
    13 
    13 
    14 from __future__ import absolute_import
    14 from __future__ import absolute_import
    15 
    15 
    16 import os
    16 import os
    17 
    17 
    18 from mercurial import util
    18 from mercurial.utils import stringutil
    19 
    19 
    20 from . import indexapi
    20 from . import indexapi
    21 
    21 
    22 class fileindexapi(indexapi.indexapi):
    22 class fileindexapi(indexapi.indexapi):
    23     def __init__(self, repo):
    23     def __init__(self, repo):
    75         vfs.write(os.path.join(self._metadatamap, node), jsonmetadata)
    75         vfs.write(os.path.join(self._metadatamap, node), jsonmetadata)
    76 
    76 
    77     def _listbookmarks(self, pattern):
    77     def _listbookmarks(self, pattern):
    78         if pattern.endswith('*'):
    78         if pattern.endswith('*'):
    79             pattern = 're:^' + pattern[:-1] + '.*'
    79             pattern = 're:^' + pattern[:-1] + '.*'
    80         kind, pat, matcher = util.stringmatcher(pattern)
    80         kind, pat, matcher = stringutil.stringmatcher(pattern)
    81         prefixlen = len(self._bookmarkmap) + 1
    81         prefixlen = len(self._bookmarkmap) + 1
    82         for dirpath, _, books in self._repo.vfs.walk(self._bookmarkmap):
    82         for dirpath, _, books in self._repo.vfs.walk(self._bookmarkmap):
    83             for book in books:
    83             for book in books:
    84                 bookmark = os.path.join(dirpath, book)[prefixlen:]
    84                 bookmark = os.path.join(dirpath, book)[prefixlen:]
    85                 if not matcher(bookmark):
    85                 if not matcher(bookmark):