/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2010-04-08 07:01:10 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5141.
  • Revision ID: andrew.bennetts@canonical.com-20100408070110-mnvv0kbbyaj6cqdg
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
596
596
        result2 = self.run_bzr("status -SV -r 0..")[0]
597
597
        self.assertEquals(result2, result)
598
598
 
599
 
    def assertStatusContains(self, pattern):
 
599
    def assertStatusContains(self, pattern, short=False):
600
600
        """Run status, and assert it contains the given pattern"""
601
 
        result = self.run_bzr("status --short")[0]
 
601
        if short:
 
602
            result = self.run_bzr("status --short")[0]
 
603
        else:
 
604
            result = self.run_bzr("status")[0]
602
605
        self.assertContainsRe(result, pattern)
603
606
 
 
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
 
604
621
    def test_kind_change_short(self):
605
622
        tree = self.make_branch_and_tree('.')
606
623
        self.build_tree(['file'])
608
625
        tree.commit('added file')
609
626
        unlink('file')
610
627
        self.build_tree(['file/'])
611
 
        self.assertStatusContains('K  file => file/')
 
628
        self.assertStatusContains('K  file => file/',
 
629
                                   short=True)
612
630
        tree.rename_one('file', 'directory')
613
 
        self.assertStatusContains('RK  file => directory/')
 
631
        self.assertStatusContains('RK  file => directory/',
 
632
                                   short=True)
614
633
        rmdir('directory')
615
 
        self.assertStatusContains('RD  file => directory')
 
634
        self.assertStatusContains('RD  file => directory',
 
635
                                   short=True)
616
636
 
617
637
    def test_status_illegal_revision_specifiers(self):
618
638
        out, err = self.run_bzr('status -r 1..23..123', retcode=3)