/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/branch_implementations/test_stacking.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-08-01 04:38:11 UTC
  • mfrom: (3582.1.16 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080801043811-0jr7eru0frsrso4p
(mbp) add tests for deltas over repository boundaries

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
        unstacked.get_revision('rev1')
260
260
        unstacked.get_revision('rev2')
261
261
 
 
262
    def test_autopack_when_stacked(self):
 
263
        # in bzr.dev as of 20080730, autopack was reported to fail in stacked
 
264
        # repositories because of problems with text deltas spanning physical
 
265
        # repository boundaries.  however, i didn't actually get this test to
 
266
        # fail on that code. -- mbp
 
267
        # see https://bugs.launchpad.net/bzr/+bug/252821
 
268
        if not self.branch_format.supports_stacking():
 
269
            raise TestNotApplicable("%r does not support stacking"
 
270
                % self.branch_format)
 
271
        stack_on = self.make_branch_and_tree('stack-on')
 
272
        text_lines = ['line %d blah blah blah\n' % i for i in range(20)]
 
273
        self.build_tree_contents([('stack-on/a', ''.join(text_lines))])
 
274
        stack_on.add('a')
 
275
        stack_on.commit('base commit')
 
276
        stacked_dir = stack_on.bzrdir.sprout('stacked', stacked=True)
 
277
        stacked_tree = stacked_dir.open_workingtree()
 
278
        for i in range(20):
 
279
            text_lines[0] = 'changed in %d\n' % i
 
280
            self.build_tree_contents([('stacked/a', ''.join(text_lines))])
 
281
            stacked_tree.commit('commit %d' % i)
 
282
        stacked_tree.branch.repository.pack()
 
283
        stacked_tree.branch.check()
 
284
 
 
285
    def test_pull_delta_when_stacked(self):
 
286
        if not self.branch_format.supports_stacking():
 
287
            raise TestNotApplicable("%r does not support stacking"
 
288
                % self.branch_format)
 
289
        stack_on = self.make_branch_and_tree('stack-on')
 
290
        text_lines = ['line %d blah blah blah\n' % i for i in range(20)]
 
291
        self.build_tree_contents([('stack-on/a', ''.join(text_lines))])
 
292
        stack_on.add('a')
 
293
        stack_on.commit('base commit')
 
294
        # make a stacked branch from the mainline
 
295
        stacked_dir = stack_on.bzrdir.sprout('stacked', stacked=True)
 
296
        stacked_tree = stacked_dir.open_workingtree()
 
297
        # make a second non-stacked branch from the mainline
 
298
        other_dir = stack_on.bzrdir.sprout('other')
 
299
        other_tree = other_dir.open_workingtree()
 
300
        text_lines[9] = 'changed in other\n'
 
301
        self.build_tree_contents([('other/a', ''.join(text_lines))])
 
302
        other_tree.commit('commit in other')
 
303
        # this should have generated a delta; try to pull that across
 
304
        # bug 252821 caused a RevisionNotPresent here...
 
305
        stacked_tree.pull(other_tree.branch)
 
306
        stacked_tree.branch.repository.pack()
 
307
        stacked_tree.branch.check()
 
308
 
262
309
    def test_fetch_revisions_with_file_changes(self):
263
310
        # Fetching revisions including file changes into a stacked branch
264
311
        # works without error.