equal
deleted
inserted
replaced
71 def narrowpats(self): |
71 def narrowpats(self): |
72 """matcher patterns for this repository's narrowspec |
72 """matcher patterns for this repository's narrowspec |
73 |
73 |
74 A tuple of (includes, excludes). |
74 A tuple of (includes, excludes). |
75 """ |
75 """ |
76 return narrowspec.load(self) |
76 source = self |
|
77 if self.shared(): |
|
78 source = hg.sharedreposource(self) |
|
79 return narrowspec.load(source) |
77 |
80 |
78 @localrepo.repofilecache(narrowspec.FILENAME) |
81 @localrepo.repofilecache(narrowspec.FILENAME) |
79 def _narrowmatch(self): |
82 def _narrowmatch(self): |
80 if changegroup.NARROW_REQUIREMENT not in self.requirements: |
83 if changegroup.NARROW_REQUIREMENT not in self.requirements: |
81 return matchmod.always(self.root, '') |
84 return matchmod.always(self.root, '') |
85 # TODO(martinvonz): make this property-like instead? |
88 # TODO(martinvonz): make this property-like instead? |
86 def narrowmatch(self): |
89 def narrowmatch(self): |
87 return self._narrowmatch |
90 return self._narrowmatch |
88 |
91 |
89 def setnarrowpats(self, newincludes, newexcludes): |
92 def setnarrowpats(self, newincludes, newexcludes): |
90 narrowspec.save(self, newincludes, newexcludes) |
93 target = self |
|
94 if self.shared(): |
|
95 target = hg.sharedreposource(self) |
|
96 narrowspec.save(target, newincludes, newexcludes) |
91 self.invalidate(clearfilecache=True) |
97 self.invalidate(clearfilecache=True) |
92 |
98 |
93 # I'm not sure this is the right place to do this filter. |
99 # I'm not sure this is the right place to do this filter. |
94 # context._manifestmatches() would probably be better, or perhaps |
100 # context._manifestmatches() would probably be better, or perhaps |
95 # move it to a later place, in case some of the callers do want to know |
101 # move it to a later place, in case some of the callers do want to know |