/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: Andrew Bennetts
  • Date: 2008-11-14 05:55:31 UTC
  • mto: This revision was merged to the branch mainline in revision 3853.
  • Revision ID: andrew.bennetts@canonical.com-20081114055531-5wtu6kx89ilt02yj
Preserve BzrBranch5's _synchronize_history code without affecting Branch or BzrBranch7; add effort test for RemoteBranch.copy_content_into.

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,
1750
1751
                'message')
1751
1752
        finally:
1752
1753
            remote_repo.unlock()
 
1754
 
 
1755
 
 
1756
class TestRemoteBranchEffort(tests.TestCaseWithTransport):
 
1757
 
 
1758
    def setUp(self):
 
1759
        super(TestRemoteBranchEffort, self).setUp()
 
1760
        # Create a smart server that publishes whatever the backing VFS server
 
1761
        # does.
 
1762
        self.smart_server = server.SmartTCPServer_for_testing()
 
1763
        self.smart_server.setUp(self.get_server())
 
1764
        self.addCleanup(self.smart_server.tearDown)
 
1765
        # Log all HPSS calls into self.hpss_calls.
 
1766
        _SmartClient.hooks.install_named_hook(
 
1767
            'call', self.capture_hpss_call, None)
 
1768
        self.hpss_calls = []
 
1769
 
 
1770
    def capture_hpss_call(self, params):
 
1771
        self.hpss_calls.append(params.method)
 
1772
 
 
1773
    def test_copy_content_into_avoids_revision_history(self):
 
1774
        local = self.make_branch('local')
 
1775
        remote_backing_tree = self.make_branch_and_tree('remote')
 
1776
        remote_backing_tree.commit("Commit.")
 
1777
        remote_branch_url = self.smart_server.get_url() + 'remote'
 
1778
        remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch()
 
1779
        local.repository.fetch(remote_branch.repository)
 
1780
        self.hpss_calls = []
 
1781
        remote_branch.copy_content_into(local)
 
1782
        self.assert_('Branch.revision_history' not in self.hpss_calls)
 
1783