~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-03 20:18:35 UTC
  • mfrom: (1185.82.137 w-changeset)
  • Revision ID: pqm@pqm.ubuntu.com-20060603201835-1c9a1725641ccd24
Implement bundles

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
        # re-open tree as external runbzr modified it
168
168
        tree_b = branch_b.bzrdir.open_workingtree()
169
169
        tree_b.commit('merge branch_c')
 
170
 
 
171
    def test_merge_bundle(self):
 
172
        from bzrlib.testament import Testament
 
173
        tree_a = self.make_branch_and_tree('branch_a')
 
174
        f = file('branch_a/a', 'wb')
 
175
        f.write('hello')
 
176
        f.close()
 
177
        tree_a.add('a')
 
178
        tree_a.commit('message')
 
179
 
 
180
        tree_b = tree_a.bzrdir.sprout('branch_b').open_workingtree()
 
181
        f = file('branch_a/a', 'wb')
 
182
        f.write('hey there')
 
183
        f.close()
 
184
        tree_a.commit('message')
 
185
 
 
186
        f = file('branch_b/a', 'wb')
 
187
        f.write('goodbye')
 
188
        f.close()
 
189
        tree_b.commit('message')
 
190
        os.chdir('branch_b')
 
191
        file('../bundle', 'wb').write(self.runbzr('bundle ../branch_a')[0])
 
192
        os.chdir('../branch_a')
 
193
        self.runbzr('merge ../bundle', retcode=1)
 
194
        testament_a = Testament.from_revision(tree_a.branch.repository, 
 
195
                                              tree_b.last_revision())
 
196
        testament_b = Testament.from_revision(tree_b.branch.repository,
 
197
                                              tree_b.last_revision())
 
198
        self.assertEqualDiff(testament_a.as_text(),
 
199
                         testament_b.as_text())