~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
        self.requireFeature(features.UnicodeFilenameFeature)
140
140
        file_name = u'\N{euro sign}'
141
141
        self.run_bzr(['init'])
142
 
        open(file_name, 'w').write('hello world')
 
142
        with open(file_name, 'w') as f: f.write('hello world')
143
143
        self.run_bzr(['add'])
144
144
        out, err = self.run_bzr(['commit', '-m', file_name])
145
145
        reflags = re.MULTILINE|re.DOTALL|re.UNICODE
157
157
        try:
158
158
            osutils.get_terminal_encoding = lambda trace=None: 'ascii'
159
159
            file_name = u'foo\u1234'
160
 
            open(file_name, 'w').write('hello world')
 
160
            with open(file_name, 'w') as f: f.write('hello world')
161
161
            self.run_bzr(['add'])
162
162
            out, err = self.run_bzr(['commit', '-m', file_name])
163
163
            reflags = re.MULTILINE|re.DOTALL|re.UNICODE
628
628
            "Commit refused."],
629
629
            'commit -m add-b --fixes=123',
630
630
            working_dir='tree')
631
 
        tree.branch.get_config().set_user_option("bugtracker", "lp")
 
631
        tree.branch.get_config_stack().set("bugtracker", "lp")
632
632
        self.run_bzr('commit -m hello --fixes=234 tree/hello.txt')
633
633
        last_rev = tree.branch.repository.get_revision(tree.last_revision())
634
634
        self.assertEqual('https://launchpad.net/bugs/234 fixed',
859
859
        Regression test for bug 185211.
860
860
        """
861
861
        tree = self.make_branch_and_tree('.')
862
 
        self.build_tree([u'abc\xc3/', u'abc\xc3/foo'])
 
862
        self.build_tree([u'abc\xa7/', u'abc\xa7/foo'])
863
863
 
864
 
        tree.add([u'abc\xc3/', u'abc\xc3/foo'])
 
864
        tree.add([u'abc\xa7/', u'abc\xa7/foo'])
865
865
        tree.commit('checkin')
866
866
 
867
 
        tree.rename_one(u'abc\xc3','abc')
 
867
        tree.rename_one(u'abc\xa7','abc')
868
868
 
869
869
        self.run_bzr('ci -m "non-ascii mv"')
870
870