Skip to content
Snippets Groups Projects
Commit 6aae8697 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

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
parent 2d82a24d
Branches
Tags
No related merge requests found
......@@ -72,4 +72,5 @@
if not isinstance(repo, localrepo.localrepository):
return
narrowrepo.wraprepo(repo)
if changegroup.NARROW_REQUIREMENT in repo.requirements:
......@@ -75,5 +76,4 @@
if changegroup.NARROW_REQUIREMENT in repo.requirements:
narrowrepo.wraprepo(repo)
narrowcopies.setup(repo)
narrowdirstate.setup(repo)
narrowpatch.setup(repo)
......
......@@ -30,7 +30,6 @@
from . import (
narrowbundle2,
narrowrepo,
)
table = {}
......@@ -101,10 +100,6 @@
'_pullbundle2extraprepare', pullbundle2extraprepare_widen)
def pullnarrow(orig, repo, *args, **kwargs):
narrowrepo.wraprepo(repo.unfiltered())
if isinstance(repo, repoview.repoview):
repo.__class__.__bases__ = (repo.__class__.__bases__[0],
repo.unfiltered().__class__)
if opts_narrow:
repo.requirements.add(changegroup.NARROW_REQUIREMENT)
repo._writerequirements()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment