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

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    )
39
39
from .. import TestCaseWithTransport
40
40
from ..matchers import ContainsNoVfsCalls
41
 
from ..test_bedding import override_whoami
42
41
 
43
42
 
44
43
class TestCommit(TestCaseWithTransport):
316
315
        this_tree.commit('create_files')
317
316
        other_dir = this_tree.controldir.sprout('other')
318
317
        other_tree = other_dir.open_workingtree()
319
 
        with other_tree.lock_write():
320
 
            # perform the needed actions on the files and dirs.
 
318
        other_tree.lock_write()
 
319
        # perform the needed actions on the files and dirs.
 
320
        try:
321
321
            other_tree.rename_one('dirtorename', 'renameddir')
322
322
            other_tree.rename_one('dirtoreparent', 'renameddir/reparenteddir')
323
323
            other_tree.rename_one('filetorename', 'renamedfile')
331
331
            other_tree.add('newfile')
332
332
            other_tree.add('newdir/')
333
333
            other_tree.commit('modify all sample files and dirs.')
 
334
        finally:
 
335
            other_tree.unlock()
334
336
        this_tree.merge_from_branch(other_tree.branch)
335
337
        out, err = self.run_bzr('commit -m added', working_dir='this')
336
338
        self.assertEqual('', out)
866
868
        with open('foo/foo.txt', 'w') as f:
867
869
            f.write('hello')
868
870
        self.run_bzr(['add'], working_dir='foo')
869
 
        override_whoami(self)
 
871
        self.overrideEnv('EMAIL', None)
 
872
        self.overrideEnv('BRZ_EMAIL', None)
 
873
        # Also, make sure that it's not inferred from mailname.
 
874
        self.overrideAttr(config, '_auto_user_id',
 
875
                          lambda: (None, None))
870
876
        self.run_bzr_error(
871
877
            ['Unable to determine your name'],
872
878
            ['commit', '-m', 'initial'], working_dir='foo')