bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
3224.5.6
by Andrew Bennetts
Don't import bzrlib.bundle in bzrlib.smart.request until it's needed. |
1 |
# iopyright (C) 2006, 2007 Canonical Ltd
|
2018.5.4
by Andrew Bennetts
Split smart server VFS logic out into a new file, and start using the command pattern in the SmartServerRequestHandler. |
2 |
#
|
3 |
# This program is free software; you can redistribute it and/or modify
|
|
4 |
# it under the terms of the GNU General Public License as published by
|
|
5 |
# the Free Software Foundation; either version 2 of the License, or
|
|
6 |
# (at your option) any later version.
|
|
7 |
#
|
|
8 |
# This program is distributed in the hope that it will be useful,
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
12 |
#
|
|
13 |
# You should have received a copy of the GNU General Public License
|
|
14 |
# along with this program; if not, write to the Free Software
|
|
15 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
16 |
||
2018.5.19
by Andrew Bennetts
Add docstrings to all the new modules, and a few other places. |
17 |
"""Basic server-side logic for dealing with requests."""
|
18 |
||
19 |
||
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
20 |
import tempfile |
21 |
||
2402.1.2
by Andrew Bennetts
Deal with review comments. |
22 |
from bzrlib import ( |
23 |
bzrdir, |
|
24 |
errors, |
|
25 |
registry, |
|
26 |
revision, |
|
27 |
)
|
|
3224.5.6
by Andrew Bennetts
Don't import bzrlib.bundle in bzrlib.smart.request until it's needed. |
28 |
from bzrlib.lazy_import import lazy_import |
29 |
lazy_import(globals(), """ |
|
30 |
from bzrlib.bundle import serializer
|
|
31 |
""") |
|
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
32 |
|
2018.5.4
by Andrew Bennetts
Split smart server VFS logic out into a new file, and start using the command pattern in the SmartServerRequestHandler. |
33 |
|
34 |
class SmartServerRequest(object): |
|
2402.1.2
by Andrew Bennetts
Deal with review comments. |
35 |
"""Base class for request handlers.""" |
2018.5.4
by Andrew Bennetts
Split smart server VFS logic out into a new file, and start using the command pattern in the SmartServerRequestHandler. |
36 |
|
37 |
def __init__(self, backing_transport): |
|
2402.1.2
by Andrew Bennetts
Deal with review comments. |
38 |
"""Constructor. |
39 |
||
40 |
:param backing_transport: the base transport to be used when performing
|
|
41 |
this request.
|
|
42 |
"""
|
|
2018.5.4
by Andrew Bennetts
Split smart server VFS logic out into a new file, and start using the command pattern in the SmartServerRequestHandler. |
43 |
self._backing_transport = backing_transport |
2018.5.5
by Andrew Bennetts
Pass body_bytes directly to SmartServerRequest.do_body |
44 |
|
2018.5.24
by Andrew Bennetts
Setting NO_SMART_VFS in environment will disable VFS methods in the smart server. (Robert Collins, John Arbash Meinel, Andrew Bennetts) |
45 |
def _check_enabled(self): |
46 |
"""Raises DisabledMethod if this method is disabled.""" |
|
47 |
pass
|
|
48 |
||
2018.5.19
by Andrew Bennetts
Add docstrings to all the new modules, and a few other places. |
49 |
def do(self, *args): |
2018.5.24
by Andrew Bennetts
Setting NO_SMART_VFS in environment will disable VFS methods in the smart server. (Robert Collins, John Arbash Meinel, Andrew Bennetts) |
50 |
"""Mandatory extension point for SmartServerRequest subclasses. |
51 |
|
|
52 |
Subclasses must implement this.
|
|
2018.5.19
by Andrew Bennetts
Add docstrings to all the new modules, and a few other places. |
53 |
|
54 |
This should return a SmartServerResponse if this command expects to
|
|
55 |
receive no body.
|
|
56 |
"""
|
|
2018.5.5
by Andrew Bennetts
Pass body_bytes directly to SmartServerRequest.do_body |
57 |
raise NotImplementedError(self.do) |
58 |
||
2018.5.24
by Andrew Bennetts
Setting NO_SMART_VFS in environment will disable VFS methods in the smart server. (Robert Collins, John Arbash Meinel, Andrew Bennetts) |
59 |
def execute(self, *args): |
60 |
"""Public entry point to execute this request. |
|
61 |
||
62 |
It will return a SmartServerResponse if the command does not expect a
|
|
63 |
body.
|
|
64 |
||
65 |
:param *args: the arguments of the request.
|
|
66 |
"""
|
|
67 |
self._check_enabled() |
|
68 |
return self.do(*args) |
|
69 |
||
2018.5.5
by Andrew Bennetts
Pass body_bytes directly to SmartServerRequest.do_body |
70 |
def do_body(self, body_bytes): |
2018.5.19
by Andrew Bennetts
Add docstrings to all the new modules, and a few other places. |
71 |
"""Called if the client sends a body with the request. |
3184.1.10
by Robert Collins
Change the smart server verb for Repository.stream_revisions_chunked to use SearchResults as the request mechanism for downloads. |
72 |
|
73 |
The do() method is still called, and must have returned None.
|
|
2018.5.19
by Andrew Bennetts
Add docstrings to all the new modules, and a few other places. |
74 |
|
75 |
Must return a SmartServerResponse.
|
|
76 |
"""
|
|
77 |
# TODO: if a client erroneously sends a request that shouldn't have a
|
|
78 |
# body, what to do? Probably SmartServerRequestHandler should catch
|
|
79 |
# this NotImplementedError and translate it into a 'bad request' error
|
|
80 |
# to send to the client.
|
|
2018.5.4
by Andrew Bennetts
Split smart server VFS logic out into a new file, and start using the command pattern in the SmartServerRequestHandler. |
81 |
raise NotImplementedError(self.do_body) |
82 |
||
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
83 |
|
2018.5.16
by Andrew Bennetts
Move SmartServerResponse to smart/request.py, untangling more import dependencies. |
84 |
class SmartServerResponse(object): |
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
85 |
"""A response to a client request. |
86 |
|
|
87 |
This base class should not be used. Instead use
|
|
88 |
SuccessfulSmartServerResponse and FailedSmartServerResponse as appropriate.
|
|
89 |
"""
|
|
2018.5.16
by Andrew Bennetts
Move SmartServerResponse to smart/request.py, untangling more import dependencies. |
90 |
|
2748.4.2
by Andrew Bennetts
Add protocol (version two) support for streaming bodies (using chunking) in responses. |
91 |
def __init__(self, args, body=None, body_stream=None): |
92 |
"""Constructor. |
|
93 |
||
94 |
:param args: tuple of response arguments.
|
|
95 |
:param body: string of a response body.
|
|
96 |
:param body_stream: iterable of bytestrings to be streamed to the
|
|
97 |
client.
|
|
98 |
"""
|
|
2018.5.16
by Andrew Bennetts
Move SmartServerResponse to smart/request.py, untangling more import dependencies. |
99 |
self.args = args |
2748.4.2
by Andrew Bennetts
Add protocol (version two) support for streaming bodies (using chunking) in responses. |
100 |
if body is not None and body_stream is not None: |
101 |
raise errors.BzrError( |
|
102 |
"'body' and 'body_stream' are mutually exclusive.") |
|
2018.5.16
by Andrew Bennetts
Move SmartServerResponse to smart/request.py, untangling more import dependencies. |
103 |
self.body = body |
2748.4.2
by Andrew Bennetts
Add protocol (version two) support for streaming bodies (using chunking) in responses. |
104 |
self.body_stream = body_stream |
2018.5.16
by Andrew Bennetts
Move SmartServerResponse to smart/request.py, untangling more import dependencies. |
105 |
|
2402.1.1
by Andrew Bennetts
Use the Command pattern for handling smart server commands. |
106 |
def __eq__(self, other): |
107 |
if other is None: |
|
108 |
return False |
|
2748.4.2
by Andrew Bennetts
Add protocol (version two) support for streaming bodies (using chunking) in responses. |
109 |
return (other.args == self.args and |
110 |
other.body == self.body and |
|
111 |
other.body_stream is self.body_stream) |
|
2402.1.1
by Andrew Bennetts
Use the Command pattern for handling smart server commands. |
112 |
|
113 |
def __repr__(self): |
|
2781.2.1
by Andrew Bennetts
Fix SmartServerResponse.__repr__. |
114 |
return ("<SmartServerResponse successful=%s args=%r body=%r>" |
115 |
% (self.is_successful(), self.args, self.body)) |
|
2402.1.1
by Andrew Bennetts
Use the Command pattern for handling smart server commands. |
116 |
|
2018.5.16
by Andrew Bennetts
Move SmartServerResponse to smart/request.py, untangling more import dependencies. |
117 |
|
2432.4.2
by Robert Collins
Add FailedSmartServerResponse. |
118 |
class FailedSmartServerResponse(SmartServerResponse): |
119 |
"""A SmartServerResponse for a request which failed.""" |
|
120 |
||
121 |
def is_successful(self): |
|
122 |
"""FailedSmartServerResponse are not successful.""" |
|
123 |
return False |
|
124 |
||
125 |
||
2432.4.1
by Robert Collins
Add SuccessfulSmartServerResponse. |
126 |
class SuccessfulSmartServerResponse(SmartServerResponse): |
127 |
"""A SmartServerResponse for a successfully completed request.""" |
|
128 |
||
129 |
def is_successful(self): |
|
130 |
"""SuccessfulSmartServerResponse are successful.""" |
|
131 |
return True |
|
132 |
||
2018.5.16
by Andrew Bennetts
Move SmartServerResponse to smart/request.py, untangling more import dependencies. |
133 |
|
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
134 |
class SmartServerRequestHandler(object): |
135 |
"""Protocol logic for smart server. |
|
136 |
|
|
137 |
This doesn't handle serialization at all, it just processes requests and
|
|
138 |
creates responses.
|
|
139 |
"""
|
|
140 |
||
141 |
# IMPORTANT FOR IMPLEMENTORS: It is important that SmartServerRequestHandler
|
|
142 |
# not contain encoding or decoding logic to allow the wire protocol to vary
|
|
143 |
# from the object protocol: we will want to tweak the wire protocol separate
|
|
144 |
# from the object model, and ideally we will be able to do that without
|
|
145 |
# having a SmartServerRequestHandler subclass for each wire protocol, rather
|
|
146 |
# just a Protocol subclass.
|
|
147 |
||
148 |
# TODO: Better way of representing the body for commands that take it,
|
|
149 |
# and allow it to be streamed into the server.
|
|
150 |
||
2018.5.17
by Andrew Bennetts
Paramaterise the commands handled by SmartServerRequestHandler. |
151 |
def __init__(self, backing_transport, commands): |
152 |
"""Constructor. |
|
153 |
||
154 |
:param backing_transport: a Transport to handle requests for.
|
|
2018.5.23
by Andrew Bennetts
Use a Registry for smart server command handlers. |
155 |
:param commands: a registry mapping command names to SmartServerRequest
|
2018.5.17
by Andrew Bennetts
Paramaterise the commands handled by SmartServerRequestHandler. |
156 |
subclasses. e.g. bzrlib.transport.smart.vfs.vfs_commands.
|
157 |
"""
|
|
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
158 |
self._backing_transport = backing_transport |
2018.5.17
by Andrew Bennetts
Paramaterise the commands handled by SmartServerRequestHandler. |
159 |
self._commands = commands |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
160 |
self._body_bytes = '' |
161 |
self.response = None |
|
162 |
self.finished_reading = False |
|
163 |
self._command = None |
|
164 |
||
165 |
def accept_body(self, bytes): |
|
166 |
"""Accept body data.""" |
|
167 |
||
168 |
# TODO: This should be overriden for each command that desired body data
|
|
169 |
# to handle the right format of that data, i.e. plain bytes, a bundle,
|
|
170 |
# etc. The deserialisation into that format should be done in the
|
|
171 |
# Protocol object.
|
|
172 |
||
173 |
# default fallback is to accumulate bytes.
|
|
174 |
self._body_bytes += bytes |
|
175 |
||
176 |
def end_of_body(self): |
|
177 |
"""No more body data will be received.""" |
|
178 |
self._run_handler_code(self._command.do_body, (self._body_bytes,), {}) |
|
179 |
# cannot read after this.
|
|
180 |
self.finished_reading = True |
|
181 |
||
182 |
def dispatch_command(self, cmd, args): |
|
183 |
"""Deprecated compatibility method.""" # XXX XXX |
|
2018.5.23
by Andrew Bennetts
Use a Registry for smart server command handlers. |
184 |
try: |
185 |
command = self._commands.get(cmd) |
|
186 |
except LookupError: |
|
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
187 |
raise errors.SmartProtocolError("bad request %r" % (cmd,)) |
188 |
self._command = command(self._backing_transport) |
|
2018.5.24
by Andrew Bennetts
Setting NO_SMART_VFS in environment will disable VFS methods in the smart server. (Robert Collins, John Arbash Meinel, Andrew Bennetts) |
189 |
self._run_handler_code(self._command.execute, args, {}) |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
190 |
|
191 |
def _run_handler_code(self, callable, args, kwargs): |
|
192 |
"""Run some handler specific code 'callable'. |
|
193 |
||
194 |
If a result is returned, it is considered to be the commands response,
|
|
195 |
and finished_reading is set true, and its assigned to self.response.
|
|
196 |
||
197 |
Any exceptions caught are translated and a response object created
|
|
198 |
from them.
|
|
199 |
"""
|
|
200 |
result = self._call_converting_errors(callable, args, kwargs) |
|
2018.5.19
by Andrew Bennetts
Add docstrings to all the new modules, and a few other places. |
201 |
|
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
202 |
if result is not None: |
203 |
self.response = result |
|
204 |
self.finished_reading = True |
|
205 |
||
206 |
def _call_converting_errors(self, callable, args, kwargs): |
|
207 |
"""Call callable converting errors to Response objects.""" |
|
208 |
# XXX: most of this error conversion is VFS-related, and thus ought to
|
|
209 |
# be in SmartServerVFSRequestHandler somewhere.
|
|
210 |
try: |
|
211 |
return callable(*args, **kwargs) |
|
212 |
except errors.NoSuchFile, e: |
|
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
213 |
return FailedSmartServerResponse(('NoSuchFile', e.path)) |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
214 |
except errors.FileExists, e: |
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
215 |
return FailedSmartServerResponse(('FileExists', e.path)) |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
216 |
except errors.DirectoryNotEmpty, e: |
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
217 |
return FailedSmartServerResponse(('DirectoryNotEmpty', e.path)) |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
218 |
except errors.ShortReadvError, e: |
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
219 |
return FailedSmartServerResponse(('ShortReadvError', |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
220 |
e.path, str(e.offset), str(e.length), str(e.actual))) |
221 |
except UnicodeError, e: |
|
222 |
# If it is a DecodeError, than most likely we are starting
|
|
223 |
# with a plain string
|
|
224 |
str_or_unicode = e.object |
|
225 |
if isinstance(str_or_unicode, unicode): |
|
226 |
# XXX: UTF-8 might have \x01 (our seperator byte) in it. We
|
|
227 |
# should escape it somehow.
|
|
228 |
val = 'u:' + str_or_unicode.encode('utf-8') |
|
229 |
else: |
|
230 |
val = 's:' + str_or_unicode.encode('base64') |
|
231 |
# This handles UnicodeEncodeError or UnicodeDecodeError
|
|
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
232 |
return FailedSmartServerResponse((e.__class__.__name__, |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
233 |
e.encoding, val, str(e.start), str(e.end), e.reason)) |
234 |
except errors.TransportNotPossible, e: |
|
235 |
if e.msg == "readonly transport": |
|
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
236 |
return FailedSmartServerResponse(('ReadOnlyError', )) |
2018.5.14
by Andrew Bennetts
Move SmartTCPServer to smart/server.py, and SmartServerRequestHandler to smart/request.py. |
237 |
else: |
238 |
raise
|
|
239 |
||
240 |
||
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
241 |
class HelloRequest(SmartServerRequest): |
2432.2.6
by Andrew Bennetts
Improve HelloRequest's docstring. |
242 |
"""Answer a version request with the highest protocol version this server |
243 |
supports.
|
|
244 |
"""
|
|
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
245 |
|
246 |
def do(self): |
|
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
247 |
return SuccessfulSmartServerResponse(('ok', '2')) |
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
248 |
|
249 |
||
250 |
class GetBundleRequest(SmartServerRequest): |
|
2402.1.2
by Andrew Bennetts
Deal with review comments. |
251 |
"""Get a bundle of from the null revision to the specified revision.""" |
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
252 |
|
253 |
def do(self, path, revision_id): |
|
254 |
# open transport relative to our base
|
|
255 |
t = self._backing_transport.clone(path) |
|
256 |
control, extra_path = bzrdir.BzrDir.open_containing_from_transport(t) |
|
257 |
repo = control.open_repository() |
|
258 |
tmpf = tempfile.TemporaryFile() |
|
259 |
base_revision = revision.NULL_REVISION |
|
3224.5.6
by Andrew Bennetts
Don't import bzrlib.bundle in bzrlib.smart.request until it's needed. |
260 |
serializer.write_bundle(repo, revision_id, base_revision, tmpf) |
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
261 |
tmpf.seek(0) |
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
262 |
return SuccessfulSmartServerResponse((), tmpf.read()) |
2018.5.6
by Andrew Bennetts
Tidy ups, and turn do_hello and do_get_bundle into command objects. |
263 |
|
264 |
||
2018.5.95
by Andrew Bennetts
Add a Transport.is_readonly remote call, let {Branch,Repository}.lock_write remote call return UnlockableTransport, and miscellaneous test fixes. |
265 |
class SmartServerIsReadonly(SmartServerRequest): |
266 |
# XXX: this request method belongs somewhere else.
|
|
267 |
||
268 |
def do(self): |
|
269 |
if self._backing_transport.is_readonly(): |
|
270 |
answer = 'yes' |
|
271 |
else: |
|
272 |
answer = 'no' |
|
2432.4.5
by Robert Collins
Make using SuccessfulSmartServerResponse and FailedSmartServerResponse mandatory rather than optional in smart server logic. |
273 |
return SuccessfulSmartServerResponse((answer,)) |
2018.5.95
by Andrew Bennetts
Add a Transport.is_readonly remote call, let {Branch,Repository}.lock_write remote call return UnlockableTransport, and miscellaneous test fixes. |
274 |
|
275 |
||
2018.5.23
by Andrew Bennetts
Use a Registry for smart server command handlers. |
276 |
request_handlers = registry.Registry() |
277 |
request_handlers.register_lazy( |
|
278 |
'append', 'bzrlib.smart.vfs', 'AppendRequest') |
|
279 |
request_handlers.register_lazy( |
|
2018.5.59
by Robert Collins
Get BranchConfig working somewhat on RemoteBranches (Robert Collins, Vincent Ladeuil). |
280 |
'Branch.get_config_file', 'bzrlib.smart.branch', 'SmartServerBranchGetConfigFile') |
281 |
request_handlers.register_lazy( |
|
2018.5.51
by Wouter van Heyst
Test and implement RemoteBranch.last_revision_info() |
282 |
'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo') |
283 |
request_handlers.register_lazy( |
|
2018.5.79
by Andrew Bennetts
Implement RemoteBranch.lock_write/unlock as smart operations. |
284 |
'Branch.lock_write', 'bzrlib.smart.branch', 'SmartServerBranchRequestLockWrite') |
285 |
request_handlers.register_lazy( |
|
2018.5.38
by Robert Collins
Implement RemoteBranch.revision_history(). |
286 |
'Branch.revision_history', 'bzrlib.smart.branch', 'SmartServerRequestRevisionHistory') |
287 |
request_handlers.register_lazy( |
|
2018.5.77
by Wouter van Heyst
Fix typo in request_handlers registration of Branch.set_last_revision, and test that registration |
288 |
'Branch.set_last_revision', 'bzrlib.smart.branch', 'SmartServerBranchRequestSetLastRevision') |
2018.12.3
by Andrew Bennetts
Add a Branch.set_last_revision smart method, and make RemoteBranch.set_revision_history use it. |
289 |
request_handlers.register_lazy( |
2018.5.79
by Andrew Bennetts
Implement RemoteBranch.lock_write/unlock as smart operations. |
290 |
'Branch.unlock', 'bzrlib.smart.branch', 'SmartServerBranchRequestUnlock') |
291 |
request_handlers.register_lazy( |
|
3221.3.2
by Robert Collins
* New remote method ``RemoteBzrDir.find_repositoryV2`` adding support for |
292 |
'BzrDir.find_repository', 'bzrlib.smart.bzrdir', 'SmartServerRequestFindRepositoryV1') |
293 |
request_handlers.register_lazy( |
|
294 |
'BzrDir.find_repositoryV2', 'bzrlib.smart.bzrdir', 'SmartServerRequestFindRepositoryV2') |
|
2018.5.34
by Robert Collins
Get test_remote.BasicRemoteObjectTests.test_open_remote_branch passing by implementing a remote method BzrDir.find_repository. |
295 |
request_handlers.register_lazy( |
2018.5.42
by Robert Collins
Various hopefully improvements, but wsgi is broken, handing over to spiv :). |
296 |
'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir', 'SmartServerRequestInitializeBzrDir') |
297 |
request_handlers.register_lazy( |
|
2018.6.1
by Robert Collins
Implement a BzrDir.open_branch smart server method for opening a branch without VFS. |
298 |
'BzrDir.open_branch', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBranch') |
299 |
request_handlers.register_lazy( |
|
2018.5.23
by Andrew Bennetts
Use a Registry for smart server command handlers. |
300 |
'delete', 'bzrlib.smart.vfs', 'DeleteRequest') |
301 |
request_handlers.register_lazy( |
|
302 |
'get', 'bzrlib.smart.vfs', 'GetRequest') |
|
303 |
request_handlers.register_lazy( |
|
304 |
'get_bundle', 'bzrlib.smart.request', 'GetBundleRequest') |
|
305 |
request_handlers.register_lazy( |
|
306 |
'has', 'bzrlib.smart.vfs', 'HasRequest') |
|
307 |
request_handlers.register_lazy( |
|
308 |
'hello', 'bzrlib.smart.request', 'HelloRequest') |
|
309 |
request_handlers.register_lazy( |
|
2018.5.37
by Andrew Bennetts
Make sure all the request handlers in bzrlib/smart/vfs.py have consistent names. |
310 |
'iter_files_recursive', 'bzrlib.smart.vfs', 'IterFilesRecursiveRequest') |
2018.5.23
by Andrew Bennetts
Use a Registry for smart server command handlers. |
311 |
request_handlers.register_lazy( |
312 |
'list_dir', 'bzrlib.smart.vfs', 'ListDirRequest') |
|
313 |
request_handlers.register_lazy( |
|
2018.5.37
by Andrew Bennetts
Make sure all the request handlers in bzrlib/smart/vfs.py have consistent names. |
314 |
'mkdir', 'bzrlib.smart.vfs', 'MkdirRequest') |
315 |
request_handlers.register_lazy( |
|
316 |
'move', 'bzrlib.smart.vfs', 'MoveRequest') |
|
317 |
request_handlers.register_lazy( |
|
318 |
'put', 'bzrlib.smart.vfs', 'PutRequest') |
|
319 |
request_handlers.register_lazy( |
|
320 |
'put_non_atomic', 'bzrlib.smart.vfs', 'PutNonAtomicRequest') |
|
321 |
request_handlers.register_lazy( |
|
322 |
'readv', 'bzrlib.smart.vfs', 'ReadvRequest') |
|
323 |
request_handlers.register_lazy( |
|
324 |
'rename', 'bzrlib.smart.vfs', 'RenameRequest') |
|
2018.10.2
by v.ladeuil+lp at free
gather_stats server side and request registration |
325 |
request_handlers.register_lazy('Repository.gather_stats', |
326 |
'bzrlib.smart.repository', |
|
327 |
'SmartServerRepositoryGatherStats') |
|
3172.5.6
by Robert Collins
Create new smart server verb Repository.get_parent_map. |
328 |
request_handlers.register_lazy('Repository.get_parent_map', |
329 |
'bzrlib.smart.repository', |
|
330 |
'SmartServerRepositoryGetParentMap') |
|
2018.5.37
by Andrew Bennetts
Make sure all the request handlers in bzrlib/smart/vfs.py have consistent names. |
331 |
request_handlers.register_lazy( |
2535.4.29
by Andrew Bennetts
Add a new smart method, Repository.stream_revisions_chunked, rather than changing the behaviour of an existing method. |
332 |
'Repository.stream_knit_data_for_revisions', |
333 |
'bzrlib.smart.repository', |
|
334 |
'SmartServerRepositoryStreamKnitDataForRevisions') |
|
335 |
request_handlers.register_lazy( |
|
336 |
'Repository.stream_revisions_chunked', |
|
337 |
'bzrlib.smart.repository', |
|
338 |
'SmartServerRepositoryStreamRevisionsChunked') |
|
339 |
request_handlers.register_lazy( |
|
2018.5.67
by Wouter van Heyst
Implement RemoteRepository.get_revision_graph (Wouter van Heyst, Robert Collins) |
340 |
'Repository.get_revision_graph', 'bzrlib.smart.repository', 'SmartServerRepositoryGetRevisionGraph') |
341 |
request_handlers.register_lazy( |
|
2018.5.40
by Robert Collins
Implement a remote Repository.has_revision method. |
342 |
'Repository.has_revision', 'bzrlib.smart.repository', 'SmartServerRequestHasRevision') |
343 |
request_handlers.register_lazy( |
|
2018.5.57
by Robert Collins
Implement RemoteRepository.is_shared (Robert Collins, Vincent Ladeuil). |
344 |
'Repository.is_shared', 'bzrlib.smart.repository', 'SmartServerRepositoryIsShared') |
345 |
request_handlers.register_lazy( |
|
2018.5.78
by Andrew Bennetts
Implement RemoteRepository.lock_write/unlock to expect and send tokens over the |
346 |
'Repository.lock_write', 'bzrlib.smart.repository', 'SmartServerRepositoryLockWrite') |
347 |
request_handlers.register_lazy( |
|
348 |
'Repository.unlock', 'bzrlib.smart.repository', 'SmartServerRepositoryUnlock') |
|
349 |
request_handlers.register_lazy( |
|
2018.18.1
by Martin Pool
Add stub Repository.tarball smart method |
350 |
'Repository.tarball', 'bzrlib.smart.repository', |
351 |
'SmartServerRepositoryTarball') |
|
352 |
request_handlers.register_lazy( |
|
2018.5.37
by Andrew Bennetts
Make sure all the request handlers in bzrlib/smart/vfs.py have consistent names. |
353 |
'rmdir', 'bzrlib.smart.vfs', 'RmdirRequest') |
354 |
request_handlers.register_lazy( |
|
355 |
'stat', 'bzrlib.smart.vfs', 'StatRequest') |
|
2018.5.26
by Andrew Bennetts
Extract a simple SmartClient class from RemoteTransport, and a hack to avoid VFS operations when probing for a bzrdir over a smart transport. |
356 |
request_handlers.register_lazy( |
2018.5.95
by Andrew Bennetts
Add a Transport.is_readonly remote call, let {Branch,Repository}.lock_write remote call return UnlockableTransport, and miscellaneous test fixes. |
357 |
'Transport.is_readonly', 'bzrlib.smart.request', 'SmartServerIsReadonly') |
358 |
request_handlers.register_lazy( |
|
2018.5.163
by Andrew Bennetts
Deal with various review comments from Robert. |
359 |
'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir') |