/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_repository/test_revision.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    TestCaseWithRepository,
22
22
    )
23
23
 
 
24
 
24
25
class TestRevProps(TestCaseWithRepository):
25
26
 
26
27
    def test_simple_revprops(self):
36
37
        else:
37
38
            props = {}
38
39
        rev1 = wt.commit(message='initial null commit',
39
 
                 revprops=props,
40
 
                 allow_pointless=True)
 
40
                         revprops=props,
 
41
                         allow_pointless=True)
41
42
        rev = b.repository.get_revision(rev1)
42
43
        if b.repository._format.supports_custom_revision_properties:
43
44
            self.assertTrue(u'flavor' in rev.properties)
61
62
        b = wt.branch
62
63
        if not b.repository._format.supports_custom_revision_properties:
63
64
            raise TestNotApplicable(
64
 
                    'format does not support custom revision properties')
 
65
                'format does not support custom revision properties')
65
66
        self.assertRaises(ValueError,
66
67
                          wt.commit,
67
68
                          message='invalid',
81
82
        """
82
83
        tree1 = self.make_branch_and_tree("br1")
83
84
        if tree1.branch.repository._format.supports_custom_revision_properties:
84
 
            revprops={u'empty':'',
85
 
                      u'value':'one',
86
 
                      u'unicode':u'\xb5',
87
 
                      u'multiline':'foo\nbar\n\n'
88
 
                      }
 
85
            revprops = {u'empty': '',
 
86
                        u'value': 'one',
 
87
                        u'unicode': u'\xb5',
 
88
                        u'multiline': 'foo\nbar\n\n'
 
89
                        }
89
90
        else:
90
91
            revprops = {}
91
92
        # create a revision
92
93
        rev1 = tree1.commit(message="quux", allow_pointless=True,
93
 
            committer="jaq", revprops=revprops)
 
94
                            committer="jaq", revprops=revprops)
94
95
        self.assertEqual(tree1.branch.last_revision(), rev1)
95
96
        rev_a = tree1.branch.repository.get_revision(
96
 
                            tree1.branch.last_revision())
 
97
            tree1.branch.last_revision())
97
98
 
98
99
        tree2 = self.make_branch_and_tree("br2")
99
100
        tree2.commit(message=rev_a.message,
101
102
                     timezone=rev_a.timezone,
102
103
                     committer=rev_a.committer,
103
104
                     rev_id=(rev_a.revision_id
104
 
                         if tree2.branch.repository._format.supports_setting_revision_ids
105
 
                         else None),
 
105
                             if tree2.branch.repository._format.supports_setting_revision_ids
 
106
                             else None),
106
107
                     revprops=rev_a.properties,
107
 
                     allow_pointless=True, # there's nothing in this commit
 
108
                     allow_pointless=True,  # there's nothing in this commit
108
109
                     strict=True,
109
110
                     verbose=True)
110
111
        rev_b = tree2.branch.repository.get_revision(
111
 
                            tree2.branch.last_revision())
 
112
            tree2.branch.last_revision())
112
113
 
113
114
        self.assertEqual(rev_a.message, rev_b.message)
114
115
        self.assertEqual(rev_a.timestamp, rev_b.timestamp)