53
53
status._show_shelve_summary,
56
def assertStatus(self, expected_lines, working_tree,
56
def assertStatus(self, expected_lines, working_tree, specific_files=None,
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, revision, short,
63
output_string = self.status_string(working_tree, specific_files, revision, short,
65
65
self.assertEqual(expected_lines, output_string.splitlines(True))
67
def status_string(self, wt, revision=None, short=False, pending=True,
67
def status_string(self, wt, specific_files=None, revision=None,
68
short=False, pending=True, verbose=False):
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, to_file=tof, revision=revision, short=short,
73
show_pending=pending, verbose=verbose)
72
show_tree_status(wt, specific_files=specific_files, to_file=tof,
73
revision=revision, short=short, show_pending=pending,
75
76
return tof.read().decode('utf-8')
571
572
self.run_bzr(['shelve', '--all', '-m', 'bar'])
572
self.build_tree(['spam.c'])
573
self.build_tree(['eggs.c', 'spam.c'])
574
576
self.assertStatus([
577
580
'2 shelves exist. See "bzr shelve --list" for details.\n',
588
specific_files=['spam.c'])
582
591
class CheckoutStatus(BranchStatus):
589
598
def make_branch_and_tree(self, relpath):
590
599
source = self.make_branch(pathjoin('..', relpath))
591
600
checkout = bzrdir.BzrDirMetaFormat1().initialize(relpath)
592
bzrlib.branch.BranchReferenceFormat().initialize(checkout,
593
target_branch=source)
601
checkout.set_branch_reference(source)
594
602
return checkout.create_workingtree()