~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

Finish deprecating Branch.working_tree()

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import os
19
19
 
20
 
from bzrlib.tests import TestCaseWithTransport
21
20
from bzrlib.branch import Branch
 
21
from bzrlib.errors import NoSuchRevision
22
22
from bzrlib.commit import commit
23
23
from bzrlib.fetch import fetch
24
24
from bzrlib.revision import (find_present_ancestors, combined_graph,
25
25
                             is_ancestor, MultipleRevisionSources)
 
26
from bzrlib.tests import TestCaseWithTransport
26
27
from bzrlib.trace import mutter
27
 
from bzrlib.errors import NoSuchRevision
 
28
from bzrlib.workingtree import WorkingTree
28
29
 
29
30
# XXX: Make this a method of a merge base case
30
31
def make_branches(self):
144
145
        from bzrlib.commit import commit
145
146
        TestCaseWithTransport.setUp(self)
146
147
        self.br1, self.br2 = make_branches(self)
147
 
 
148
 
        self.br2.working_tree().commit("Commit eleven", rev_id="b@u-0-7")
149
 
        self.br2.working_tree().commit("Commit twelve", rev_id="b@u-0-8")
150
 
        self.br2.working_tree().commit("Commit thirtteen", rev_id="b@u-0-9")
 
148
        wt1 = WorkingTree(self.br1.base, self.br1)
 
149
        wt2 = WorkingTree(self.br2.base, self.br2)
 
150
        wt2.commit("Commit eleven", rev_id="b@u-0-7")
 
151
        wt2.commit("Commit twelve", rev_id="b@u-0-8")
 
152
        wt2.commit("Commit thirtteen", rev_id="b@u-0-9")
151
153
 
152
154
        fetch(from_branch=self.br2, to_branch=self.br1)
153
 
        self.br1.working_tree().add_pending_merge(self.br2.revision_history()[6])
154
 
        self.br1.working_tree().commit("Commit fourtten", rev_id="a@u-0-6")
 
155
        wt1.add_pending_merge(self.br2.revision_history()[6])
 
156
        wt1.commit("Commit fourtten", rev_id="a@u-0-6")
155
157
 
156
158
        fetch(from_branch=self.br1, to_branch=self.br2)
157
 
        self.br2.working_tree().add_pending_merge(self.br1.revision_history()[6])
158
 
        self.br2.working_tree().commit("Commit fifteen", rev_id="b@u-0-10")
 
159
        wt2.add_pending_merge(self.br1.revision_history()[6])
 
160
        wt2.commit("Commit fifteen", rev_id="b@u-0-10")
159
161
 
160
162
        from bzrlib.revision import MultipleRevisionSources
161
163
        self.sources = MultipleRevisionSources(self.br1.repository,