~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart.py

  • Committer: Robert Collins
  • Date: 2008-02-03 22:55:08 UTC
  • mto: This revision was merged to the branch mainline in revision 3216.
  • Revision ID: robertc@robertcollins.net-20080203225508-0rogbg0ggonuqfhp
Change the smart server get_parents method to take a graph search to exclude already recieved parents from. This prevents history shortcuts causing huge numbers of duplicates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
import bzrlib.smart.bzrdir
38
38
import bzrlib.smart.branch
39
39
import bzrlib.smart.repository
 
40
from bzrlib.tuned_gzip import bytes_to_gzip
40
41
from bzrlib.util import bencode
41
42
 
42
43
 
529
530
            request.execute, backing.local_abspath('subdir'))
530
531
 
531
532
 
 
533
class TestSmartServerRepositoryGetParentMap(tests.TestCaseWithTransport):
 
534
 
 
535
    def test_trivial_gzipped(self):
 
536
        # This tests that the wire encoding is actually gzipped
 
537
        backing = self.get_transport()
 
538
        request = smart.repository.SmartServerRepositoryGetParentMap(backing)
 
539
        tree = self.make_branch_and_memory_tree('.')
 
540
 
 
541
        self.assertEqual(None,
 
542
            request.execute(backing.local_abspath(''), 'missing-id'))
 
543
        # Note that it returns a body (of '' gzipped).
 
544
        self.assertEqual(
 
545
            SuccessfulSmartServerResponse(('ok', ), bytes_to_gzip('')),
 
546
            request.do_body('\n\n0\n'))
 
547
 
 
548
 
532
549
class TestSmartServerRepositoryGetRevisionGraph(tests.TestCaseWithTransport):
533
550
 
534
551
    def test_none_argument(self):