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

  • Committer: Jelmer Vernooij
  • Date: 2018-08-08 02:14:32 UTC
  • mfrom: (7063 work)
  • mto: This revision was merged to the branch mainline in revision 7065.
  • Revision ID: jelmer@jelmer.uk-20180808021432-nomib3je4cu2xqkm
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
        with open('hello', 'w') as f: f.write('hello world')
118
118
        wt.add('hello')
119
119
        revid = wt.commit(message='add hello', rev_id=b'revid', lossy=True)
120
 
        self.assertEqual('revid', revid)
 
120
        self.assertEqual(b'revid', revid)
121
121
 
122
122
    def test_commit_lossy_foreign(self):
123
123
        """Attempt a lossy commit to a foreign branch."""
129
129
        wt.add('hello')
130
130
        revid = wt.commit(message='add hello', lossy=True,
131
131
            timestamp=1302659388, timezone=0)
132
 
        self.assertEqual(b'dummy-v1:1302659388.0-0-UNKNOWN', revid)
 
132
        self.assertEqual(b'dummy-v1:1302659388-0-UNKNOWN', revid)
133
133
 
134
134
    def test_commit_bound_lossy_foreign(self):
135
135
        """Attempt a lossy commit to a bzr branch bound to a foreign branch."""
142
142
        wt.add('hello')
143
143
        revid = wt.commit(message='add hello', lossy=True,
144
144
            timestamp=1302659388, timezone=0)
145
 
        self.assertEqual(b'dummy-v1:1302659388.0-0-0', revid)
146
 
        self.assertEqual(b'dummy-v1:1302659388.0-0-0',
 
145
        self.assertEqual(b'dummy-v1:1302659388-0-0', revid)
 
146
        self.assertEqual(b'dummy-v1:1302659388-0-0',
147
147
            foreign_branch.last_revision())
148
 
        self.assertEqual(b'dummy-v1:1302659388.0-0-0',
 
148
        self.assertEqual(b'dummy-v1:1302659388-0-0',
149
149
            wt.branch.last_revision())
150
150
 
151
151
    def test_missing_commit(self):
357
357
            with open('hello', 'w') as f: f.write((str(i) * 4) + '\n')
358
358
            if i == 0:
359
359
                wt.add(['hello'], [b'hello-id'])
360
 
            rev_id = 'test@rev-%d' % (i+1)
 
360
            rev_id = b'test@rev-%d' % (i+1)
361
361
            rev_ids.append(rev_id)
362
362
            wt.commit(message='rev %d' % (i+1),
363
363
                     rev_id=rev_id)
423
423
        wt = self.make_branch_and_tree('.')
424
424
        branch = wt.branch
425
425
        wt.commit("base", allow_pointless=True, rev_id=b'A')
426
 
        self.assertFalse(branch.repository.has_signature_for_revision_id('A'))
 
426
        self.assertFalse(branch.repository.has_signature_for_revision_id(b'A'))
427
427
        try:
428
428
            from ..testament import Testament
429
429
            # monkey patch gpg signing mechanism
438
438
                return breezy.gpg.LoopbackGPGStrategy(None).sign(
439
439
                        text, breezy.gpg.MODE_CLEAR)
440
440
            self.assertEqual(sign(Testament.from_revision(branch.repository,
441
 
                                                          'B').as_short_text()),
442
 
                             branch.repository.get_signature_text('B'))
 
441
                                                          b'B').as_short_text()),
 
442
                             branch.repository.get_signature_text(b'B'))
443
443
        finally:
444
444
            breezy.gpg.GPGStrategy = oldstrategy
445
445