/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/repository_implementations/test_fileid_involved.py

  • Committer: Robert Collins
  • Date: 2007-04-23 02:29:35 UTC
  • mfrom: (2441 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2442.
  • Revision ID: robertc@robertcollins.net-20070423022935-9hhongamvk6bfdso
Resolve conflicts with bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
class FileIdInvolvedBase(TestCaseWithRepository):
29
29
 
30
 
    def touch(self,filename):
31
 
        f = file(filename,"a")
32
 
        f.write("appended line\n")
33
 
        f.close( )
 
30
    def touch(self, tree, filename):
 
31
        # use the trees transport to not depend on the tree's location or type.
 
32
        tree.bzrdir.root_transport.append_bytes(filename, "appended line\n")
34
33
 
35
34
    def compare_tree_fileids(self, branch, old_rev, new_rev):
36
35
        old_tree = self.branch.repository.revision_tree(old_rev)
88
87
 
89
88
        #-------- end A -----------
90
89
 
91
 
        d1 = main_branch.bzrdir.clone('branch1')
92
 
        b1 = d1.open_branch()
 
90
        bt1 = self.make_branch_and_tree('branch1')
 
91
        bt1.pull(main_branch)
 
92
        b1 = bt1.branch
93
93
        self.build_tree(["branch1/d"])
94
 
        bt1 = d1.open_workingtree()
95
94
        bt1.add(['d'], ['file-d'])
96
95
        bt1.commit("branch1, Commit one", rev_id="rev-E")
97
96
 
98
97
        #-------- end E -----------
99
98
 
100
 
        self.touch("main/a")
 
99
        self.touch(main_wt, "a")
101
100
        main_wt.commit("Commit two", rev_id="rev-B")
102
101
 
103
102
        #-------- end B -----------
104
103
 
105
 
        d2 = main_branch.bzrdir.clone('branch2')
106
 
        branch2_branch = d2.open_branch()
107
 
        bt2 = d2.open_workingtree()
 
104
        bt2 = self.make_branch_and_tree('branch2')
 
105
        bt2.pull(main_branch)
 
106
        branch2_branch = bt2.branch
108
107
        set_executability(bt2, 'b', True)
109
108
        bt2.commit("branch2, Commit one", rev_id="rev-J")
110
109
 
120
119
 
121
120
        #-------- end F -----------
122
121
 
123
 
        self.touch("branch2/c")
 
122
        self.touch(bt2, "c")
124
123
        bt2.commit("branch2, commit two", rev_id="rev-K")
125
124
 
126
125
        #-------- end K -----------
127
126
 
128
127
        main_wt.merge_from_branch(b1)
129
 
        self.touch("main/b")
 
128
        self.touch(main_wt, "b")
130
129
        # D gets some funky characters to make sure the unescaping works
131
130
        main_wt.commit("merge branch1, rev-12", rev_id="rev-<D>")
132
131
 
274
273
            # This is not a known error condition
275
274
            raise
276
275
 
277
 
        branch2_bzrdir = main_branch.bzrdir.sprout("branch2")
 
276
        branch2_wt = self.make_branch_and_tree('branch2')
 
277
        branch2_wt.pull(main_branch)
 
278
        branch2_bzrdir = branch2_wt.bzrdir
278
279
        branch2_branch = branch2_bzrdir.open_branch()
279
 
        branch2_wt = branch2_bzrdir.open_workingtree()
280
280
        set_executability(branch2_wt, 'b', True)
281
281
        branch2_wt.commit("branch2, Commit one", rev_id="rev-J")
282
282