/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

  • Committer: John Arbash Meinel
  • Date: 2008-06-05 16:27:16 UTC
  • mfrom: (3475 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3476.
  • Revision ID: john@arbash-meinel.com-20080605162716-a3hn238tnctbfd8j
merge bzr.dev, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
        rev2 = subtree2.commit('commit in subdir2')
116
116
 
117
117
        subtree.flush()
118
 
        subtree.merge_from_branch(subtree2.branch)
119
 
        rev3 = subtree.commit('merge from subdir2')
 
118
        subtree3 = subtree.bzrdir.sprout('subdir3').open_workingtree()
 
119
        rev3 = subtree3.commit('merge from subdir2')
120
120
 
121
121
        repo = tree.branch.repository
122
 
        repo.fetch(subtree.branch.repository, rev3)
 
122
        repo.fetch(subtree.branch.repository, rev1)
 
123
        repo.fetch(subtree2.branch.repository, rev2)
 
124
        repo.fetch(subtree3.branch.repository, rev3)
123
125
        # will also pull the others...
124
126
 
125
127
        # create repository based revision trees
126
 
        rev1_revtree = subtree.branch.repository.revision_tree(rev1)
127
 
        rev2_revtree = subtree2.branch.repository.revision_tree(rev2)
128
 
        rev3_revtree = subtree.branch.repository.revision_tree(rev3)
 
128
        rev1_revtree = repo.revision_tree(rev1)
 
129
        rev2_revtree = repo.revision_tree(rev2)
 
130
        rev3_revtree = repo.revision_tree(rev3)
129
131
        # tree doesn't contain a text merge yet but we'll just
130
132
        # set the parents as if a merge had taken place. 
131
133
        # this should cause the tree data to be folded into the 
496
498
            (None, u'dir'),
497
499
            (None, 'directory'),
498
500
            (None, False))]
499
 
        self.assertEqual(expected, list(tree._iter_changes(tree.basis_tree(),
 
501
        self.assertEqual(expected, list(tree.iter_changes(tree.basis_tree(),
500
502
            specific_files=['dir'])))
501
503
        tree.unlock()
502
504
        # do a commit, we want to trigger the dirstate fast-path too
514
516
            ('dir', 'dir'),
515
517
            ('directory', None),
516
518
            (False, False))]
517
 
        self.assertEqual(expected, list(tree._iter_changes(tree.basis_tree())))
 
519
        self.assertEqual(expected, list(tree.iter_changes(tree.basis_tree())))
518
520
        tree.unlock()
519
521
 
520
522
    def test_with_subtree_supports_tree_references(self):
526
528
        # workingtree_4.
527
529
 
528
530
    def test_iter_changes_ignores_unversioned_dirs(self):
529
 
        """_iter_changes should not descend into unversioned directories."""
 
531
        """iter_changes should not descend into unversioned directories."""
530
532
        tree = self.make_branch_and_tree('.', format='dirstate')
531
533
        # We have an unversioned directory at the root, a versioned one with
532
534
        # other versioned files and an unversioned directory, and another
564
566
        basis.lock_read()
565
567
        self.addCleanup(basis.unlock)
566
568
        changes = [c[1] for c in
567
 
                   tree._iter_changes(basis, want_unversioned=True)]
 
569
                   tree.iter_changes(basis, want_unversioned=True)]
568
570
        self.assertEqual([(None, 'unversioned'),
569
571
                          (None, 'versioned/unversioned'),
570
572
                          (None, 'versioned2/unversioned'),
571
573
                         ], changes)
572
574
        self.assertEqual(['', 'versioned', 'versioned2'], returned)
573
575
        del returned[:] # reset
574
 
        changes = [c[1] for c in tree._iter_changes(basis)]
 
576
        changes = [c[1] for c in tree.iter_changes(basis)]
575
577
        self.assertEqual([], changes)
576
578
        self.assertEqual(['', 'versioned', 'versioned2'], returned)
577
579
 
599
601
                                            [('f', '', 0, False, ''),
600
602
                                             ('r', 'bar', 0 , False, '')]))
601
603
            self.assertListRaises(errors.CorruptDirstate,
602
 
                                  tree._iter_changes, tree.basis_tree())
 
604
                                  tree.iter_changes, tree.basis_tree())
603
605
        finally:
604
606
            tree.unlock()
605
607