~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/request.py

  • Committer: Joe Julian
  • Date: 2010-01-10 02:25:31 UTC
  • mto: (4634.119.7 2.0)
  • mto: This revision was merged to the branch mainline in revision 4959.
  • Revision ID: joe@julianfamily.org-20100110022531-wqk61rsagz8xsiga
Added MANIFEST.in to allow bdist_rpm to have all the required include files and tools. bdist_rpm will still fail to build correctly on some distributions due to a disttools bug http://bugs.python.org/issue644744

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
            continue
70
70
        else:
71
71
            return
72
 
    raise errors.BzrError('jail break: %r' % (abspath,))
 
72
    raise errors.JailBreak(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 '.'
179
181
        if client_path.startswith(self._root_client_path):
180
182
            path = client_path[len(self._root_client_path):]
181
183
            relpath = urlutils.joinpath('/', path)
279
281
 
280
282
    def accept_body(self, bytes):
281
283
        """Accept body data."""
 
284
        if self._command is None:
 
285
            # no active command object, so ignore the event.
 
286
            return
282
287
        self._run_handler_code(self._command.do_chunk, (bytes,), {})
283
288
 
284
289
    def end_of_body(self):
342
347
        self._run_handler_code(self._command.execute, args, {})
343
348
 
344
349
    def end_received(self):
 
350
        if self._command is None:
 
351
            # no active command object, so ignore the event.
 
352
            return
345
353
        self._run_handler_code(self._command.do_end, (), {})
346
354
 
347
355
    def post_body_error_received(self, error_args):
356
364
        return ('FileExists', err.path)
357
365
    elif isinstance(err, errors.DirectoryNotEmpty):
358
366
        return ('DirectoryNotEmpty', err.path)
 
367
    elif isinstance(err, errors.IncompatibleRepositories):
 
368
        return ('IncompatibleRepositories', str(err.source), str(err.target),
 
369
            str(err.details))
359
370
    elif isinstance(err, errors.ShortReadvError):
360
371
        return ('ShortReadvError', err.path, str(err.offset), str(err.length),
361
372
                str(err.actual))
390
401
    elif isinstance(err, errors.TokenMismatch):
391
402
        return ('TokenMismatch', err.given_token, err.lock_token)
392
403
    elif isinstance(err, errors.LockContention):
393
 
        return ('LockContention', err.lock, err.msg)
 
404
        return ('LockContention',)
394
405
    # Unserialisable error.  Log it, and return a generic error
395
406
    trace.log_exception_quietly()
396
407
    return ('error', str(err))
443
454
    'Branch.get_tags_bytes', 'bzrlib.smart.branch',
444
455
    'SmartServerBranchGetTagsBytes')
445
456
request_handlers.register_lazy(
 
457
    'Branch.set_tags_bytes', 'bzrlib.smart.branch',
 
458
    'SmartServerBranchSetTagsBytes')
 
459
request_handlers.register_lazy(
446
460
    'Branch.get_stacked_on_url', 'bzrlib.smart.branch', 'SmartServerBranchRequestGetStackedOnURL')
447
461
request_handlers.register_lazy(
448
462
    'Branch.last_revision_info', 'bzrlib.smart.branch', 'SmartServerBranchRequestLastRevisionInfo')
490
504
    'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
491
505
    'SmartServerRequestInitializeBzrDir')
492
506
request_handlers.register_lazy(
 
507
    'BzrDirFormat.initialize_ex_1.16', 'bzrlib.smart.bzrdir',
 
508
    'SmartServerRequestBzrDirInitializeEx')
 
509
request_handlers.register_lazy(
493
510
    'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')
494
511
request_handlers.register_lazy(
495
512
    'BzrDir.open_branch', 'bzrlib.smart.bzrdir',
539
556
request_handlers.register_lazy(
540
557
    'Repository.insert_stream', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream')
541
558
request_handlers.register_lazy(
 
559
    'Repository.insert_stream_1.19', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream_1_19')
 
560
request_handlers.register_lazy(
542
561
    'Repository.insert_stream_locked', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStreamLocked')
543
562
request_handlers.register_lazy(
544
563
    'Repository.is_shared', 'bzrlib.smart.repository', 'SmartServerRepositoryIsShared')
550
569
request_handlers.register_lazy(
551
570
    'Repository.unlock', 'bzrlib.smart.repository', 'SmartServerRepositoryUnlock')
552
571
request_handlers.register_lazy(
 
572
    'Repository.get_rev_id_for_revno', 'bzrlib.smart.repository',
 
573
    'SmartServerRepositoryGetRevIdForRevno')
 
574
request_handlers.register_lazy(
553
575
    'Repository.get_stream', 'bzrlib.smart.repository',
554
576
    'SmartServerRepositoryGetStream')
555
577
request_handlers.register_lazy(
 
578
    'Repository.get_stream_1.19', 'bzrlib.smart.repository',
 
579
    'SmartServerRepositoryGetStream_1_19')
 
580
request_handlers.register_lazy(
556
581
    'Repository.tarball', 'bzrlib.smart.repository',
557
582
    'SmartServerRepositoryTarball')
558
583
request_handlers.register_lazy(