733 if not self._dirstatevalidatewarned: |
734 if not self._dirstatevalidatewarned: |
734 self._dirstatevalidatewarned = True |
735 self._dirstatevalidatewarned = True |
735 self.ui.warn(_("warning: ignoring unknown" |
736 self.ui.warn(_("warning: ignoring unknown" |
736 " working parent %s!\n") % short(node)) |
737 " working parent %s!\n") % short(node)) |
737 return nullid |
738 return nullid |
|
739 |
|
740 @repofilecache(narrowspec.FILENAME) |
|
741 def narrowpats(self): |
|
742 """matcher patterns for this repository's narrowspec |
|
743 |
|
744 A tuple of (includes, excludes). |
|
745 """ |
|
746 source = self |
|
747 if self.shared(): |
|
748 from . import hg |
|
749 source = hg.sharedreposource(self) |
|
750 return narrowspec.load(source) |
|
751 |
|
752 @repofilecache(narrowspec.FILENAME) |
|
753 def _narrowmatch(self): |
|
754 if changegroup.NARROW_REQUIREMENT not in self.requirements: |
|
755 return matchmod.always(self.root, '') |
|
756 include, exclude = self.narrowpats |
|
757 return narrowspec.match(self.root, include=include, exclude=exclude) |
|
758 |
|
759 # TODO(martinvonz): make this property-like instead? |
|
760 def narrowmatch(self): |
|
761 return self._narrowmatch |
|
762 |
|
763 def setnarrowpats(self, newincludes, newexcludes): |
|
764 target = self |
|
765 if self.shared(): |
|
766 from . import hg |
|
767 target = hg.sharedreposource(self) |
|
768 narrowspec.save(target, newincludes, newexcludes) |
|
769 self.invalidate(clearfilecache=True) |
738 |
770 |
739 def __getitem__(self, changeid): |
771 def __getitem__(self, changeid): |
740 if changeid is None: |
772 if changeid is None: |
741 return context.workingctx(self) |
773 return context.workingctx(self) |
742 if isinstance(changeid, slice): |
774 if isinstance(changeid, slice): |