/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 04:13:39 UTC
  • mto: This revision was merged to the branch mainline in revision 3910.
  • Revision ID: andrew.bennetts@canonical.com-20081216041339-ri040jpm4xs25kl2
Comment the new tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
        self.assertEqual('rev-2', target.last_revision())
181
181
 
182
182
    def test_push_with_default_stacking_does_not_create_broken_branch(self):
 
183
        """Pushing a new standalone branch works even when there's a default
 
184
        stacking policy at the destination.
 
185
 
 
186
        The new branch will preserve the repo format (even if it isn't the
 
187
        default for the branch), and will be stacked when the repo format
 
188
        allows (which means that the branch format isn't necessarly preserved).
 
189
        """
183
190
        if isinstance(self.branch_format, branch.BzrBranchFormat4):
184
191
            raise tests.TestNotApplicable('Not a metadir format.')
185
192
        if isinstance(self.branch_format, branch.BranchReferenceFormat):
 
193
            # This test could in principle apply to BranchReferenceFormat, but
 
194
            # make_branch_builder doesn't support it.
186
195
            raise tests.TestSkipped(
187
196
                "BranchBuilder can't make reference branches.")
 
197
        # Make a branch called "local" in a stackable repository
 
198
        # The branch has 3 revisions:
 
199
        #   - rev-1, adds a file
 
200
        #   - rev-2, no changes
 
201
        #   - rev-3, modifies the file.
188
202
        repo = self.make_repository('repo', shared=True, format='1.6')
189
203
        builder = self.make_branch_builder('repo/local')
190
204
        builder.start_series()
196
210
            [('modify', ('f-id', 'new-content\n'))])
197
211
        builder.finish_series()
198
212
        trunk = builder.get_branch()
 
213
        # Sprout rev-1 to "trunk", so that we can stack on it.
199
214
        trunk.bzrdir.sprout(self.get_url('trunk'), revision_id='rev-1')
 
215
        # Set a default stacking policy so that new branches will automatically
 
216
        # stack on trunk.
200
217
        self.make_bzrdir('.').get_config().set_default_stack_on('trunk')
 
218
        # Push rev-2 to a new branch "remote".  It will be stacked on "trunk".
201
219
        output = StringIO()
202
220
        push._show_push_branch(trunk, 'rev-2', self.get_url('remote'), output)
 
221
        # Push rev-3 onto "remote".  If "remote" not stacked and is missing the
 
222
        # fulltext record for f-id @ rev-1, then this will fail.
203
223
        remote_branch = Branch.open(self.get_url('remote'))
204
224
        trunk.push(remote_branch)
205
225
        remote_branch.check()