/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_push.py

  • Committer: Andrew Bennetts
  • Date: 2008-12-16 02:27:04 UTC
  • mto: This revision was merged to the branch mainline in revision 3910.
  • Revision ID: andrew.bennetts@canonical.com-20081216022704-1ntb6qvqfhbecat3
Improve the test; now 4/7 passing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for branch.push behaviour."""
18
18
 
 
19
from cStringIO import StringIO
19
20
import os
20
21
 
21
22
from bzrlib import (
24
25
    bzrdir,
25
26
    debug,
26
27
    errors,
 
28
    push,
27
29
    tests,
28
30
    )
29
31
from bzrlib.branch import Branch
177
179
        source.branch.push(target, stop_revision='rev-2', overwrite=True)
178
180
        self.assertEqual('rev-2', target.last_revision())
179
181
 
180
 
    def test_push_doesnt_create_broken_branch(self):
181
 
        self.make_repository('repo', shared=True, format='1.6')
182
 
        builder = self.make_branch_builder('repo/local')#, format='pack-0.92')
 
182
    def test_push_with_default_stacking_does_not_create_broken_branch(self):
 
183
        repo = self.make_repository('repo', shared=True, format='1.6')
 
184
        builder = self.make_branch_builder('repo/local')
183
185
        builder.start_series()
184
186
        builder.build_snapshot('rev-1', None, [
185
187
            ('add', ('', 'root-id', 'directory', '')),
190
192
        builder.finish_series()
191
193
        branch = builder.get_branch()
192
194
        branch.bzrdir.sprout(self.get_url('trunk'), revision_id='rev-1')
193
 
        #self.run_bzr('push -d repo/local trunk -r 1')
194
195
        self.make_bzrdir('.').get_config().set_default_stack_on('trunk')
195
 
        #out, err = self.run_bzr('push -d repo/local remote -r 2')
196
 
        remote = branch.bzrdir.sprout(
197
 
            self.get_url('remote'), revision_id='rev-2')
198
 
        remote_branch = remote.open_branch()
199
 
#        self.assertContainsRe(
200
 
#            err, 'Using default stacking branch trunk at .*')
 
196
        output = StringIO()
 
197
        push._show_push_branch(branch, 'rev-2', self.get_url('remote'), output)
 
198
        remote_branch = Branch.open(self.get_url('remote'))
201
199
        branch.push(remote_branch)
202
 
        #out, err = self.run_bzr('push -d repo/local remote -r 3')
203
200
 
204
201
 
205
202
class TestPushHook(TestCaseWithBranch):