Show More
@@ -107,10 +107,15 b' command.' | |||||
107 | from __future__ import absolute_import |
|
107 | from __future__ import absolute_import | |
108 |
|
108 | |||
109 | from mercurial import ( |
|
109 | from mercurial import ( | |
|
110 | cmdutil, | |||
110 | configitems, |
|
111 | configitems, | |
|
112 | extensions, | |||
111 | exthelper, |
|
113 | exthelper, | |
112 | hg, |
|
114 | hg, | |
|
115 | httppeer, | |||
113 | localrepo, |
|
116 | localrepo, | |
|
117 | sshpeer, | |||
|
118 | wireprotov1server, | |||
114 | ) |
|
119 | ) | |
115 |
|
120 | |||
116 | from . import ( |
|
121 | from . import ( | |
@@ -118,7 +123,6 b' from . import (' | |||||
118 | overrides, |
|
123 | overrides, | |
119 | proto, |
|
124 | proto, | |
120 | reposetup, |
|
125 | reposetup, | |
121 | uisetup as uisetupmod, |
|
|||
122 | ) |
|
126 | ) | |
123 |
|
127 | |||
124 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
|
128 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | |
@@ -156,6 +160,36 b' def featuresetup(ui, supported):' | |||||
156 | def _uisetup(ui): |
|
160 | def _uisetup(ui): | |
157 | localrepo.featuresetupfuncs.add(featuresetup) |
|
161 | localrepo.featuresetupfuncs.add(featuresetup) | |
158 | hg.wirepeersetupfuncs.append(proto.wirereposetup) |
|
162 | hg.wirepeersetupfuncs.append(proto.wirereposetup) | |
159 | uisetupmod.uisetup(ui) |
|
163 | ||
|
164 | cmdutil.outgoinghooks.add('largefiles', overrides.outgoinghook) | |||
|
165 | cmdutil.summaryremotehooks.add('largefiles', overrides.summaryremotehook) | |||
|
166 | ||||
|
167 | # create the new wireproto commands ... | |||
|
168 | wireprotov1server.wireprotocommand('putlfile', 'sha', permission='push')( | |||
|
169 | proto.putlfile) | |||
|
170 | wireprotov1server.wireprotocommand('getlfile', 'sha', permission='pull')( | |||
|
171 | proto.getlfile) | |||
|
172 | wireprotov1server.wireprotocommand('statlfile', 'sha', permission='pull')( | |||
|
173 | proto.statlfile) | |||
|
174 | wireprotov1server.wireprotocommand('lheads', '', permission='pull')( | |||
|
175 | wireprotov1server.heads) | |||
|
176 | ||||
|
177 | extensions.wrapfunction(wireprotov1server.commands['heads'], 'func', | |||
|
178 | proto.heads) | |||
|
179 | # TODO also wrap wireproto.commandsv2 once heads is implemented there. | |||
|
180 | ||||
|
181 | # can't do this in reposetup because it needs to have happened before | |||
|
182 | # wirerepo.__init__ is called | |||
|
183 | proto.ssholdcallstream = sshpeer.sshv1peer._callstream | |||
|
184 | proto.httpoldcallstream = httppeer.httppeer._callstream | |||
|
185 | sshpeer.sshv1peer._callstream = proto.sshrepocallstream | |||
|
186 | httppeer.httppeer._callstream = proto.httprepocallstream | |||
|
187 | ||||
|
188 | # override some extensions' stuff as well | |||
|
189 | for name, module in extensions.extensions(): | |||
|
190 | if name == 'rebase': | |||
|
191 | # TODO: teach exthelper to handle this | |||
|
192 | extensions.wrapfunction(module, 'rebase', | |||
|
193 | overrides.overriderebase) | |||
160 |
|
194 | |||
161 | revsetpredicate = overrides.revsetpredicate |
|
195 | revsetpredicate = overrides.revsetpredicate |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now