/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/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-18 11:49:47 UTC
  • mfrom: (6278 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6279.
  • Revision ID: jelmer@samba.org-20111118114947-y0run8g5xlwa6h8i
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
333
333
 
334
334
        :param repository: The repository to query in.
335
335
        :param revision_id: The utf8 encoded revision_id to lookup.
336
 
        :return: A smart server response of ('ok', ) if the revision is
337
 
            present.
 
336
        :return: A smart server response of ('yes', ) if the revision is
 
337
            present. ('no', ) if it is missing.
338
338
        """
339
339
        if repository.has_revision(revision_id):
340
340
            return SuccessfulSmartServerResponse(('yes', ))
342
342
            return SuccessfulSmartServerResponse(('no', ))
343
343
 
344
344
 
 
345
class SmartServerRequestHasSignatureForRevisionId(
 
346
        SmartServerRepositoryRequest):
 
347
 
 
348
    def do_repository_request(self, repository, revision_id):
 
349
        """Return ok if a signature is present for a revision.
 
350
 
 
351
        Introduced in bzr 2.5.0.
 
352
 
 
353
        :param repository: The repository to query in.
 
354
        :param revision_id: The utf8 encoded revision_id to lookup.
 
355
        :return: A smart server response of ('yes', ) if a
 
356
            signature for the revision is present,
 
357
            ('no', ) if it is missing.
 
358
        """
 
359
        try:
 
360
            if repository.has_signature_for_revision_id(revision_id):
 
361
                return SuccessfulSmartServerResponse(('yes', ))
 
362
            else:
 
363
                return SuccessfulSmartServerResponse(('no', ))
 
364
        except errors.NoSuchRevision:
 
365
            return FailedSmartServerResponse(
 
366
                ('nosuchrevision', revision_id))
 
367
 
 
368
 
345
369
class SmartServerRepositoryGatherStats(SmartServerRepositoryRequest):
346
370
 
347
371
    def do_repository_request(self, repository, revid, committers):
399
423
            return SuccessfulSmartServerResponse(('no', ))
400
424
 
401
425
 
 
426
class SmartServerRepositoryMakeWorkingTrees(SmartServerRepositoryRequest):
 
427
 
 
428
    def do_repository_request(self, repository):
 
429
        """Return the result of repository.make_working_trees().
 
430
 
 
431
        Introduced in bzr 2.5.0.
 
432
 
 
433
        :param repository: The repository to query in.
 
434
        :return: A smart server response of ('yes', ) if the repository uses
 
435
            working trees, and ('no', ) if it is not.
 
436
        """
 
437
        if repository.make_working_trees():
 
438
            return SuccessfulSmartServerResponse(('yes', ))
 
439
        else:
 
440
            return SuccessfulSmartServerResponse(('no', ))
 
441
 
 
442
 
402
443
class SmartServerRepositoryLockWrite(SmartServerRepositoryRequest):
403
444
 
404
445
    def do_repository_request(self, repository, token=''):