~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_tree.py

  • Committer: John Arbash Meinel
  • Date: 2007-05-04 18:59:36 UTC
  • mto: This revision was merged to the branch mainline in revision 2643.
  • Revision ID: john@arbash-meinel.com-20070504185936-1mjdoqmtz74xe5mg
A C implementation of _fields_to_entry_0_parents drops the time from 400ms to 330ms for a 21k-entry tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for Tree and InterTree."""
18
18
 
19
 
from bzrlib import errors
20
19
from bzrlib.tests import TestCaseWithTransport
21
20
from bzrlib.tree import InterTree
22
21
 
121
120
        delta = wt.changes_from(wt.basis_tree(), wt, include_root=True)
122
121
        self.assertEqual(len(delta.added), 1)
123
122
        self.assertEqual(delta.added[0][0], '')
124
 
 
125
 
    def test_changes_from_with_require_versioned(self):
126
 
        """Ensure the require_versioned option does what's expected."""
127
 
        wt = self.make_branch_and_tree('.')
128
 
        self.build_tree(['known_file', 'unknown_file'])
129
 
        wt.add('known_file')
130
 
 
131
 
        self.assertRaises(errors.PathsNotVersionedError,
132
 
            wt.changes_from, wt.basis_tree(), wt, specific_files=['known_file',
133
 
            'unknown_file'], require_versioned=True)
134
 
 
135
 
        # we need to pass a known file with an unknown file to get this to
136
 
        # fail when expected.
137
 
        delta = wt.changes_from(wt.basis_tree(), wt, 
138
 
            specific_files=['known_file', 'unknown_file'] ,
139
 
            require_versioned=False)
140
 
        self.assertEqual(len(delta.added), 1)