~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert J. Tanner
  • Date: 2009-06-10 03:56:49 UTC
  • mfrom: (4423 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4425.
  • Revision ID: tanner@real-time.com-20090610035649-7rfx4cls4550zc3c
Merge 1.15.1 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from bzrlib.branch import (
24
24
    Branch,
 
25
    InterBranch,
25
26
    )
26
27
from bzrlib.bzrdir import (
27
28
    BzrDirFormat,
38
39
    )
39
40
from bzrlib.tests.test_foreign import (
40
41
    DummyForeignVcsDirFormat,
 
42
    InterToDummyVcsBranch,
41
43
    )
42
44
 
43
45
 
45
47
 
46
48
    def setUp(self):
47
49
        BzrDirFormat.register_control_format(DummyForeignVcsDirFormat)
 
50
        InterBranch.register_optimiser(InterToDummyVcsBranch)
48
51
        self.addCleanup(self.unregister_format)
49
52
        super(TestDpush, self).setUp()
50
53
 
53
56
            BzrDirFormat.unregister_control_format(DummyForeignVcsDirFormat)
54
57
        except ValueError:
55
58
            pass
 
59
        InterBranch.unregister_optimiser(InterToDummyVcsBranch)
56
60
 
57
61
    def make_dummy_builder(self, relpath):
58
62
        builder = self.make_branch_builder(relpath, 
67
71
        source_tree = self.make_branch_and_tree("dc")
68
72
        output, error = self.run_bzr("dpush -d dc dp", retcode=3)
69
73
        self.assertEquals("", output)
70
 
        self.assertContainsRe(error, 'not a foreign branch, use regular push')
 
74
        self.assertContainsRe(error, 'in the same VCS, lossy push not necessary. Please use regular push.')
71
75
 
72
76
    def test_dpush(self):
73
77
        branch = self.make_dummy_builder('d').get_branch()
76
80
        self.build_tree(("dc/foo", "blaaaa"))
77
81
        dc.open_workingtree().commit('msg')
78
82
 
79
 
        self.check_output("", "dpush -d dc d")
 
83
        output, error = self.run_bzr("dpush -d dc d")
 
84
        self.assertEquals(error, "Pushed up to revision 2.\n")
80
85
        self.check_output("", "status dc")
81
86
 
82
87
    def test_dpush_new(self):