17
17
"""Tests for Branch.sprout()"""
19
20
from bzrlib import (
21
22
revision as _mod_revision,
25
from bzrlib.tests import KnownFailure, SymlinkFeature, UnicodeFilenameFeature
24
26
from bzrlib.tests.branch_implementations import TestCaseWithBranch
97
99
revision_id='rev1a').open_workingtree()
98
100
self.assertEqual('rev1a', wt2.last_revision())
99
101
self.failUnlessExists('target/a')
103
def test_sprout_with_unicode_symlink(self):
104
# this tests bug #272444
105
# Since the trigger function seems to be set_parent_trees, there exists
106
# also a similar test, with name test_unicode_symlink, in class
107
# TestSetParents at file workingtree_implementations/test_parents.py
108
self.requireFeature(SymlinkFeature)
109
self.requireFeature(UnicodeFilenameFeature)
111
tree = self.make_branch_and_tree('tree1')
113
# The link points to a file whose name is an omega
114
# U+03A9 GREEK CAPITAL LETTER OMEGA
115
# UTF-8: ce a9 UTF-16BE: 03a9 Decimal: Ω
116
os.symlink(u'\u03a9','tree1/link_name')
117
tree.add(['link_name'],['link-id'])
120
# python 2.7a0 failed on commit:
121
revision = tree.commit('added a link to a Unicode target')
122
# python 2.5 failed on sprout:
123
tree.bzrdir.sprout('target')
124
except UnicodeEncodeError, e:
125
raise KnownFailure('there is no support for'
126
' symlinks to non-ASCII targets (bug #272444)')