##// END OF EJS Templates
narrow: move wire proto capabilities to narrowwirepeer...
Martin von Zweigbergk -
r39565:e82da0fc default
parent child Browse files
Show More
@@ -32,7 +32,6 b' from mercurial.utils import ('
32 )
32 )
33
33
34 NARROWCAP = 'narrow'
34 NARROWCAP = 'narrow'
35 ELLIPSESCAP = 'ellipses'
36 _NARROWACL_SECTION = 'narrowhgacl'
35 _NARROWACL_SECTION = 'narrowhgacl'
37 _CHANGESPECPART = NARROWCAP + ':changespec'
36 _CHANGESPECPART = NARROWCAP + ':changespec'
38 _SPECPART = NARROWCAP + ':spec'
37 _SPECPART = NARROWCAP + ':spec'
@@ -32,7 +32,7 b' from mercurial import ('
32 )
32 )
33
33
34 from . import (
34 from . import (
35 narrowbundle2,
35 narrowwirepeer,
36 )
36 )
37
37
38 table = {}
38 table = {}
@@ -171,7 +171,7 b' def pullbundle2extraprepare(orig, pullop'
171 if repository.NARROW_REQUIREMENT not in repo.requirements:
171 if repository.NARROW_REQUIREMENT not in repo.requirements:
172 return orig(pullop, kwargs)
172 return orig(pullop, kwargs)
173
173
174 if narrowbundle2.NARROWCAP not in pullop.remote.capabilities():
174 if narrowwirepeer.NARROWCAP not in pullop.remote.capabilities():
175 raise error.Abort(_("server doesn't support narrow clones"))
175 raise error.Abort(_("server doesn't support narrow clones"))
176 orig(pullop, kwargs)
176 orig(pullop, kwargs)
177 kwargs['narrow'] = True
177 kwargs['narrow'] = True
@@ -182,7 +182,7 b' def pullbundle2extraprepare(orig, pullop'
182 kwargs['excludepats'] = exclude
182 kwargs['excludepats'] = exclude
183 # calculate known nodes only in ellipses cases because in non-ellipses cases
183 # calculate known nodes only in ellipses cases because in non-ellipses cases
184 # we have all the nodes
184 # we have all the nodes
185 if narrowbundle2.ELLIPSESCAP in pullop.remote.capabilities():
185 if narrowwirepeer.ELLIPSESCAP in pullop.remote.capabilities():
186 kwargs['known'] = [node.hex(ctx.node()) for ctx in
186 kwargs['known'] = [node.hex(ctx.node()) for ctx in
187 repo.set('::%ln', pullop.common)
187 repo.set('::%ln', pullop.common)
188 if ctx.node() != node.nullid]
188 if ctx.node() != node.nullid]
@@ -8,9 +8,9 b''
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from . import (
10 from . import (
11 narrowbundle2,
12 narrowdirstate,
11 narrowdirstate,
13 narrowrevlog,
12 narrowrevlog,
13 narrowwirepeer,
14 )
14 )
15
15
16 def wraprepo(repo):
16 def wraprepo(repo):
@@ -29,8 +29,8 b' def wraprepo(repo):'
29
29
30 def peer(self):
30 def peer(self):
31 peer = super(narrowrepository, self).peer()
31 peer = super(narrowrepository, self).peer()
32 peer._caps.add(narrowbundle2.NARROWCAP)
32 peer._caps.add(narrowwirepeer.NARROWCAP)
33 peer._caps.add(narrowbundle2.ELLIPSESCAP)
33 peer._caps.add(narrowwirepeer.ELLIPSESCAP)
34 return peer
34 return peer
35
35
36 repo.__class__ = narrowrepository
36 repo.__class__ = narrowrepository
@@ -17,7 +17,8 b' from mercurial import ('
17 wireprotov1server,
17 wireprotov1server,
18 )
18 )
19
19
20 from . import narrowbundle2
20 NARROWCAP = 'narrow'
21 ELLIPSESCAP = 'ellipses'
21
22
22 def uisetup():
23 def uisetup():
23 def peersetup(ui, peer):
24 def peersetup(ui, peer):
@@ -46,9 +47,9 b' def uisetup():'
46 def addnarrowcap(orig, repo, proto):
47 def addnarrowcap(orig, repo, proto):
47 """add the narrow capability to the server"""
48 """add the narrow capability to the server"""
48 caps = orig(repo, proto)
49 caps = orig(repo, proto)
49 caps.append(narrowbundle2.NARROWCAP)
50 caps.append(NARROWCAP)
50 if repo.ui.configbool('experimental', 'narrowservebrokenellipses'):
51 if repo.ui.configbool('experimental', 'narrowservebrokenellipses'):
51 caps.append(narrowbundle2.ELLIPSESCAP)
52 caps.append(ELLIPSESCAP)
52 return caps
53 return caps
53
54
54 def reposetup(repo):
55 def reposetup(repo):
General Comments 0
You need to be logged in to leave comments. Login now