~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_merge.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-26 17:09:38 UTC
  • mto: (2255.11.3 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: john@arbash-meinel.com-20070226170938-ik5w1cd0a1tuzsgq
Some comments on merge code, fix merge tests that
assume basis_tree() is valid after the tree has been modified.

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
        self.build_tree(['a/b/'])
160
160
        tree_a.add('b', 'b-id')
161
161
        tree_a.commit('added b')
162
 
        base_tree = tree_a.basis_tree()
 
162
        # basis_tree() is only guaranteed to be valid as long as it is actually
 
163
        # the basis tree. This mutates the tree after grabbing basis, so go to
 
164
        # the repository.
 
165
        base_tree = tree_a.branch.repository.revision_tree(tree_a.last_revision())
163
166
        tree_z = tree_a.bzrdir.sprout('z').open_workingtree()
164
167
        self.build_tree(['a/b/c'])
165
168
        tree_a.add('b/c')
183
186
        self.build_tree_contents([('tree_a/file', 'content_1')])
184
187
        tree_a.add('file')
185
188
        tree_a.commit('commit base')
186
 
        base_tree = tree_a.basis_tree()
 
189
        # basis_tree() is only guaranteed to be valid as long as it is actually
 
190
        # the basis tree. This mutates the tree after grabbing basis, so go to
 
191
        # the repository.
 
192
        base_tree = tree_a.branch.repository.revision_tree(tree_a.last_revision())
187
193
        tree_b = tree_a.bzrdir.sprout('tree_b').open_workingtree()
188
194
        self.build_tree_contents([('tree_a/file', 'content_2')])
189
195
        tree_a.commit('commit other')