~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_commit.py

  • Committer: Robert Collins
  • Date: 2010-06-25 06:23:08 UTC
  • mto: This revision was merged to the branch mainline in revision 5324.
  • Revision ID: robertc@robertcollins.net-20100625062308-qx287gzfrehs1d21
Restore the original ui_factory when existing BzrLibraryState.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import sys
23
23
 
24
24
from bzrlib import (
25
 
    bzrdir,
26
25
    osutils,
27
26
    ignores,
28
27
    msgeditor,
130
129
        # by ui.text.show_warning
131
130
        default_get_terminal_enc = osutils.get_terminal_encoding
132
131
        try:
133
 
            osutils.get_terminal_encoding = lambda trace=None: 'ascii'
 
132
            osutils.get_terminal_encoding = lambda: 'ascii'
134
133
            file_name = u'foo\u1234'
135
134
            open(file_name, 'w').write('hello world')
136
135
            self.run_bzr(['add'])
758
757
        osutils.set_or_unset_env('BZR_EMAIL', None)
759
758
        out, err = self.run_bzr(['commit', '-m', 'initial'], 3)
760
759
        self.assertContainsRe(err, 'Unable to determine your name')
761
 
 
762
 
    def test_commit_recursive_checkout(self):
763
 
        """Ensure that a commit to a recursive checkout fails cleanly.
764
 
        """
765
 
        self.run_bzr(['init', 'test_branch'])
766
 
        self.run_bzr(['checkout', 'test_branch', 'test_checkout'])
767
 
        os.chdir('test_checkout')
768
 
        self.run_bzr(['bind', '.']) # bind to self
769
 
        open('foo.txt', 'w').write('hello')
770
 
        self.run_bzr(['add'])
771
 
        out, err = self.run_bzr(['commit', '-m', 'addedfoo'], 3)
772
 
        self.assertEqual(out, '')
773
 
        self.assertContainsRe(err,
774
 
            'Branch.*test_checkout.*appears to be bound to itself')
775