/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_workingtree/test_commit.py

  • Committer: Jelmer Vernooij
  • Date: 2018-06-30 14:28:33 UTC
  • mfrom: (7005 work)
  • mto: This revision was merged to the branch mainline in revision 7008.
  • Revision ID: jelmer@jelmer.uk-20180630142833-eg208wfe8la76m0x
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
        if not wt.branch.repository._format.supports_ghosts:
268
268
            raise tests.TestNotApplicable(
269
269
                'format does not support ghosts')
270
 
        wt.set_parent_ids(['non:existent@rev--ision--0--2'],
 
270
        wt.set_parent_ids([b'non:existent@rev--ision--0--2'],
271
271
            allow_leftmost_as_ghost=True)
272
272
        rev_id = wt.commit('commit against a ghost first parent.')
273
273
        rev = wt.branch.repository.get_revision(rev_id)
274
 
        self.assertEqual(rev.parent_ids, ['non:existent@rev--ision--0--2'])
 
274
        self.assertEqual(rev.parent_ids, [b'non:existent@rev--ision--0--2'])
275
275
        # parent_sha1s is not populated now, WTF. rbc 20051003
276
276
        self.assertEqual(len(rev.parent_sha1s), 0)
277
277
 
282
282
            raise tests.TestNotApplicable(
283
283
                'format does not support ghosts')
284
284
        wt.set_parent_ids([
285
 
                'foo@azkhazan-123123-abcabc',
286
 
                'wibble@fofof--20050401--1928390812',
 
285
                b'foo@azkhazan-123123-abcabc',
 
286
                b'wibble@fofof--20050401--1928390812',
287
287
            ],
288
288
            allow_leftmost_as_ghost=True)
289
289
        rev_id = wt.commit("commit from ghost base with one merge")
290
290
        # the revision should have been committed with two parents
291
291
        rev = wt.branch.repository.get_revision(rev_id)
292
 
        self.assertEqual(['foo@azkhazan-123123-abcabc',
293
 
            'wibble@fofof--20050401--1928390812'],
 
292
        self.assertEqual([b'foo@azkhazan-123123-abcabc',
 
293
            b'wibble@fofof--20050401--1928390812'],
294
294
            rev.parent_ids)
295
295
 
296
296
    def test_commit_deleted_subtree_and_files_updates_workingtree(self):
475
475
        self.build_tree(['a', 'b', 'c'])
476
476
        tree.add(['a', 'b', 'c'])
477
477
        tree.commit('first post')
478
 
        f = file('b', 'wt')
479
 
        f.write('new content')
480
 
        f.close()
 
478
        with open('b', 'wt') as f:
 
479
            f.write('new content')
481
480
        # set a progress bar that captures the calls so we can see what is
482
481
        # emitted
483
482
        factory = ProgressRecordingUIFactory()