##// END OF EJS Templates
sparse: move profile reading into core...
Gregory Szorc -
r33298:f41a99c4 default
parent child Browse files
Show More
@@ -431,7 +431,7 b' def _wraprepo(ui, repo):'
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 "
@@ -455,11 +455,6 b' def _wraprepo(ui, repo):'
455 includes.add('.hg*')
455 includes.add('.hg*')
456 return includes, excludes, profiles
456 return includes, excludes, profiles
457
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
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()
@@ -46,3 +46,10 b' def parseconfig(ui, raw):'
46 current.add(line)
46 current.add(line)
47
47
48 return includes, excludes, profiles
48 return includes, excludes, profiles
49
50 # Exists as separate function to facilitate monkeypatching.
51 def readprofile(repo, profile, changeid):
52 """Resolve the raw content of a sparse profile file."""
53 # TODO add some kind of cache here because this incurs a manifest
54 # resolve and can be slow.
55 return repo.filectx(profile, changeid=changeid).data()
General Comments 0
You need to be logged in to leave comments. Login now