/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/blackbox/test_pull.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-25 11:54:30 UTC
  • mfrom: (6855.4.10 more-bees)
  • Revision ID: breezy.the.bot@gmail.com-20180325115430-75xnlbrmzjoomd83
Add more bees. In particular:

* for file ids
* for revision ids
* for file contents in build_tree_contents()

Merged from https://code.launchpad.net/~jelmer/brz/more-bees/+merge/337919

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    def example_branch(self, path='.'):
46
46
        tree = self.make_branch_and_tree(path)
47
47
        self.build_tree_contents([
48
 
            (osutils.pathjoin(path, 'hello'),   'foo'),
49
 
            (osutils.pathjoin(path, 'goodbye'), 'baz')])
 
48
            (osutils.pathjoin(path, 'hello'),   b'foo'),
 
49
            (osutils.pathjoin(path, 'goodbye'), b'baz')])
50
50
        tree.add('hello')
51
51
        tree.commit(message='setup')
52
52
        tree.add('goodbye')
120
120
        """Pull some changes from one branch to another."""
121
121
        a_tree = self.example_branch('a')
122
122
        self.build_tree_contents([
123
 
            ('a/hello2',   'foo'),
124
 
            ('a/goodbye2', 'baz')])
 
123
            ('a/hello2',   b'foo'),
 
124
            ('a/goodbye2', b'baz')])
125
125
        a_tree.add('hello2')
126
126
        a_tree.commit(message="setup")
127
127
        a_tree.add('goodbye2')
161
161
        # even if the target branch has merged
162
162
        # everything already.
163
163
        a_tree = self.make_branch_and_tree('a')
164
 
        self.build_tree_contents([('a/foo', 'original\n')])
 
164
        self.build_tree_contents([('a/foo', b'original\n')])
165
165
        a_tree.add('foo')
166
166
        a_tree.commit(message='initial commit')
167
167
 
168
168
        b_tree = a_tree.controldir.sprout('b').open_workingtree()
169
169
 
170
 
        self.build_tree_contents([('a/foo', 'changed\n')])
 
170
        self.build_tree_contents([('a/foo', b'changed\n')])
171
171
        a_tree.commit(message='later change')
172
172
 
173
 
        self.build_tree_contents([('a/foo', 'a third change')])
 
173
        self.build_tree_contents([('a/foo', b'a third change')])
174
174
        a_tree.commit(message='a third change')
175
175
 
176
176
        self.assertEqual(a_tree.branch.last_revision_info()[0], 3)
189
189
        # Make sure pull --overwrite sets the revision-history
190
190
        # to be identical to the pull source, even if we have convergence
191
191
        a_tree = self.make_branch_and_tree('a')
192
 
        self.build_tree_contents([('a/foo', 'original\n')])
 
192
        self.build_tree_contents([('a/foo', b'original\n')])
193
193
        a_tree.add('foo')
194
194
        a_tree.commit(message='initial commit')
195
195
 
196
196
        b_tree = a_tree.controldir.sprout('b').open_workingtree()
197
197
 
198
 
        self.build_tree_contents([('a/foo', 'changed\n')])
 
198
        self.build_tree_contents([('a/foo', b'changed\n')])
199
199
        a_tree.commit(message='later change')
200
200
 
201
 
        self.build_tree_contents([('a/foo', 'a third change')])
 
201
        self.build_tree_contents([('a/foo', b'a third change')])
202
202
        a_tree.commit(message='a third change')
203
203
 
204
204
        self.assertEqual(a_tree.branch.last_revision_info()[0], 3)
208
208
 
209
209
        self.assertEqual(b_tree.branch.last_revision_info()[0], 2)
210
210
 
211
 
        self.build_tree_contents([('a/foo', 'a fourth change\n')])
 
211
        self.build_tree_contents([('a/foo', b'a fourth change\n')])
212
212
        a_tree.commit(message='a fourth change')
213
213
 
214
214
        rev_info_a = a_tree.branch.last_revision_info()