~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_status.py

Merge from integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
"""
22
22
 
23
23
 
24
 
from bzrlib.selftest import TestCaseInTempDir
 
24
from bzrlib.tests import TestCaseInTempDir
25
25
from bzrlib.revisionspec import RevisionSpec
26
26
from bzrlib.merge import merge
27
27
from cStringIO import StringIO
47
47
 
48
48
        tof = StringIO()
49
49
        self.build_tree(['hello.c', 'bye.c'])
50
 
        b.add_pending_merge('pending@pending-0-0')
 
50
        b.working_tree().add_pending_merge('pending@pending-0-0')
51
51
        show_status(b, to_file=tof)
52
52
        tof.seek(0)
53
53
        self.assertEquals(tof.readlines(),
65
65
 
66
66
        tof = StringIO()
67
67
        self.build_tree(['hello.c', 'bye.c'])
68
 
        b.add('hello.c')
69
 
        b.add('bye.c')
70
 
        b.commit('Test message')
 
68
        b.working_tree().add('hello.c')
 
69
        b.working_tree().add('bye.c')
 
70
        b.working_tree().commit('Test message')
71
71
 
72
72
        tof = StringIO()
73
73
        revs =[]
82
82
                           '  hello.c\n'])
83
83
 
84
84
        self.build_tree(['more.c'])
85
 
        b.add('more.c')
86
 
        b.commit('Another test message')
 
85
        b.working_tree().add('more.c')
 
86
        b.working_tree().commit('Another test message')
87
87
        
88
88
        tof = StringIO()
89
89
        revs.append(RevisionSpec(1))
106
106
        """Pending merges display works"""
107
107
        mkdir("./branch")
108
108
        b = Branch.initialize('./branch')
109
 
        b.commit("Empty commit 1")
 
109
        b.working_tree().commit("Empty commit 1")
110
110
        b_2 = copy_branch(b, './copy')
111
 
        b.commit("Empty commit 2")
 
111
        b.working_tree().commit("Empty commit 2")
112
112
        merge(["./branch", -1], [None, None], this_dir = './copy')
113
113
        message = self.status_string(b_2)
114
114
        self.assert_(message.startswith("pending merges:\n"))
115
115
        self.assert_(message.endswith("Empty commit 2\n")) 
116
 
        b_2.commit("merged")
 
116
        b_2.working_tree().commit("merged")
117
117
        # must be long to make sure we see elipsis at the end
118
 
        b.commit("Empty commit 3 blah blah blah blah blah blah blah blah blah"
 
118
        b.working_tree().commit("Empty commit 3 blah blah blah blah blah blah blah blah blah"
119
119
                 " blah blah blah blah blah blah bleh")
120
120
        merge(["./branch", -1], [None, None], this_dir = './copy')
121
121
        message = self.status_string(b_2)
132
132
        b = Branch.initialize('.')
133
133
 
134
134
        self.build_tree(['directory/','directory/hello.c', 'bye.c','test.c','dir2/'])
135
 
        b.add('directory')
136
 
        b.add('test.c')
137
 
        b.commit('testing')
 
135
        b.working_tree().add('directory')
 
136
        b.working_tree().add('test.c')
 
137
        b.working_tree().commit('testing')
138
138
        
139
139
        tof = StringIO()
140
140
        show_status(b, to_file=tof)