~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_dpush.py

(gz) Fix test failure on alpha by correcting format string for
 gc_chk_sha1_record (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Black-box tests for bzr dpush."""
19
19
 
20
20
 
 
21
import os
 
22
 
21
23
from bzrlib import (
 
24
    branch,
 
25
    bzrdir,
 
26
    foreign,
22
27
    tests,
 
28
    workingtree,
23
29
    )
24
30
from bzrlib.tests import (
 
31
    blackbox,
25
32
    script,
26
33
    test_foreign,
27
34
    )
53
60
        source_tree = self.make_branch_and_tree("dc")
54
61
        output, error = self.run_bzr("dpush -d dc dp", retcode=3)
55
62
        self.assertEquals("", output)
56
 
        self.assertContainsRe(error,
57
 
            'in the same VCS, lossy push not necessary. Please use regular '
58
 
            'push.')
 
63
        self.assertContainsRe(error, 'in the same VCS, lossy push not necessary. Please use regular push.')
59
64
 
60
65
    def test_dpush(self):
61
66
        branch = self.make_dummy_builder('d').get_branch()
66
71
 
67
72
        script.run_script(self, """
68
73
            $ bzr dpush -d dc d
69
 
            2>Doing on-the-fly conversion from DummyForeignVcsRepositoryFormat() to RepositoryFormat2a().
70
 
            2>This may take some time. Upgrade the repositories to the same format for better performance.
71
74
            2>Pushed up to revision 2.
72
75
            $ bzr status dc
73
76
            """)
83
86
 
84
87
        script.run_script(self, '''
85
88
            $ bzr dpush -d dc d
86
 
            2>Doing on-the-fly conversion from DummyForeignVcsRepositoryFormat() to RepositoryFormat2a().
87
 
            2>This may take some time. Upgrade the repositories to the same format for better performance.
88
89
            2>Pushed up to revision 2.
89
90
            $ bzr revno dc
90
91
            2
103
104
        self.build_tree_contents([("dc/foofile", "blaaaal")])
104
105
        script.run_script(self, '''
105
106
            $ bzr dpush -d dc d --no-strict
106
 
            2>Doing on-the-fly conversion from DummyForeignVcsRepositoryFormat() to RepositoryFormat2a().
107
 
            2>This may take some time. Upgrade the repositories to the same format for better performance.
108
107
            2>Pushed up to revision 2.
109
108
            ''')
110
109
        self.assertFileEqual("blaaaal", "dc/foofile")
146
145
    def set_config_push_strict(self, value):
147
146
        # set config var (any of bazaar.conf, locations.conf, branch.conf
148
147
        # should do)
149
 
        conf = self.tree.branch.get_config_stack()
150
 
        conf.set('dpush_strict', value)
 
148
        conf = self.tree.branch.get_config()
 
149
        conf.set_user_option('dpush_strict', value)
151
150
 
152
151
    _default_command = ['dpush', '../to']
153
152