~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Alexander Belchenko
  • Date: 2012-03-29 08:34:13 UTC
  • mto: (6015.44.14 2.4)
  • mto: This revision was merged to the branch mainline in revision 6513.
  • Revision ID: bialix@ukr.net-20120329083413-d4bqqdtfn2yrxp4f
change st_dev, st_ino, st_uid, st_gid from int members to properties.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
            status._show_shelve_summary,
54
54
            'bzr status')
55
55
 
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.
59
59
 
60
60
        :param expected_lines: The lines to look for.
61
61
        :param working_tree: The tree to run status in.
62
62
        """
63
 
        output_string = self.status_string(working_tree, specific_files, revision, short,
 
63
        output_string = self.status_string(working_tree, revision, short,
64
64
                pending, verbose)
65
65
        self.assertEqual(expected_lines, output_string.splitlines(True))
66
66
 
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,
 
68
        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, specific_files=specific_files, to_file=tof,
73
 
                revision=revision, short=short, show_pending=pending,
74
 
                verbose=verbose)
 
72
        show_tree_status(wt, to_file=tof, revision=revision, short=short,
 
73
                show_pending=pending, verbose=verbose)
75
74
        tof.seek(0)
76
75
        return tof.read().decode('utf-8')
77
76
 
570
569
            ],
571
570
            wt)
572
571
        self.run_bzr(['shelve', '--all', '-m', 'bar'])
573
 
        self.build_tree(['eggs.c', 'spam.c'])
574
 
        wt.add('eggs.c')
 
572
        self.build_tree(['spam.c'])
575
573
        wt.add('spam.c')
576
574
        self.assertStatus([
577
575
                'added:\n',
578
 
                '  eggs.c\n',
579
576
                '  spam.c\n',
580
577
                '2 shelves exist. See "bzr shelve --list" for details.\n',
581
578
            ],
582
579
            wt)
583
 
        self.assertStatus([
584
 
                'added:\n',
585
 
                '  spam.c\n',
586
 
            ],
587
 
            wt,
588
 
            specific_files=['spam.c'])
589
580
 
590
581
 
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()
603
595
 
604
596