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

  • Committer: Jelmer Vernooij
  • Date: 2019-05-29 03:28:14 UTC
  • mfrom: (7303 work)
  • mto: This revision was merged to the branch mainline in revision 7305.
  • Revision ID: jelmer@jelmer.uk-20190529032814-fzqbrgf9647u9ptq
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
        tree_a.branch.tags.set_tag('tag1', rev1)
174
174
 
175
175
        tree_b = tree_a.controldir.sprout('tree_b').open_workingtree()
176
 
        rev2a = tree_a.commit('message 2a')
177
 
        tree_b.branch.tags.set_tag('tag1', rev2a)
178
176
        rev2b = tree_b.commit('message 2b')
 
177
        tree_b.branch.tags.set_tag('tag1', rev2b)
 
178
        rev1b = tree_a.commit('message 1b')
179
179
        tree_a.branch.get_config_stack().set('branch.fetch_tags', True)
180
180
        self.assertRaises(errors.DivergedBranches, tree_a.pull, tree_b.branch)
181
181
        self.assertRaises(errors.DivergedBranches,
183
183
                          overwrite=set(), stop_revision=rev2b)
184
184
        # It should not have updated the branch tip, but it should have fetched
185
185
        # the revision if the repository supports "invisible" revisions
186
 
        self.assertEqual(rev2a, tree_a.branch.last_revision())
 
186
        self.assertEqual(rev1b, tree_a.branch.last_revision())
 
187
        # It also should not have updated the tags
 
188
        self.assertEqual(tree_a.branch.tags.get_tag_dict(), {'tag1': rev1})
187
189
        if tree_a.branch.repository._format.supports_unreferenced_revisions:
188
190
            self.assertTrue(tree_a.branch.repository.has_revision(rev2b))
189
191
        tree_a.branch.pull(tree_b.branch, overwrite=set(['history']),
194
196
        self.assertEqual(rev1, tree_a.branch.tags.lookup_tag('tag1'))
195
197
        tree_a.branch.pull(tree_b.branch, overwrite=set(['history', 'tags']),
196
198
                           stop_revision=rev2b)
197
 
        self.assertEqual(rev2a, tree_a.branch.tags.lookup_tag('tag1'))
 
199
        self.assertEqual(rev2b, tree_a.branch.tags.lookup_tag('tag1'))
198
200
 
199
201
    def test_pull_merges_and_fetches_tags(self):
200
202
        """Tags are updated by br.pull(source), and revisions named in those