diff --git a/hgext/narrow/narrowcommands.py b/hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py +++ b/hgext/narrow/narrowcommands.py @@ -29,6 +29,7 @@ repoview, sparse, util, + wireprotoserver, ) from . import ( @@ -136,7 +137,7 @@ if repository.NARROW_REQUIREMENT not in repo.requirements: return orig(pullop, kwargs) - if narrowwirepeer.NARROWCAP not in pullop.remote.capabilities(): + if wireprotoserver.NARROWCAP not in pullop.remote.capabilities(): raise error.Abort(_("server doesn't support narrow clones")) orig(pullop, kwargs) kwargs['narrow'] = True diff --git a/hgext/narrow/narrowrepo.py b/hgext/narrow/narrowrepo.py --- a/hgext/narrow/narrowrepo.py +++ b/hgext/narrow/narrowrepo.py @@ -7,6 +7,10 @@ from __future__ import absolute_import +from mercurial import ( + wireprotoserver, +) + from . import ( narrowdirstate, narrowwirepeer, @@ -23,7 +27,7 @@ def peer(self): peer = super(narrowrepository, self).peer() - peer._caps.add(narrowwirepeer.NARROWCAP) + peer._caps.add(wireprotoserver.NARROWCAP) peer._caps.add(narrowwirepeer.ELLIPSESCAP) return peer diff --git a/hgext/narrow/narrowwirepeer.py b/hgext/narrow/narrowwirepeer.py --- a/hgext/narrow/narrowwirepeer.py +++ b/hgext/narrow/narrowwirepeer.py @@ -10,10 +10,10 @@ from mercurial import ( extensions, hg, + wireprotoserver, wireprotov1server, ) -NARROWCAP = 'exp-narrow-1' ELLIPSESCAP = 'exp-ellipses-1' def uisetup(): @@ -22,7 +22,7 @@ def addnarrowcap(orig, repo, proto): """add the narrow capability to the server""" caps = orig(repo, proto) - caps.append(NARROWCAP) + caps.append(wireprotoserver.NARROWCAP) if repo.ui.configbool('experimental', 'narrowservebrokenellipses'): caps.append(ELLIPSESCAP) return caps diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -38,6 +38,8 @@ HGTYPE2 = 'application/mercurial-0.2' HGERRTYPE = 'application/hg-error' +NARROWCAP = 'exp-narrow-1' + SSHV1 = wireprototypes.SSHV1 SSHV2 = wireprototypes.SSHV2