1
# Copyright (C) 2006-2010 Canonical Ltd
1
# Copyright (C) 2006-2011 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
111
113
def test_unicode_commit_message_is_filename(self):
112
114
"""Unicode commit message same as a filename (Bug #563646).
116
self.requireFeature(UnicodeFilenameFeature)
114
117
file_name = u'\N{euro sign}'
115
118
self.run_bzr(['init'])
116
119
open(file_name, 'w').write('hello world')
716
719
f = file('fed.bat', 'w')
717
720
f.write('@rem dummy fed')
719
osutils.set_or_unset_env('BZR_EDITOR', "fed.bat")
722
self.overrideEnv('BZR_EDITOR', "fed.bat")
721
724
f = file('fed.sh', 'wb')
722
725
f.write('#!/bin/sh\n')
724
727
os.chmod('fed.sh', 0755)
725
osutils.set_or_unset_env('BZR_EDITOR', "./fed.sh")
728
self.overrideEnv('BZR_EDITOR', "./fed.sh")
727
730
def setup_commit_with_template(self):
728
731
self.setup_editor()
754
757
open('foo.txt', 'w').write('hello')
755
758
self.run_bzr(['add'])
756
osutils.set_or_unset_env('EMAIL', None)
757
osutils.set_or_unset_env('BZR_EMAIL', None)
759
self.overrideEnv('EMAIL', None)
760
self.overrideEnv('BZR_EMAIL', None)
758
761
out, err = self.run_bzr(['commit', '-m', 'initial'], 3)
759
762
self.assertContainsRe(err, 'Unable to determine your name')
764
def test_commit_recursive_checkout(self):
765
"""Ensure that a commit to a recursive checkout fails cleanly.
767
self.run_bzr(['init', 'test_branch'])
768
self.run_bzr(['checkout', 'test_branch', 'test_checkout'])
769
os.chdir('test_checkout')
770
self.run_bzr(['bind', '.']) # bind to self
771
open('foo.txt', 'w').write('hello')
772
self.run_bzr(['add'])
773
out, err = self.run_bzr(['commit', '-m', 'addedfoo'], 3)
774
self.assertEqual(out, '')
775
self.assertContainsRe(err,
776
'Branch.*test_checkout.*appears to be bound to itself')