/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 bzrlib/tests/tree_implementations/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-17 17:25:06 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070217172506-ps0riemt041fkz0q
Track down some non-ascii deficiencies in commit logic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006, 2007 Canonical Ltd
2
2
#
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
27
27
 
28
28
from bzrlib import (
29
29
    errors,
 
30
    tests,
30
31
    transform,
31
32
    )
32
33
from bzrlib.transport import get_transport
164
165
        tt.apply()
165
166
        return self._convert_tree(tree, converter)
166
167
 
 
168
    def get_tree_with_utf8(self, tree):
 
169
        """Generate a tree with a utf8 revision and unicode paths."""
 
170
        paths = [u'f\xf6',
 
171
                 u'b\xe5r/',
 
172
                 u'b\xe5r/b\xe1z',
 
173
                ]
 
174
        # bzr itself does not create unicode file ids, but we want them for
 
175
        # testing.
 
176
        file_ids = [u'f\xf6-id',
 
177
                    u'b\xe5-r-id',
 
178
                    u'b\xe1z-id',
 
179
                   ]
 
180
        try:
 
181
            self.build_tree(paths)
 
182
        except UnicodeError:
 
183
            raise tests.TestSkipped('filesystem does not support unicode.')
 
184
        tree.add(paths, file_ids)
 
185
        try:
 
186
            tree.commit(u'in\xedtial', rev_id=u'r\xe9v-1'.encode('utf8'))
 
187
        except errors.NonAsciiRevisionId:
 
188
            raise tests.TestSkipped('non-ascii revision ids not supported')
 
189
        return self.workingtree_to_test_tree(tree)
 
190
 
167
191
 
168
192
class TreeTestProviderAdapter(WorkingTreeTestProviderAdapter):
169
193
    """Generate test suites for each Tree implementation in bzrlib.