~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ian Clatworthy
  • Date: 2009-07-02 08:26:00 UTC
  • mto: (4527.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4529.
  • Revision ID: ian.clatworthy@canonical.com-20090702082600-qwb1evvvfa8ctnye
first draft of a 2.0 Upgrade Guide

Show diffs side-by-side

added added

removed removed

Lines of Context:
498
498
    def make_branch_and_tree(self, relpath):
499
499
        source = self.make_branch(pathjoin('..', relpath))
500
500
        checkout = bzrdir.BzrDirMetaFormat1().initialize(relpath)
501
 
        bzrlib.branch.BranchReferenceFormat().initialize(checkout,
502
 
            target_branch=source)
 
501
        bzrlib.branch.BranchReferenceFormat().initialize(checkout, source)
503
502
        return checkout.create_workingtree()
504
503
 
505
504
 
596
595
        result2 = self.run_bzr("status -SV -r 0..")[0]
597
596
        self.assertEquals(result2, result)
598
597
 
599
 
    def assertStatusContains(self, pattern, short=False):
 
598
    def assertStatusContains(self, pattern):
600
599
        """Run status, and assert it contains the given pattern"""
601
 
        if short:
602
 
            result = self.run_bzr("status --short")[0]
603
 
        else:
604
 
            result = self.run_bzr("status")[0]
 
600
        result = self.run_bzr("status --short")[0]
605
601
        self.assertContainsRe(result, pattern)
606
602
 
607
 
    def test_kind_change_plain(self):
608
 
        tree = self.make_branch_and_tree('.')
609
 
        self.build_tree(['file'])
610
 
        tree.add('file')
611
 
        tree.commit('added file')
612
 
        unlink('file')
613
 
        self.build_tree(['file/'])
614
 
        self.assertStatusContains('kind changed:\n  file \(file => directory\)')
615
 
        tree.rename_one('file', 'directory')
616
 
        self.assertStatusContains('renamed:\n  file/ => directory/\n' \
617
 
                                  'modified:\n  directory/\n')
618
 
        rmdir('directory')
619
 
        self.assertStatusContains('removed:\n  file\n')
620
 
 
621
603
    def test_kind_change_short(self):
622
604
        tree = self.make_branch_and_tree('.')
623
605
        self.build_tree(['file'])
625
607
        tree.commit('added file')
626
608
        unlink('file')
627
609
        self.build_tree(['file/'])
628
 
        self.assertStatusContains('K  file => file/',
629
 
                                   short=True)
 
610
        self.assertStatusContains('K  file => file/')
630
611
        tree.rename_one('file', 'directory')
631
 
        self.assertStatusContains('RK  file => directory/',
632
 
                                   short=True)
 
612
        self.assertStatusContains('RK  file => directory/')
633
613
        rmdir('directory')
634
 
        self.assertStatusContains('RD  file => directory',
635
 
                                   short=True)
 
614
        self.assertStatusContains('RD  file => directory')
636
615
 
637
616
    def test_status_illegal_revision_specifiers(self):
638
617
        out, err = self.run_bzr('status -r 1..23..123', retcode=3)