/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 breezy/tests/per_branch/test_sprout.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-04 00:16:27 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7318.
  • Revision ID: jelmer@jelmer.uk-20190304001627-v6u7o6pf97tukhek
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
            # do not have one unless a branch was created at the time.
70
70
            # We use branch format 6 because its not the default, and its not
71
71
            # metaweave either.
72
 
            target_bzrdir._format.set_branch_format(_mod_bzrbranch.BzrBranchFormat6())
 
72
            target_bzrdir._format.set_branch_format(
 
73
                _mod_bzrbranch.BzrBranchFormat6())
73
74
            result_format = target_bzrdir._format.get_branch_format()
74
75
        target = source.sprout(target_bzrdir)
75
76
        if isinstance(target, remote.RemoteBranch):
148
149
        wt.revert()
149
150
        wt.commit('rev1b')
150
151
        wt2 = wt.controldir.sprout(
151
 
                'target', revision_id=rev1a).open_workingtree()
 
152
            'target', revision_id=rev1a).open_workingtree()
152
153
        self.assertEqual(rev1a, wt2.last_revision())
153
154
        self.assertPathExists('target/a')
154
155
 
178
179
        # Check that the symlink target is safely round-tripped in the trees.
179
180
        self.assertEqual(target, tree.get_symlink_target(link_name))
180
181
        self.assertEqual(target,
181
 
                tree.basis_tree().get_symlink_target(link_name))
 
182
                         tree.basis_tree().get_symlink_target(link_name))
182
183
 
183
184
    def test_sprout_with_ghost_in_mainline(self):
184
185
        tree = self.make_branch_and_tree('tree1')
204
205
        target_transport = self.get_transport('target')
205
206
        self.hook_calls = []
206
207
        _mod_branch.Branch.hooks.install_named_hook("pre_change_branch_tip",
207
 
            self.assertBranchHookBranchIsStacked, None)
 
208
                                                    self.assertBranchHookBranchIsStacked, None)
208
209
        try:
209
210
            dir = source.controldir.sprout(target_transport.base,
210
 
                source.last_revision(), possible_transports=[target_transport],
211
 
                source_branch=source, stacked=True)
 
211
                                           source.last_revision(), possible_transports=[target_transport],
 
212
                                           source_branch=source, stacked=True)
212
213
        except _mod_branch.UnstackableBranchFormat:
213
214
            if not self.branch_format.supports_stacking():
214
215
                raise tests.TestNotApplicable(