diff hgext/narrow/__init__.py @ 36468:6aae86976324

narrow: always wrap repo It's simpler to always wrap the repo. This prepares for moving narrowrepo.narrowmatch() onto localrepo by showing that it's now safe to always wrap the repo (and thus always define narrowmatch() etc.). Note that since narrowmatch() returns an always-matcher (rather than None) in non-narrow repos, this may mean a performance hit when the narrow extension is enabled because it adds a no-op filtering step in various places against the always-matcher. I'll restore some of that soon. Differential Revision: https://phab.mercurial-scm.org/D2491
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 28 Feb 2018 12:55:05 -0800
parents a8b4d7673d8e
children d0d5eef57fb0
line wrap: on
line diff
--- a/hgext/narrow/__init__.py	Wed Feb 28 10:29:04 2018 -0800
+++ b/hgext/narrow/__init__.py	Wed Feb 28 12:55:05 2018 -0800
@@ -72,8 +72,8 @@
     if not isinstance(repo, localrepo.localrepository):
         return
 
+    narrowrepo.wraprepo(repo)
     if changegroup.NARROW_REQUIREMENT in repo.requirements:
-        narrowrepo.wraprepo(repo)
         narrowcopies.setup(repo)
         narrowdirstate.setup(repo)
         narrowpatch.setup(repo)