/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/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-11-25 19:18:11 UTC
  • mfrom: (3834.3.3 remote_revision_history)
  • Revision ID: pqm@pqm.ubuntu.com-20081125191811-pwwzoldg0s0wkze8
Branching from Remote no longer reads the full revision history.
        (Andrew Bennetts, jam)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from cStringIO import StringIO
28
28
 
29
29
from bzrlib import (
 
30
    bzrdir,
30
31
    config,
31
32
    errors,
32
33
    graph,
1787
1788
        branch = self.prepare_stacked_remote_branch()
1788
1789
        repo = branch.repository
1789
1790
        self.assertEqual([], repo._get_parent_map(['rev1']).keys())
 
1791
 
 
1792
 
 
1793
class TestRemoteBranchEffort(tests.TestCaseWithTransport):
 
1794
 
 
1795
    def setUp(self):
 
1796
        super(TestRemoteBranchEffort, self).setUp()
 
1797
        # Create a smart server that publishes whatever the backing VFS server
 
1798
        # does.
 
1799
        self.smart_server = server.SmartTCPServer_for_testing()
 
1800
        self.smart_server.setUp(self.get_server())
 
1801
        self.addCleanup(self.smart_server.tearDown)
 
1802
        # Log all HPSS calls into self.hpss_calls.
 
1803
        _SmartClient.hooks.install_named_hook(
 
1804
            'call', self.capture_hpss_call, None)
 
1805
        self.hpss_calls = []
 
1806
 
 
1807
    def capture_hpss_call(self, params):
 
1808
        self.hpss_calls.append(params.method)
 
1809
 
 
1810
    def test_copy_content_into_avoids_revision_history(self):
 
1811
        local = self.make_branch('local')
 
1812
        remote_backing_tree = self.make_branch_and_tree('remote')
 
1813
        remote_backing_tree.commit("Commit.")
 
1814
        remote_branch_url = self.smart_server.get_url() + 'remote'
 
1815
        remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch()
 
1816
        local.repository.fetch(remote_branch.repository)
 
1817
        self.hpss_calls = []
 
1818
        remote_branch.copy_content_into(local)
 
1819
        self.assertFalse('Branch.revision_history' in self.hpss_calls)