Show More
@@ -50,11 +50,6 b' def wraprepo(repo):' | |||
|
50 | 50 | |
|
51 | 51 | class narrowrepository(repo.__class__): |
|
52 | 52 | |
|
53 | def _constructmanifest(self): | |
|
54 | manifest = super(narrowrepository, self)._constructmanifest() | |
|
55 | narrowrevlog.makenarrowmanifestrevlog(manifest, repo) | |
|
56 | return manifest | |
|
57 | ||
|
58 | 53 | @cacheprop('00manifest.i') |
|
59 | 54 | def manifestlog(self): |
|
60 | 55 | mfl = super(narrowrepository, self).manifestlog |
@@ -30,24 +30,6 b' def setup():' | |||
|
30 | 30 | # load time. |
|
31 | 31 | pass |
|
32 | 32 | |
|
33 | def makenarrowmanifestrevlog(mfrevlog, repo): | |
|
34 | if util.safehasattr(mfrevlog, '_narrowed'): | |
|
35 | return | |
|
36 | ||
|
37 | class narrowmanifestrevlog(mfrevlog.__class__): | |
|
38 | # This function is called via debug{revlog,index,data}, but also during | |
|
39 | # at least some push operations. This will be used to wrap/exclude the | |
|
40 | # child directories when using treemanifests. | |
|
41 | def dirlog(self, d): | |
|
42 | if not repo.narrowmatch().visitdir(d[:-1] or '.'): | |
|
43 | return manifest.excludedmanifestrevlog(d) | |
|
44 | result = super(narrowmanifestrevlog, self).dirlog(d) | |
|
45 | makenarrowmanifestrevlog(result, repo) | |
|
46 | return result | |
|
47 | ||
|
48 | mfrevlog.__class__ = narrowmanifestrevlog | |
|
49 | mfrevlog._narrowed = True | |
|
50 | ||
|
51 | 33 | def makenarrowmanifestlog(mfl, repo): |
|
52 | 34 | class narrowmanifestlog(mfl.__class__): |
|
53 | 35 | def get(self, dir, node, verify=True): |
@@ -1279,6 +1279,7 b' class manifestlog(object):' | |||
|
1279 | 1279 | self._treeinmem = usetreemanifest |
|
1280 | 1280 | |
|
1281 | 1281 | self._revlog = repo._constructmanifest() |
|
1282 | self._narrowmatch = repo.narrowmatch() | |
|
1282 | 1283 | |
|
1283 | 1284 | # A cache of the manifestctx or treemanifestctx for each directory |
|
1284 | 1285 | self._dirmancache = {} |
@@ -1477,6 +1478,10 b' class treemanifestctx(object):' | |||
|
1477 | 1478 | #self.linkrev = revlog.linkrev(rev) |
|
1478 | 1479 | |
|
1479 | 1480 | def _revlog(self): |
|
1481 | narrowmatch = self._manifestlog._narrowmatch | |
|
1482 | if not narrowmatch.always(): | |
|
1483 | if not narrowmatch.visitdir(self._dir[:-1] or '.'): | |
|
1484 | return excludedmanifestrevlog(self._dir) | |
|
1480 | 1485 | return self._manifestlog._revlog.dirlog(self._dir) |
|
1481 | 1486 | |
|
1482 | 1487 | def read(self): |
General Comments 0
You need to be logged in to leave comments.
Login now