hgext/narrow/narrowrepo.py
changeset 36500 d851951b421c
parent 36496 a8b4d7673d8e
child 36501 c28b6d609c47
--- a/hgext/narrow/narrowrepo.py	Wed Feb 28 10:32:00 2018 -0800
+++ b/hgext/narrow/narrowrepo.py	Tue Feb 27 23:05:39 2018 -0800
@@ -73,7 +73,10 @@
 
             A tuple of (includes, excludes).
             """
-            return narrowspec.load(self)
+            source = self
+            if self.shared():
+                source = hg.sharedreposource(self)
+            return narrowspec.load(source)
 
         @localrepo.repofilecache(narrowspec.FILENAME)
         def _narrowmatch(self):
@@ -87,7 +90,10 @@
             return self._narrowmatch
 
         def setnarrowpats(self, newincludes, newexcludes):
-            narrowspec.save(self, newincludes, newexcludes)
+            target = self
+            if self.shared():
+                target = hg.sharedreposource(self)
+            narrowspec.save(target, newincludes, newexcludes)
             self.invalidate(clearfilecache=True)
 
         # I'm not sure this is the right place to do this filter.