~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2011-07-06 09:22:00 UTC
  • mfrom: (6008 +trunk)
  • mto: (6012.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6013.
  • Revision ID: v.ladeuil+lp@free.fr-20110706092200-7iai2mwzc0sqdsvf
MergingĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
        wt.add('FILE_D')
325
325
        wt.add('FILE_E')
326
326
        wt.commit('Create five empty files.')
327
 
        open('FILE_B', 'w').write('Modification to file FILE_B.')
328
 
        open('FILE_C', 'w').write('Modification to file FILE_C.')
 
327
        with open('FILE_B', 'w') as f: f.write('Modification to file FILE_B.')
 
328
        with open('FILE_C', 'w') as f: f.write('Modification to file FILE_C.')
329
329
        unlink('FILE_E')  # FILE_E will be versioned but missing
330
 
        open('FILE_Q', 'w').write('FILE_Q is added but not committed.')
 
330
        with open('FILE_Q', 'w') as f: f.write('FILE_Q is added but not committed.')
331
331
        wt.add('FILE_Q')  # FILE_Q will be added but not committed
332
332
        open('UNVERSIONED_BUT_EXISTING', 'w')
333
333
        return wt
477
477
          ' M  FILE_B\n',
478
478
          'X   NONEXISTENT\n',
479
479
          ]
 
480
        expected.sort()
480
481
        out, err = self.run_bzr('status --short NONEXISTENT '
481
482
                                'FILE_A FILE_B UNVERSIONED_BUT_EXISTING '
482
483
                                'FILE_C FILE_D FILE_E FILE_Q', retcode=3)
483
 
        self.assertEqual(expected, out.splitlines(True))
 
484
        actual = out.splitlines(True)
 
485
        actual.sort()
 
486
        self.assertEqual(expected, actual)
484
487
        self.assertContainsRe(err,
485
488
                              r'.*ERROR: Path\(s\) do not exist: '
486
489
                              'NONEXISTENT.*')
634
637
        self.assertContainsRe(result, "[+]N  hello.txt\n")
635
638
 
636
639
        self.build_tree(['world.txt'])
637
 
        result = self.run_bzr("status --short -r 0")[0]
 
640
        result = self.run_bzr("status -S -r 0")[0]
638
641
        self.assertContainsRe(result, "[+]N  hello.txt\n" \
639
642
                                      "[?]   world.txt\n")
640
 
        result2 = self.run_bzr("status --short -r 0..")[0]
 
643
        result2 = self.run_bzr("status -S -r 0..")[0]
641
644
        self.assertEquals(result2, result)
642
645
 
643
646
    def test_status_versioned(self):