44
44
class BranchStatus(TestCaseWithTransport):
46
46
def assertStatus(self, expected_lines, working_tree,
47
revision=None, short=False):
47
revision=None, short=False, pending=True):
48
48
"""Run status in working_tree and look for output.
50
50
:param expected_lines: The lines to look for.
51
51
:param working_tree: The tree to run status in.
53
output_string = self.status_string(working_tree, revision, short)
53
output_string = self.status_string(working_tree, revision, short,
54
55
self.assertEqual(expected_lines, output_string.splitlines(True))
56
def status_string(self, wt, revision=None, short=False):
57
def status_string(self, wt, revision=None, short=False, pending=True):
57
58
# use a real file rather than StringIO because it doesn't handle
58
59
# Unicode very well.
59
60
tof = codecs.getwriter('utf-8')(TemporaryFile())
60
show_tree_status(wt, to_file=tof, revision=revision, short=short)
61
show_tree_status(wt, to_file=tof, revision=revision, short=short,
62
64
return tof.read().decode('utf-8')
102
104
'P pending@pending-0-0\n',
117
wt, short=True, pending=False)
106
119
def test_branch_status_revisions(self):
107
120
"""Tests branch status with revisions"""
415
428
out, err = self.run_bzr('status -r 1..23..123', retcode=3)
416
429
self.assertContainsRe(err, 'one or two revision specifiers')
431
def test_status_no_pending(self):
432
a_tree = self.make_branch_and_tree('a')
433
self.build_tree(['a/a'])
436
b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
437
self.build_tree(['b/b'])
442
self.run_bzr('merge ../b')
443
out, err = self.run_bzr('status --no-pending')
444
self.assertEquals(out, "added:\n b\n")
419
448
class TestStatusEncodings(TestCaseWithTransport):