~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(vila) Revise legal option names to be less drastic. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

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