mercurial/manifest.py
changeset 31876 94c1d3c1aea2
parent 31787 6bfea18df609
child 32171 fb9b6bfb54b5
equal deleted inserted replaced
31875:b6d792a9bd11 31876:94c1d3c1aea2
  1153             subp2 = m2._dirs.get(d, emptytree)._node
  1153             subp2 = m2._dirs.get(d, emptytree)._node
  1154             if subp1 == revlog.nullid:
  1154             if subp1 == revlog.nullid:
  1155                 subp1, subp2 = subp2, subp1
  1155                 subp1, subp2 = subp2, subp1
  1156             writesubtree(subm, subp1, subp2)
  1156             writesubtree(subm, subp1, subp2)
  1157 
  1157 
       
  1158     def walksubtrees(self, matcher=None):
       
  1159         """Returns an iterator of the subtrees of this manifest, including this
       
  1160         manifest itself.
       
  1161 
       
  1162         If `matcher` is provided, it only returns subtrees that match.
       
  1163         """
       
  1164         if matcher and not matcher.visitdir(self._dir[:-1] or '.'):
       
  1165             return
       
  1166         if not matcher or matcher(self._dir[:-1]):
       
  1167             yield self
       
  1168 
       
  1169         self._load()
       
  1170         for d, subm in self._dirs.iteritems():
       
  1171             for subtree in subm.walksubtrees(matcher=matcher):
       
  1172                 yield subtree
       
  1173 
  1158 class manifestrevlog(revlog.revlog):
  1174 class manifestrevlog(revlog.revlog):
  1159     '''A revlog that stores manifest texts. This is responsible for caching the
  1175     '''A revlog that stores manifest texts. This is responsible for caching the
  1160     full-text manifest contents.
  1176     full-text manifest contents.
  1161     '''
  1177     '''
  1162     def __init__(self, opener, dir='', dirlogcache=None, indexfile=None):
  1178     def __init__(self, opener, dir='', dirlogcache=None, indexfile=None):