##// END OF EJS Templates
narrow: add narrow and ellipses as server capabilities...
Pulkit Goyal -
r39559:c9051404 default
parent child Browse files
Show More
@@ -32,6 +32,7 b' from mercurial.utils import ('
32 )
32 )
33
33
34 NARROWCAP = 'narrow'
34 NARROWCAP = 'narrow'
35 ELLIPSESCAP = 'ellipses'
35 _NARROWACL_SECTION = 'narrowhgacl'
36 _NARROWACL_SECTION = 'narrowhgacl'
36 _CHANGESPECPART = NARROWCAP + ':changespec'
37 _CHANGESPECPART = NARROWCAP + ':changespec'
37 _SPECPART = NARROWCAP + ':spec'
38 _SPECPART = NARROWCAP + ':spec'
@@ -14,8 +14,11 b' from mercurial import ('
14 hg,
14 hg,
15 narrowspec,
15 narrowspec,
16 node,
16 node,
17 wireprotov1server,
17 )
18 )
18
19
20 from . import narrowbundle2
21
19 def uisetup():
22 def uisetup():
20 def peersetup(ui, peer):
23 def peersetup(ui, peer):
21 # We must set up the expansion before reposetup below, since it's used
24 # We must set up the expansion before reposetup below, since it's used
@@ -38,6 +41,16 b' def uisetup():'
38 peer.__class__ = expandingpeer
41 peer.__class__ = expandingpeer
39 hg.wirepeersetupfuncs.append(peersetup)
42 hg.wirepeersetupfuncs.append(peersetup)
40
43
44 extensions.wrapfunction(wireprotov1server, '_capabilities', addnarrowcap)
45
46 def addnarrowcap(orig, repo, proto):
47 """add the narrow capability to the server"""
48 caps = orig(repo, proto)
49 caps.append(narrowbundle2.NARROWCAP)
50 if repo.ui.configbool('experimental', 'narrowservebrokenellipses'):
51 caps.append(narrowbundle2.ELLIPSESCAP)
52 return caps
53
41 def reposetup(repo):
54 def reposetup(repo):
42 def wirereposetup(ui, peer):
55 def wirereposetup(ui, peer):
43 def wrapped(orig, cmd, *args, **kwargs):
56 def wrapped(orig, cmd, *args, **kwargs):
@@ -33,6 +33,7 b' Verify that narrow is advertised in the '
33 $ echo hello | hg -R . serve --stdio | \
33 $ echo hello | hg -R . serve --stdio | \
34 > $PYTHON unquote.py | grep narrow
34 > $PYTHON unquote.py | grep narrow
35 narrow=v0
35 narrow=v0
36 rev-branch-cache changegroupsubset getbundle known lookup narrow protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
36
37
37 $ cd ..
38 $ cd ..
38
39
General Comments 0
You need to be logged in to leave comments. Login now