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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-08-01 02:49:14 UTC
  • mfrom: (7045.4.39 python3-u)
  • Revision ID: breezy.the.bot@gmail.com-20180801024914-vib3fpfkn36585ie
Fix some more tests on Python 3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-u/+merge/351386

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
        tree.lock_write()
151
151
        tree.add('')
152
152
        root_delta.added = [('', tree.path2id(''), 'directory')]
153
 
        class PreCommitException(Exception): pass
 
153
        class PreCommitException(Exception):
 
154
            
 
155
            def __init__(self, revid):
 
156
                self.revid = revid
154
157
        def hook_func(local, master,
155
158
                      old_revno, old_revid, new_revno, new_revid,
156
159
                      tree_delta, future_tree):
163
166
        # so the commit is rolled back and revno unchanged
164
167
        err = self.assertRaises(PreCommitException, tree.commit, 'message')
165
168
        # we have to record the revid to use in assertEqual later
166
 
        revids[0] = str(err)
 
169
        revids[0] = err.revid
167
170
        # unregister all pre_commit hooks
168
171
        branch.Branch.hooks["pre_commit"] = []
169
172
        # and re-register the capture hook