1
# Copyright (C) 2006-2011 Canonical Ltd
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
"""Infrastructure for server-side request handlers.
19
Interesting module attributes:
20
* The request_handlers registry maps verb names to SmartServerRequest
22
* The jail_info threading.local() object is used to prevent accidental
23
opening of BzrDirs outside of the backing transport, or any other
24
transports placed in jail_info.transports. The jail_info is reset on
25
every call into a request handler (which can happen an arbitrary number
26
of times during a request).
29
# XXX: The class names are a little confusing: the protocol will instantiate a
30
# SmartServerRequestHandler, whose dispatch_command method creates an instance
31
# of a SmartServerRequest subclass.
46
from bzrlib.lazy_import import lazy_import
47
lazy_import(globals(), """
48
from bzrlib.bundle import serializer
55
jail_info = threading.local()
56
jail_info.transports = None
60
bzrdir.BzrDir.hooks.install_named_hook(
61
'pre_open', _pre_open_hook, 'checking server jail')
64
def _pre_open_hook(transport):
65
allowed_transports = getattr(jail_info, 'transports', None)
66
if allowed_transports is None:
68
abspath = transport.base
69
for allowed_transport in allowed_transports:
71
allowed_transport.relpath(abspath)
72
except errors.PathNotChild:
76
raise errors.JailBreak(abspath)
82
class SmartServerRequest(object):
83
"""Base class for request handlers.
85
To define a new request, subclass this class and override the `do` method
86
(and if appropriate, `do_body` as well). Request implementors should take
87
care to call `translate_client_path` and `transport_from_client_path` as
88
appropriate when dealing with paths received from the client.
90
# XXX: rename this class to BaseSmartServerRequestHandler ? A request
91
# *handler* is a different concept to the request.
93
def __init__(self, backing_transport, root_client_path='/', jail_root=None):
96
:param backing_transport: the base transport to be used when performing
98
:param root_client_path: the client path that maps to the root of
99
backing_transport. This is used to interpret relpaths received
100
from the client. Clients will not be able to refer to paths above
101
this root. If root_client_path is None, then no translation will
102
be performed on client paths. Default is '/'.
103
:param jail_root: if specified, the root of the BzrDir.open jail to use
104
instead of backing_transport.
106
self._backing_transport = backing_transport
107
if jail_root is None:
108
jail_root = backing_transport
109
self._jail_root = jail_root
110
if root_client_path is not None:
111
if not root_client_path.startswith('/'):
112
root_client_path = '/' + root_client_path
113
if not root_client_path.endswith('/'):
114
root_client_path += '/'
115
self._root_client_path = root_client_path
116
self._body_chunks = []
118
def _check_enabled(self):
119
"""Raises DisabledMethod if this method is disabled."""
123
"""Mandatory extension point for SmartServerRequest subclasses.
125
Subclasses must implement this.
127
This should return a SmartServerResponse if this command expects to
130
raise NotImplementedError(self.do)
132
def execute(self, *args):
133
"""Public entry point to execute this request.
135
It will return a SmartServerResponse if the command does not expect a
138
:param args: the arguments of the request.
140
self._check_enabled()
141
return self.do(*args)
143
def do_body(self, body_bytes):
144
"""Called if the client sends a body with the request.
146
The do() method is still called, and must have returned None.
148
Must return a SmartServerResponse.
151
raise errors.SmartProtocolError('Request does not expect a body')
153
def do_chunk(self, chunk_bytes):
154
"""Called with each body chunk if the request has a streamed body.
156
The do() method is still called, and must have returned None.
158
self._body_chunks.append(chunk_bytes)
161
"""Called when the end of the request has been received."""
162
body_bytes = ''.join(self._body_chunks)
163
self._body_chunks = None
164
return self.do_body(body_bytes)
166
def setup_jail(self):
167
jail_info.transports = [self._jail_root]
169
def teardown_jail(self):
170
jail_info.transports = None
172
def translate_client_path(self, client_path):
173
"""Translate a path received from a network client into a local
176
All paths received from the client *must* be translated.
178
:param client_path: the path from the client.
179
:returns: a relpath that may be used with self._backing_transport
180
(unlike the untranslated client_path, which must not be used with
181
the backing transport).
183
if self._root_client_path is None:
184
# no translation necessary!
186
if not client_path.startswith('/'):
187
client_path = '/' + client_path
188
if client_path + '/' == self._root_client_path:
190
if client_path.startswith(self._root_client_path):
191
path = client_path[len(self._root_client_path):]
192
relpath = urlutils.joinpath('/', path)
193
if not relpath.startswith('/'):
194
raise ValueError(relpath)
195
return urlutils.escape('.' + relpath)
197
raise errors.PathNotChild(client_path, self._root_client_path)
199
def transport_from_client_path(self, client_path):
200
"""Get a backing transport corresponding to the location referred to by
203
:seealso: translate_client_path
204
:returns: a transport cloned from self._backing_transport
206
relpath = self.translate_client_path(client_path)
207
return self._backing_transport.clone(relpath)
210
class SmartServerResponse(object):
211
"""A response to a client request.
213
This base class should not be used. Instead use
214
SuccessfulSmartServerResponse and FailedSmartServerResponse as appropriate.
217
def __init__(self, args, body=None, body_stream=None):
220
:param args: tuple of response arguments.
221
:param body: string of a response body.
222
:param body_stream: iterable of bytestrings to be streamed to the
226
if body is not None and body_stream is not None:
227
raise errors.BzrError(
228
"'body' and 'body_stream' are mutually exclusive.")
230
self.body_stream = body_stream
232
def __eq__(self, other):
235
return (other.args == self.args and
236
other.body == self.body and
237
other.body_stream is self.body_stream)
240
return "<%s args=%r body=%r>" % (self.__class__.__name__,
241
self.args, self.body)
244
class FailedSmartServerResponse(SmartServerResponse):
245
"""A SmartServerResponse for a request which failed."""
247
def is_successful(self):
248
"""FailedSmartServerResponse are not successful."""
252
class SuccessfulSmartServerResponse(SmartServerResponse):
253
"""A SmartServerResponse for a successfully completed request."""
255
def is_successful(self):
256
"""SuccessfulSmartServerResponse are successful."""
260
class SmartServerRequestHandler(object):
261
"""Protocol logic for smart server.
263
This doesn't handle serialization at all, it just processes requests and
267
# IMPORTANT FOR IMPLEMENTORS: It is important that SmartServerRequestHandler
268
# not contain encoding or decoding logic to allow the wire protocol to vary
269
# from the object protocol: we will want to tweak the wire protocol separate
270
# from the object model, and ideally we will be able to do that without
271
# having a SmartServerRequestHandler subclass for each wire protocol, rather
272
# just a Protocol subclass.
274
# TODO: Better way of representing the body for commands that take it,
275
# and allow it to be streamed into the server.
277
def __init__(self, backing_transport, commands, root_client_path,
281
:param backing_transport: a Transport to handle requests for.
282
:param commands: a registry mapping command names to SmartServerRequest
283
subclasses. e.g. bzrlib.transport.smart.vfs.vfs_commands.
285
self._backing_transport = backing_transport
286
self._root_client_path = root_client_path
287
self._commands = commands
288
if jail_root is None:
289
jail_root = backing_transport
290
self._jail_root = jail_root
292
self.finished_reading = False
294
if 'hpss' in debug.debug_flags:
295
self._request_start_time = osutils.timer_func()
296
self._thread_id = thread.get_ident()
298
def _trace(self, action, message, extra_bytes=None, include_time=False):
299
# It is a bit of a shame that this functionality overlaps with that of
300
# ProtocolThreeRequester._trace. However, there is enough difference
301
# that just putting it in a helper doesn't help a lot. And some state
302
# is taken from the instance.
304
t = '%5.3fs ' % (osutils.timer_func() - self._request_start_time)
307
if extra_bytes is None:
310
extra = ' ' + repr(extra_bytes[:40])
312
extra = extra[:29] + extra[-1] + '...'
313
trace.mutter('%12s: [%s] %s%s%s'
314
% (action, self._thread_id, t, message, extra))
316
def accept_body(self, bytes):
317
"""Accept body data."""
318
if self._command is None:
319
# no active command object, so ignore the event.
321
self._run_handler_code(self._command.do_chunk, (bytes,), {})
322
if 'hpss' in debug.debug_flags:
323
self._trace('accept body',
324
'%d bytes' % (len(bytes),), bytes)
326
def end_of_body(self):
327
"""No more body data will be received."""
328
self._run_handler_code(self._command.do_end, (), {})
329
# cannot read after this.
330
self.finished_reading = True
331
if 'hpss' in debug.debug_flags:
332
self._trace('end of body', '', include_time=True)
334
def _run_handler_code(self, callable, args, kwargs):
335
"""Run some handler specific code 'callable'.
337
If a result is returned, it is considered to be the commands response,
338
and finished_reading is set true, and its assigned to self.response.
340
Any exceptions caught are translated and a response object created
343
result = self._call_converting_errors(callable, args, kwargs)
345
if result is not None:
346
self.response = result
347
self.finished_reading = True
349
def _call_converting_errors(self, callable, args, kwargs):
350
"""Call callable converting errors to Response objects."""
351
# XXX: most of this error conversion is VFS-related, and thus ought to
352
# be in SmartServerVFSRequestHandler somewhere.
354
self._command.setup_jail()
356
return callable(*args, **kwargs)
358
self._command.teardown_jail()
359
except (KeyboardInterrupt, SystemExit):
361
except Exception, err:
362
err_struct = _translate_error(err)
363
return FailedSmartServerResponse(err_struct)
365
def headers_received(self, headers):
366
# Just a no-op at the moment.
367
if 'hpss' in debug.debug_flags:
368
self._trace('headers', repr(headers))
370
def args_received(self, args):
374
command = self._commands.get(cmd)
376
if 'hpss' in debug.debug_flags:
377
self._trace('hpss unknown request',
378
cmd, repr(args)[1:-1])
379
raise errors.UnknownSmartMethod(cmd)
380
if 'hpss' in debug.debug_flags:
381
from bzrlib.smart import vfs
382
if issubclass(command, vfs.VfsRequest):
383
action = 'hpss vfs req'
385
action = 'hpss request'
387
'%s %s' % (cmd, repr(args)[1:-1]))
388
self._command = command(
389
self._backing_transport, self._root_client_path, self._jail_root)
390
self._run_handler_code(self._command.execute, args, {})
392
def end_received(self):
393
if self._command is None:
394
# no active command object, so ignore the event.
396
self._run_handler_code(self._command.do_end, (), {})
397
if 'hpss' in debug.debug_flags:
398
self._trace('end', '', include_time=True)
400
def post_body_error_received(self, error_args):
401
# Just a no-op at the moment.
405
def _translate_error(err):
406
if isinstance(err, errors.NoSuchFile):
407
return ('NoSuchFile', err.path)
408
elif isinstance(err, errors.FileExists):
409
return ('FileExists', err.path)
410
elif isinstance(err, errors.DirectoryNotEmpty):
411
return ('DirectoryNotEmpty', err.path)
412
elif isinstance(err, errors.IncompatibleRepositories):
413
return ('IncompatibleRepositories', str(err.source), str(err.target),
415
elif isinstance(err, errors.ShortReadvError):
416
return ('ShortReadvError', err.path, str(err.offset), str(err.length),
418
elif isinstance(err, errors.RevisionNotPresent):
419
return ('RevisionNotPresent', err.revision_id, err.file_id)
420
elif isinstance(err, errors.UnstackableRepositoryFormat):
421
return (('UnstackableRepositoryFormat', str(err.format), err.url))
422
elif isinstance(err, errors.UnstackableBranchFormat):
423
return ('UnstackableBranchFormat', str(err.format), err.url)
424
elif isinstance(err, errors.NotStacked):
425
return ('NotStacked',)
426
elif isinstance(err, errors.BzrCheckError):
427
return ('BzrCheckError', err.msg)
428
elif isinstance(err, UnicodeError):
429
# If it is a DecodeError, than most likely we are starting
430
# with a plain string
431
str_or_unicode = err.object
432
if isinstance(str_or_unicode, unicode):
433
# XXX: UTF-8 might have \x01 (our protocol v1 and v2 seperator
434
# byte) in it, so this encoding could cause broken responses.
435
# Newer clients use protocol v3, so will be fine.
436
val = 'u:' + str_or_unicode.encode('utf-8')
438
val = 's:' + str_or_unicode.encode('base64')
439
# This handles UnicodeEncodeError or UnicodeDecodeError
440
return (err.__class__.__name__, err.encoding, val, str(err.start),
441
str(err.end), err.reason)
442
elif isinstance(err, errors.TransportNotPossible):
443
if err.msg == "readonly transport":
444
return ('ReadOnlyError', )
445
elif isinstance(err, errors.ReadError):
446
# cannot read the file
447
return ('ReadError', err.path)
448
elif isinstance(err, errors.PermissionDenied):
449
return ('PermissionDenied', err.path, err.extra)
450
elif isinstance(err, errors.TokenMismatch):
451
return ('TokenMismatch', err.given_token, err.lock_token)
452
elif isinstance(err, errors.LockContention):
453
return ('LockContention',)
454
elif isinstance(err, MemoryError):
455
# GZ 2011-02-24: Copy bzrlib.trace -Dmem_dump functionality here?
456
return ('MemoryError',)
457
# Unserialisable error. Log it, and return a generic error
458
trace.log_exception_quietly()
459
return ('error', trace._qualified_exception_name(err.__class__, True),
463
class HelloRequest(SmartServerRequest):
464
"""Answer a version request with the highest protocol version this server
469
return SuccessfulSmartServerResponse(('ok', '2'))
472
class GetBundleRequest(SmartServerRequest):
473
"""Get a bundle of from the null revision to the specified revision."""
475
def do(self, path, revision_id):
476
# open transport relative to our base
477
t = self.transport_from_client_path(path)
478
control, extra_path = bzrdir.BzrDir.open_containing_from_transport(t)
479
repo = control.open_repository()
480
tmpf = tempfile.TemporaryFile()
481
base_revision = revision.NULL_REVISION
482
serializer.write_bundle(repo, revision_id, base_revision, tmpf)
484
return SuccessfulSmartServerResponse((), tmpf.read())
487
class SmartServerIsReadonly(SmartServerRequest):
488
# XXX: this request method belongs somewhere else.
491
if self._backing_transport.is_readonly():
495
return SuccessfulSmartServerResponse((answer,))
498
# In the 'info' attribute, we store whether this request is 'safe' to retry if
499
# we get a disconnect while reading the response. It can have the values:
500
# read This is purely a read request, so retrying it is perfectly ok.
501
# idem An idempotent write request. Something like 'put' where if you put
502
# the same bytes twice you end up with the same final bytes.
503
# semi This is a request that isn't strictly idempotent, but doesn't
504
# result in corruption if it is retried. This is for things like
505
# 'lock' and 'unlock'. If you call lock, it updates the disk
506
# structure. If you fail to read the response, you won't be able to
507
# use the lock, because you don't have the lock token. Calling lock
508
# again will fail, because the lock is already taken. However, we
509
# can't tell if the server received our request or not. If it didn't,
510
# then retrying the request is fine, as it will actually do what we
511
# want. If it did, we will interrupt the current operation, but we
512
# are no worse off than interrupting the current operation because of
514
# semivfs Similar to semi, but specific to a Virtual FileSystem request.
515
# stream This is a request that takes a stream that cannot be restarted if
516
# consumed. This request is 'safe' in that if we determine the
517
# connection is closed before we consume the stream, we can try
519
# mutate State is updated in a way that replaying that request results in a
520
# different state. For example 'append' writes more bytes to a given
521
# file. If append succeeds, it moves the file pointer.
522
request_handlers = registry.Registry()
523
request_handlers.register_lazy(
524
'append', 'bzrlib.smart.vfs', 'AppendRequest', info='mutate')
525
request_handlers.register_lazy(
526
'Branch.break_lock', 'bzrlib.smart.branch',
527
'SmartServerBranchBreakLock', info='idem')
528
request_handlers.register_lazy(
529
'Branch.get_config_file', 'bzrlib.smart.branch',
530
'SmartServerBranchGetConfigFile', info='read')
531
request_handlers.register_lazy(
532
'Branch.get_parent', 'bzrlib.smart.branch', 'SmartServerBranchGetParent',
534
request_handlers.register_lazy(
535
'Branch.put_config_file', 'bzrlib.smart.branch',
536
'SmartServerBranchPutConfigFile', info='idem')
537
request_handlers.register_lazy(
538
'Branch.get_tags_bytes', 'bzrlib.smart.branch',
539
'SmartServerBranchGetTagsBytes', info='read')
540
request_handlers.register_lazy(
541
'Branch.set_tags_bytes', 'bzrlib.smart.branch',
542
'SmartServerBranchSetTagsBytes', info='idem')
543
request_handlers.register_lazy(
544
'Branch.heads_to_fetch', 'bzrlib.smart.branch',
545
'SmartServerBranchHeadsToFetch', info='read')
546
request_handlers.register_lazy(
547
'Branch.get_stacked_on_url', 'bzrlib.smart.branch',
548
'SmartServerBranchRequestGetStackedOnURL', info='read')
549
request_handlers.register_lazy(
550
'Branch.get_physical_lock_status', 'bzrlib.smart.branch',
551
'SmartServerBranchRequestGetPhysicalLockStatus', info='read')
552
request_handlers.register_lazy(
553
'Branch.last_revision_info', 'bzrlib.smart.branch',
554
'SmartServerBranchRequestLastRevisionInfo', info='read')
555
request_handlers.register_lazy(
556
'Branch.lock_write', 'bzrlib.smart.branch',
557
'SmartServerBranchRequestLockWrite', info='semi')
558
request_handlers.register_lazy(
559
'Branch.revision_history', 'bzrlib.smart.branch',
560
'SmartServerRequestRevisionHistory', info='read')
561
request_handlers.register_lazy(
562
'Branch.set_config_option', 'bzrlib.smart.branch',
563
'SmartServerBranchRequestSetConfigOption', info='idem')
564
request_handlers.register_lazy(
565
'Branch.set_config_option_dict', 'bzrlib.smart.branch',
566
'SmartServerBranchRequestSetConfigOptionDict', info='idem')
567
request_handlers.register_lazy(
568
'Branch.set_last_revision', 'bzrlib.smart.branch',
569
'SmartServerBranchRequestSetLastRevision', info='idem')
570
request_handlers.register_lazy(
571
'Branch.set_last_revision_info', 'bzrlib.smart.branch',
572
'SmartServerBranchRequestSetLastRevisionInfo', info='idem')
573
request_handlers.register_lazy(
574
'Branch.set_last_revision_ex', 'bzrlib.smart.branch',
575
'SmartServerBranchRequestSetLastRevisionEx', info='idem')
576
request_handlers.register_lazy(
577
'Branch.set_parent_location', 'bzrlib.smart.branch',
578
'SmartServerBranchRequestSetParentLocation', info='idem')
579
request_handlers.register_lazy(
580
'Branch.unlock', 'bzrlib.smart.branch',
581
'SmartServerBranchRequestUnlock', info='semi')
582
request_handlers.register_lazy(
583
'Branch.revision_id_to_revno', 'bzrlib.smart.branch',
584
'SmartServerBranchRequestRevisionIdToRevno', info='read')
585
request_handlers.register_lazy(
586
'BzrDir.cloning_metadir', 'bzrlib.smart.bzrdir',
587
'SmartServerBzrDirRequestCloningMetaDir', info='read')
588
request_handlers.register_lazy(
589
'BzrDir.create_branch', 'bzrlib.smart.bzrdir',
590
'SmartServerRequestCreateBranch', info='semi')
591
request_handlers.register_lazy(
592
'BzrDir.create_repository', 'bzrlib.smart.bzrdir',
593
'SmartServerRequestCreateRepository', info='semi')
594
request_handlers.register_lazy(
595
'BzrDir.find_repository', 'bzrlib.smart.bzrdir',
596
'SmartServerRequestFindRepositoryV1', info='read')
597
request_handlers.register_lazy(
598
'BzrDir.find_repositoryV2', 'bzrlib.smart.bzrdir',
599
'SmartServerRequestFindRepositoryV2', info='read')
600
request_handlers.register_lazy(
601
'BzrDir.find_repositoryV3', 'bzrlib.smart.bzrdir',
602
'SmartServerRequestFindRepositoryV3', info='read')
603
request_handlers.register_lazy(
604
'BzrDir.get_config_file', 'bzrlib.smart.bzrdir',
605
'SmartServerBzrDirRequestConfigFile', info='read')
606
request_handlers.register_lazy(
607
'BzrDir.destroy_branch', 'bzrlib.smart.bzrdir',
608
'SmartServerBzrDirRequestDestroyBranch', info='semi')
609
request_handlers.register_lazy(
610
'BzrDir.destroy_repository', 'bzrlib.smart.bzrdir',
611
'SmartServerBzrDirRequestDestroyRepository', info='semi')
612
request_handlers.register_lazy(
613
'BzrDir.has_workingtree', 'bzrlib.smart.bzrdir',
614
'SmartServerBzrDirRequestHasWorkingTree', info='read')
615
request_handlers.register_lazy(
616
'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
617
'SmartServerRequestInitializeBzrDir', info='semi')
618
request_handlers.register_lazy(
619
'BzrDirFormat.initialize_ex_1.16', 'bzrlib.smart.bzrdir',
620
'SmartServerRequestBzrDirInitializeEx', info='semi')
621
request_handlers.register_lazy(
622
'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir',
624
request_handlers.register_lazy(
625
'BzrDir.open_2.1', 'bzrlib.smart.bzrdir',
626
'SmartServerRequestOpenBzrDir_2_1', info='read')
627
request_handlers.register_lazy(
628
'BzrDir.open_branch', 'bzrlib.smart.bzrdir',
629
'SmartServerRequestOpenBranch', info='read')
630
request_handlers.register_lazy(
631
'BzrDir.open_branchV2', 'bzrlib.smart.bzrdir',
632
'SmartServerRequestOpenBranchV2', info='read')
633
request_handlers.register_lazy(
634
'BzrDir.open_branchV3', 'bzrlib.smart.bzrdir',
635
'SmartServerRequestOpenBranchV3', info='read')
636
request_handlers.register_lazy(
637
'delete', 'bzrlib.smart.vfs', 'DeleteRequest', info='semivfs')
638
request_handlers.register_lazy(
639
'get', 'bzrlib.smart.vfs', 'GetRequest', info='read')
640
request_handlers.register_lazy(
641
'get_bundle', 'bzrlib.smart.request', 'GetBundleRequest', info='read')
642
request_handlers.register_lazy(
643
'has', 'bzrlib.smart.vfs', 'HasRequest', info='read')
644
request_handlers.register_lazy(
645
'hello', 'bzrlib.smart.request', 'HelloRequest', info='read')
646
request_handlers.register_lazy(
647
'iter_files_recursive', 'bzrlib.smart.vfs', 'IterFilesRecursiveRequest',
649
request_handlers.register_lazy(
650
'list_dir', 'bzrlib.smart.vfs', 'ListDirRequest', info='read')
651
request_handlers.register_lazy(
652
'mkdir', 'bzrlib.smart.vfs', 'MkdirRequest', info='semivfs')
653
request_handlers.register_lazy(
654
'move', 'bzrlib.smart.vfs', 'MoveRequest', info='semivfs')
655
request_handlers.register_lazy(
656
'put', 'bzrlib.smart.vfs', 'PutRequest', info='idem')
657
request_handlers.register_lazy(
658
'put_non_atomic', 'bzrlib.smart.vfs', 'PutNonAtomicRequest', info='idem')
659
request_handlers.register_lazy(
660
'readv', 'bzrlib.smart.vfs', 'ReadvRequest', info='read')
661
request_handlers.register_lazy(
662
'rename', 'bzrlib.smart.vfs', 'RenameRequest', info='semivfs')
663
request_handlers.register_lazy(
664
'Repository.add_signature_text', 'bzrlib.smart.repository',
665
'SmartServerRepositoryAddSignatureText', info='idem')
666
request_handlers.register_lazy(
667
'Repository.all_revision_ids', 'bzrlib.smart.repository',
668
'SmartServerRepositoryAllRevisionIds', info='read')
669
request_handlers.register_lazy(
670
'PackRepository.autopack', 'bzrlib.smart.packrepository',
671
'SmartServerPackRepositoryAutopack', info='idem')
672
request_handlers.register_lazy(
673
'Repository.break_lock', 'bzrlib.smart.repository',
674
'SmartServerRepositoryBreakLock', info='idem')
675
request_handlers.register_lazy(
676
'Repository.gather_stats', 'bzrlib.smart.repository',
677
'SmartServerRepositoryGatherStats', info='read')
678
request_handlers.register_lazy(
679
'Repository.get_parent_map', 'bzrlib.smart.repository',
680
'SmartServerRepositoryGetParentMap', info='read')
681
request_handlers.register_lazy(
682
'Repository.get_revision_graph', 'bzrlib.smart.repository',
683
'SmartServerRepositoryGetRevisionGraph', info='read')
684
request_handlers.register_lazy(
685
'Repository.get_revision_signature_text', 'bzrlib.smart.repository',
686
'SmartServerRepositoryGetRevisionSignatureText', info='read')
687
request_handlers.register_lazy(
688
'Repository.has_revision', 'bzrlib.smart.repository',
689
'SmartServerRequestHasRevision', info='read')
690
request_handlers.register_lazy(
691
'Repository.has_signature_for_revision_id', 'bzrlib.smart.repository',
692
'SmartServerRequestHasSignatureForRevisionId', info='read')
693
request_handlers.register_lazy(
694
'Repository.insert_stream', 'bzrlib.smart.repository',
695
'SmartServerRepositoryInsertStream', info='stream')
696
request_handlers.register_lazy(
697
'Repository.insert_stream_1.19', 'bzrlib.smart.repository',
698
'SmartServerRepositoryInsertStream_1_19', info='stream')
699
request_handlers.register_lazy(
700
'Repository.insert_stream_locked', 'bzrlib.smart.repository',
701
'SmartServerRepositoryInsertStreamLocked', info='stream')
702
request_handlers.register_lazy(
703
'Repository.is_shared', 'bzrlib.smart.repository',
704
'SmartServerRepositoryIsShared', info='read')
705
request_handlers.register_lazy(
706
'Repository.iter_files_bytes', 'bzrlib.smart.repository',
707
'SmartServerRepositoryIterFilesBytes', info='read')
708
request_handlers.register_lazy(
709
'Repository.lock_write', 'bzrlib.smart.repository',
710
'SmartServerRepositoryLockWrite', info='semi')
711
request_handlers.register_lazy(
712
'Repository.make_working_trees', 'bzrlib.smart.repository',
713
'SmartServerRepositoryMakeWorkingTrees', info='read')
714
request_handlers.register_lazy(
715
'Repository.set_make_working_trees', 'bzrlib.smart.repository',
716
'SmartServerRepositorySetMakeWorkingTrees', info='idem')
717
request_handlers.register_lazy(
718
'Repository.unlock', 'bzrlib.smart.repository',
719
'SmartServerRepositoryUnlock', info='semi')
720
request_handlers.register_lazy(
721
'Repository.get_physical_lock_status', 'bzrlib.smart.repository',
722
'SmartServerRepositoryGetPhysicalLockStatus', info='read')
723
request_handlers.register_lazy(
724
'Repository.get_rev_id_for_revno', 'bzrlib.smart.repository',
725
'SmartServerRepositoryGetRevIdForRevno', info='read')
726
request_handlers.register_lazy(
727
'Repository.get_stream', 'bzrlib.smart.repository',
728
'SmartServerRepositoryGetStream', info='read')
729
request_handlers.register_lazy(
730
'Repository.get_stream_1.19', 'bzrlib.smart.repository',
731
'SmartServerRepositoryGetStream_1_19', info='read')
732
request_handlers.register_lazy(
733
'Repository.iter_revisions', 'bzrlib.smart.repository',
734
'SmartServerRepositoryIterRevisions', info='read')
735
request_handlers.register_lazy(
736
'Repository.pack', 'bzrlib.smart.repository',
737
'SmartServerRepositoryPack', info='idem')
738
request_handlers.register_lazy(
739
'Repository.start_write_group', 'bzrlib.smart.repository',
740
'SmartServerRepositoryStartWriteGroup', info='semi')
741
request_handlers.register_lazy(
742
'Repository.commit_write_group', 'bzrlib.smart.repository',
743
'SmartServerRepositoryCommitWriteGroup', info='semi')
744
request_handlers.register_lazy(
745
'Repository.abort_write_group', 'bzrlib.smart.repository',
746
'SmartServerRepositoryAbortWriteGroup', info='semi')
747
request_handlers.register_lazy(
748
'Repository.check_write_group', 'bzrlib.smart.repository',
749
'SmartServerRepositoryCheckWriteGroup', info='read')
750
request_handlers.register_lazy(
751
'VersionedFileRepository.get_serializer_format', 'bzrlib.smart.repository',
752
'SmartServerRepositoryGetSerializerFormat', info='read')
753
request_handlers.register_lazy(
754
'Repository.tarball', 'bzrlib.smart.repository',
755
'SmartServerRepositoryTarball', info='read')
756
request_handlers.register_lazy(
757
'rmdir', 'bzrlib.smart.vfs', 'RmdirRequest', info='semivfs')
758
request_handlers.register_lazy(
759
'stat', 'bzrlib.smart.vfs', 'StatRequest', info='read')
760
request_handlers.register_lazy(
761
'Transport.is_readonly', 'bzrlib.smart.request',
762
'SmartServerIsReadonly', info='read')