hgext/sparse.py
changeset 33298 f41a99c45956
parent 33297 ba5d89774db6
child 33299 41448fc51510
equal deleted inserted replaced
33297:ba5d89774db6 33298:f41a99c45956
   429                     if profile in visited:
   429                     if profile in visited:
   430                         continue
   430                         continue
   431                     visited.add(profile)
   431                     visited.add(profile)
   432 
   432 
   433                     try:
   433                     try:
   434                         raw = self.getrawprofile(profile, rev)
   434                         raw = sparse.readprofile(self, profile, rev)
   435                     except error.ManifestLookupError:
   435                     except error.ManifestLookupError:
   436                         msg = (
   436                         msg = (
   437                             "warning: sparse profile '%s' not found "
   437                             "warning: sparse profile '%s' not found "
   438                             "in rev %s - ignoring it\n" % (profile, ctx))
   438                             "in rev %s - ignoring it\n" % (profile, ctx))
   439                         if self.ui.configbool(
   439                         if self.ui.configbool(
   452                 profiles = visited
   452                 profiles = visited
   453 
   453 
   454             if includes:
   454             if includes:
   455                 includes.add('.hg*')
   455                 includes.add('.hg*')
   456             return includes, excludes, profiles
   456             return includes, excludes, profiles
   457 
       
   458         def getrawprofile(self, profile, changeid):
       
   459             # TODO add some kind of cache here because this incurs a manifest
       
   460             # resolve and can be slow.
       
   461             return self.filectx(profile, changeid=changeid).data()
       
   462 
   457 
   463         def _sparsechecksum(self, path):
   458         def _sparsechecksum(self, path):
   464             data = self.vfs.read(path)
   459             data = self.vfs.read(path)
   465             return hashlib.sha1(data).hexdigest()
   460             return hashlib.sha1(data).hexdigest()
   466 
   461