~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testremotebranch.py

for remote gets fallback from foo.gz to foo in RemoteStore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
from bzrlib.selftest.testrevision import make_branches
18
18
from bzrlib.trace import mutter
19
19
from bzrlib.branch import Branch, find_branch
 
20
import gzip
20
21
import sys
21
22
import os
22
23
 
33
34
            
34
35
        #highest indices a: 5, b: 7
35
36
        br_a, br_b = make_branches()
 
37
        # unpack one of br_a's revision files to test .gz fallbacks
 
38
        to_unzip = br_a.revision_history()[-1]
 
39
        to_unzip_source = gzip.open(os.path.join(br_a.base, '.bzr', 
 
40
                                                  'revision-store',
 
41
                                                  to_unzip + '.gz'))
 
42
        content = to_unzip_source.read()
 
43
        to_unzip_source.close()
 
44
        os.unlink(os.path.join(br_a.base, '.bzr', 'revision-store',
 
45
                               to_unzip + '.gz'))
 
46
        to_unzip_output = open(os.path.join(br_a.base, '.bzr', 
 
47
                                             'revision-store', to_unzip), 'wb')
 
48
        to_unzip_output.write(content)
 
49
        to_unzip_output.close()
 
50
        
36
51
        br_rem = Branch.open(self.get_remote_url(br_a.base))
37
52
        assert not has_revision(br_b, br_rem.revision_history()[3])
38
53
        assert has_revision(br_b, br_rem.revision_history()[2])