/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
            continue
70
70
        else:
71
71
            return
72
 
    raise errors.JailBreak(abspath)
 
72
    raise errors.BzrError('jail break: %r' % (abspath,))
73
73
 
74
74
 
75
75
_install_hook()
176
176
            return client_path
177
177
        if not client_path.startswith('/'):
178
178
            client_path = '/' + client_path
179
 
        if client_path + '/' == self._root_client_path:
180
 
            return '.'
181
179
        if client_path.startswith(self._root_client_path):
182
180
            path = client_path[len(self._root_client_path):]
183
181
            relpath = urlutils.joinpath('/', path)
281
279
 
282
280
    def accept_body(self, bytes):
283
281
        """Accept body data."""
284
 
        if self._command is None:
285
 
            # no active command object, so ignore the event.
286
 
            return
287
282
        self._run_handler_code(self._command.do_chunk, (bytes,), {})
288
283
 
289
284
    def end_of_body(self):
347
342
        self._run_handler_code(self._command.execute, args, {})
348
343
 
349
344
    def end_received(self):
350
 
        if self._command is None:
351
 
            # no active command object, so ignore the event.
352
 
            return
353
345
        self._run_handler_code(self._command.do_end, (), {})
354
346
 
355
347
    def post_body_error_received(self, error_args):
364
356
        return ('FileExists', err.path)
365
357
    elif isinstance(err, errors.DirectoryNotEmpty):
366
358
        return ('DirectoryNotEmpty', err.path)
367
 
    elif isinstance(err, errors.IncompatibleRepositories):
368
 
        return ('IncompatibleRepositories', str(err.source), str(err.target),
369
 
            str(err.details))
370
359
    elif isinstance(err, errors.ShortReadvError):
371
360
        return ('ShortReadvError', err.path, str(err.offset), str(err.length),
372
361
                str(err.actual))
401
390
    elif isinstance(err, errors.TokenMismatch):
402
391
        return ('TokenMismatch', err.given_token, err.lock_token)
403
392
    elif isinstance(err, errors.LockContention):
404
 
        return ('LockContention',)
 
393
        return ('LockContention', err.lock, err.msg)
405
394
    # Unserialisable error.  Log it, and return a generic error
406
395
    trace.log_exception_quietly()
407
396
    return ('error', str(err))
454
443
    'Branch.get_tags_bytes', 'bzrlib.smart.branch',
455
444
    'SmartServerBranchGetTagsBytes')
456
445
request_handlers.register_lazy(
457
 
    'Branch.set_tags_bytes', 'bzrlib.smart.branch',
458
 
    'SmartServerBranchSetTagsBytes')
459
 
request_handlers.register_lazy(
460
446
    'Branch.get_stacked_on_url', 'bzrlib.smart.branch', 'SmartServerBranchRequestGetStackedOnURL')
461
447
request_handlers.register_lazy(
462
448
    'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo')
475
461
    'Branch.set_last_revision_ex', 'bzrlib.smart.branch',
476
462
    'SmartServerBranchRequestSetLastRevisionEx')
477
463
request_handlers.register_lazy(
478
 
    'Branch.set_parent_location', 'bzrlib.smart.branch',
479
 
    'SmartServerBranchRequestSetParentLocation')
480
 
request_handlers.register_lazy(
481
464
    'Branch.unlock', 'bzrlib.smart.branch', 'SmartServerBranchRequestUnlock')
482
465
request_handlers.register_lazy(
483
466
    'BzrDir.cloning_metadir', 'bzrlib.smart.bzrdir',
498
481
    'BzrDir.find_repositoryV3', 'bzrlib.smart.bzrdir',
499
482
    'SmartServerRequestFindRepositoryV3')
500
483
request_handlers.register_lazy(
501
 
    'BzrDir.get_config_file', 'bzrlib.smart.bzrdir',
502
 
    'SmartServerBzrDirRequestConfigFile')
503
 
request_handlers.register_lazy(
504
484
    'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
505
485
    'SmartServerRequestInitializeBzrDir')
506
486
request_handlers.register_lazy(
507
 
    'BzrDirFormat.initialize_ex_1.16', 'bzrlib.smart.bzrdir',
508
 
    'SmartServerRequestBzrDirInitializeEx')
509
 
request_handlers.register_lazy(
510
 
    'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')
511
 
request_handlers.register_lazy(
512
487
    'BzrDir.open_branch', 'bzrlib.smart.bzrdir',
513
488
    'SmartServerRequestOpenBranch')
514
489
request_handlers.register_lazy(
556
531
request_handlers.register_lazy(
557
532
    'Repository.insert_stream', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream')
558
533
request_handlers.register_lazy(
559
 
    'Repository.insert_stream_1.19', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream_1_19')
560
 
request_handlers.register_lazy(
561
534
    'Repository.insert_stream_locked', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStreamLocked')
562
535
request_handlers.register_lazy(
563
536
    'Repository.is_shared', 'bzrlib.smart.repository', 'SmartServerRepositoryIsShared')
569
542
request_handlers.register_lazy(
570
543
    'Repository.unlock', 'bzrlib.smart.repository', 'SmartServerRepositoryUnlock')
571
544
request_handlers.register_lazy(
572
 
    'Repository.get_rev_id_for_revno', 'bzrlib.smart.repository',
573
 
    'SmartServerRepositoryGetRevIdForRevno')
574
 
request_handlers.register_lazy(
575
545
    'Repository.get_stream', 'bzrlib.smart.repository',
576
546
    'SmartServerRepositoryGetStream')
577
547
request_handlers.register_lazy(
578
 
    'Repository.get_stream_1.19', 'bzrlib.smart.repository',
579
 
    'SmartServerRepositoryGetStream_1_19')
580
 
request_handlers.register_lazy(
581
548
    'Repository.tarball', 'bzrlib.smart.repository',
582
549
    'SmartServerRepositoryTarball')
583
550
request_handlers.register_lazy(
586
553
    'stat', 'bzrlib.smart.vfs', 'StatRequest')
587
554
request_handlers.register_lazy(
588
555
    'Transport.is_readonly', 'bzrlib.smart.request', 'SmartServerIsReadonly')
 
556
request_handlers.register_lazy(
 
557
    'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')