/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/test_workingtree_4.py

merge 2.0 branch rev 4647

Show diffs side-by-side

added added

removed removed

Lines of Context:
490
490
        subtree = self.make_branch_and_tree('dir')
491
491
        # the most primitive operation: kind
492
492
        self.assertEqual('directory', tree.kind('dir-id'))
493
 
        # a diff against the basis should give us a directory
 
493
        # a diff against the basis should give us a directory and the root (as
 
494
        # the root is new too).
494
495
        tree.lock_read()
495
496
        expected = [('dir-id',
496
497
            (None, u'dir'),
499
500
            (None, 'root'),
500
501
            (None, u'dir'),
501
502
            (None, 'directory'),
502
 
            (None, False))]
 
503
            (None, False)),
 
504
            ('root', (None, u''), True, (False, True), (None, None),
 
505
            (None, u''), (None, 'directory'), (None, 0))]
503
506
        self.assertEqual(expected, list(tree.iter_changes(tree.basis_tree(),
504
507
            specific_files=['dir'])))
505
508
        tree.unlock()
579
582
        self.assertEqual([], changes)
580
583
        self.assertEqual(['', 'versioned', 'versioned2'], returned)
581
584
 
 
585
    def test_iter_changes_unversioned_error(self):
 
586
        """ Check if a PathsNotVersionedError is correctly raised and the
 
587
            paths list contains all unversioned entries only.
 
588
        """
 
589
        tree = self.make_branch_and_tree('tree')
 
590
        self.build_tree_contents([('tree/bar', '')])
 
591
        tree.add(['bar'], ['bar-id'])
 
592
        tree.lock_read()
 
593
        self.addCleanup(tree.unlock)
 
594
        tree_iter_changes = lambda files: [
 
595
            c for c in tree.iter_changes(tree.basis_tree(), specific_files=files,
 
596
                                         require_versioned=True)
 
597
        ]
 
598
        e = self.assertRaises(errors.PathsNotVersionedError,
 
599
                              tree_iter_changes, ['bar', 'foo'])
 
600
        self.assertEqual(e.paths, ['foo'])
 
601
 
582
602
    def get_tree_with_cachable_file_foo(self):
583
603
        tree = self.make_branch_and_tree('.')
584
604
        self.build_tree(['foo'])