changeset 36499:28c7f580360b

narrow: reduce depedence on narrowspec.save() I think narrowspec should be a simple, low-level module and not depend on the hg module. This prepares for moving that dependency out of narrowspec. Differential Revision: https://phab.mercurial-scm.org/D2492
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 28 Feb 2018 10:32:00 -0800
parents 6aae86976324
children d851951b421c
files hgext/narrow/narrowbundle2.py hgext/narrow/narrowcommands.py
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/narrow/narrowbundle2.py	Wed Feb 28 12:55:05 2018 -0800
+++ b/hgext/narrow/narrowbundle2.py	Wed Feb 28 10:32:00 2018 -0800
@@ -361,11 +361,10 @@
 def _handlechangespec_2(op, inpart):
     includepats = set(inpart.params.get(_SPECPART_INCLUDE, '').splitlines())
     excludepats = set(inpart.params.get(_SPECPART_EXCLUDE, '').splitlines())
-    narrowspec.save(op.repo, includepats, excludepats)
     if not changegroup.NARROW_REQUIREMENT in op.repo.requirements:
         op.repo.requirements.add(changegroup.NARROW_REQUIREMENT)
         op.repo._writerequirements()
-    op.repo.invalidate(clearfilecache=True)
+    op.repo.setnarrowpats(includepats, excludepats)
 
 @bundle2.parthandler(_CHANGESPECPART)
 def _handlechangespec(op, inpart):
--- a/hgext/narrow/narrowcommands.py	Wed Feb 28 12:55:05 2018 -0800
+++ b/hgext/narrow/narrowcommands.py	Wed Feb 28 10:32:00 2018 -0800
@@ -88,7 +88,7 @@
                 # everything, except what they asked to exclude.
                 includepats = {'path:.'}
 
-            narrowspec.save(pullop.repo, includepats, excludepats)
+            pullop.repo.setnarrowpats(includepats, excludepats)
 
             # This will populate 'includepats' etc with the values from the
             # narrowspec we just saved.