comparison hgext/narrow/narrowrepo.py @ 39933:d5498db5f86a

narrow: move the wireprotocol narrow capability name to core We are trying to integrate the whole of narrow logic into core and it will be helpful for upcoming patches to have these capability names in core. The next patch will move the ellipses capability to core also. The exact motivation is to know whether we are cloning a ellipses repo or not and adding an ellipses repo requirement. Differential Revision: https://phab.mercurial-scm.org/D4808
author Pulkit Goyal <pulkit@yandex-team.ru>
date Sun, 30 Sep 2018 03:42:35 +0530
parents 9358f5066811
children a24f4638d6c1
comparison
equal deleted inserted replaced
39932:e743907d0932 39933:d5498db5f86a
4 # 4 #
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 7
8 from __future__ import absolute_import 8 from __future__ import absolute_import
9
10 from mercurial import (
11 wireprotoserver,
12 )
9 13
10 from . import ( 14 from . import (
11 narrowdirstate, 15 narrowdirstate,
12 narrowwirepeer, 16 narrowwirepeer,
13 ) 17 )
21 dirstate = super(narrowrepository, self)._makedirstate() 25 dirstate = super(narrowrepository, self)._makedirstate()
22 return narrowdirstate.wrapdirstate(self, dirstate) 26 return narrowdirstate.wrapdirstate(self, dirstate)
23 27
24 def peer(self): 28 def peer(self):
25 peer = super(narrowrepository, self).peer() 29 peer = super(narrowrepository, self).peer()
26 peer._caps.add(narrowwirepeer.NARROWCAP) 30 peer._caps.add(wireprotoserver.NARROWCAP)
27 peer._caps.add(narrowwirepeer.ELLIPSESCAP) 31 peer._caps.add(narrowwirepeer.ELLIPSESCAP)
28 return peer 32 return peer
29 33
30 repo.__class__ = narrowrepository 34 repo.__class__ = narrowrepository