53
53
status._show_shelve_summary,
56
def assertStatus(self, expected_lines, working_tree, specific_files=None,
56
def assertStatus(self, expected_lines, working_tree,
57
57
revision=None, short=False, pending=True, verbose=False):
58
58
"""Run status in working_tree and look for output.
60
60
:param expected_lines: The lines to look for.
61
61
:param working_tree: The tree to run status in.
63
output_string = self.status_string(working_tree, specific_files, revision, short,
63
output_string = self.status_string(working_tree, revision, short,
65
65
self.assertEqual(expected_lines, output_string.splitlines(True))
67
def status_string(self, wt, specific_files=None, revision=None,
68
short=False, pending=True, verbose=False):
67
def status_string(self, wt, revision=None, short=False, pending=True,
69
69
# use a real file rather than StringIO because it doesn't handle
70
70
# Unicode very well.
71
71
tof = codecs.getwriter('utf-8')(TemporaryFile())
72
show_tree_status(wt, specific_files=specific_files, to_file=tof,
73
revision=revision, short=short, show_pending=pending,
72
show_tree_status(wt, to_file=tof, revision=revision, short=short,
73
show_pending=pending, verbose=verbose)
76
75
return tof.read().decode('utf-8')
572
571
self.run_bzr(['shelve', '--all', '-m', 'bar'])
573
self.build_tree(['eggs.c', 'spam.c'])
572
self.build_tree(['spam.c'])
576
574
self.assertStatus([
580
577
'2 shelves exist. See "bzr shelve --list" for details.\n',
588
specific_files=['spam.c'])
591
582
class CheckoutStatus(BranchStatus):
598
589
def make_branch_and_tree(self, relpath):
599
590
source = self.make_branch(pathjoin('..', relpath))
600
591
checkout = bzrdir.BzrDirMetaFormat1().initialize(relpath)
601
checkout.set_branch_reference(source)
592
bzrlib.branch.BranchReferenceFormat().initialize(checkout,
593
target_branch=source)
602
594
return checkout.create_workingtree()