~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2009-01-30 23:26:10 UTC
  • mto: (3920.2.35 dpush)
  • mto: This revision was merged to the branch mainline in revision 4281.
  • Revision ID: jelmer@samba.org-20090130232610-knnqh8vpht9o5d79
Add a DummyForeignVcsDir class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from bzrlib.branch import Branch
20
20
from bzrlib.bzrdir import BzrDirFormat
 
21
from bzrlib.foreign import ForeignBranch, ForeignRepository
21
22
from bzrlib.repository import Repository
22
 
from bzrlib.foreign import ForeignBranch, ForeignRepository
23
23
from bzrlib.tests.blackbox import ExternalBase
24
 
from bzrlib.tests.test_foreign import DummyForeignVcsBzrDirFormat
 
24
from bzrlib.tests.test_foreign import DummyForeignVcsDirFormat
 
25
 
 
26
import os
25
27
 
26
28
class TestDpush(ExternalBase):
27
29
 
28
30
    def setUp(self):
 
31
        BzrDirFormat.register_control_format(DummyForeignVcsDirFormat)
29
32
        super(TestDpush, self).setUp()
30
 
        BzrDirFormat.register_control_format(DummyForeignVcsBzrDirFormat)
31
33
 
32
34
    def tearDown(self):
33
 
        super(TestDpush, self).tearDown()
34
35
        try:
35
 
            BzrDirFormat.unregister_control_format(DummyForeignVcsBzrDirFormat)
 
36
            BzrDirFormat.unregister_control_format(DummyForeignVcsDirFormat)
36
37
        except ValueError:
37
38
            pass
 
39
        super(TestDpush, self).tearDown()
38
40
 
39
41
    def test_dpush_empty(self):
40
 
        tree = self.make_branch_and_tree("dp", format=DummyForeignVcsBzrDirFormat)
 
42
        tree = self.make_branch_and_tree("dp", 
 
43
            format=DummyForeignVcsDirFormat())
41
44
        self.run_bzr("init --rich-root-pack dc")
42
 
        os.chdir("dc")
43
 
        self.run_bzr("dpush %s" % repos_url)
 
45
        self.run_bzr("dpush -d dc dp")
44
46
 
45
47
    def test_dpush(self):
46
 
        tree = self.make_branch_and_tree("d", format=DummyForeignVcsBzrDirFormat)
 
48
        tree = self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
47
49
 
48
50
        self.build_tree(("d/foo", "bar"))
49
51
        tree.add("foo")
50
52
        tree.commit("msg")
51
53
 
52
 
        self.run_bzr("branch %s dc" % repos_url)
 
54
        self.run_bzr("branch d dc")
53
55
        self.build_tree(("dc/foo", "blaaaa"))
54
56
        self.run_bzr("commit -m msg dc")
55
 
        self.run_bzr("dpush -d dc %s" % repos_url)
 
57
        self.run_bzr("dpush -d dc d")
56
58
        self.check_output("", "status dc")
57
59
 
58
60
    def test_dpush_new(self):
59
 
        tree = self.make_branch_and_tree("d", format=DummyForeignVcsBzrDirFormat)
 
61
        tree = self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
60
62
 
61
63
        self.build_tree(("d/foo", "bar"))
62
64
        tree.add("foo")
63
65
        tree.commit("msg")
64
66
 
65
 
        self.run_bzr("branch %s dc" % repos_url)
 
67
        self.run_bzr("branch d dc")
66
68
        self.build_tree(("dc/foofile", "blaaaa"))
67
69
        self.run_bzr("add dc/foofile")
68
70
        self.run_bzr("commit -m msg dc")
69
 
        self.run_bzr("dpush -d dc %s" % repos_url)
 
71
        self.run_bzr("dpush -d dc d")
70
72
        self.check_output("3\n", "revno dc")
71
73
        self.check_output("", "status dc")
72
74
 
73
75
    def test_dpush_wt_diff(self):
74
 
        tree = self.make_branch_and_tree("d", format=DummyForeignVcsBzrDirFormat)
 
76
        tree = self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
75
77
        
76
78
        self.build_tree(("d/foo", "bar"))
77
79
        tree.add("foo")
78
80
        tree.commit("msg")
79
81
 
80
 
        self.run_bzr("branch %s dc" % repos_url)
 
82
        self.run_bzr("branch d dc")
81
83
        self.build_tree({"dc/foofile": "blaaaa"})
82
84
        self.run_bzr("add dc/foofile")
83
85
        self.run_bzr("commit -m msg dc")
84
86
        self.build_tree({"dc/foofile": "blaaaal"})
85
 
        self.run_bzr("dpush -d dc %s" % repos_url)
 
87
        self.run_bzr("dpush -d dc d")
86
88
        self.check_output('modified:\n  foofile\n', "status dc")