~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-11 14:28:01 UTC
  • mfrom: (3703.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080911142801-kssx0sqg51xsvqzr
(vila) Fixes for OSX test suite

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
 
273
273
    def _create_tree_with_utf8(self, tree):
274
274
        """Generate a tree with a utf8 revision and unicode paths."""
 
275
        # We avoid combining characters in file names here, normalization
 
276
        # checks (as performed by some file systems (OSX) are outside the scope
 
277
        # of these tests).  We use the euro sign \N{Euro Sign} or \u20ac in
 
278
        # unicode strings or '\xe2\x82\ac' (its utf-8 encoding) in raw strings.
275
279
        paths = [u'',
276
 
                 u'f\xf6',
277
 
                 u'b\xe5r/',
278
 
                 u'b\xe5r/b\xe1z',
 
280
                 u'fo\N{Euro Sign}o',
 
281
                 u'ba\N{Euro Sign}r/',
 
282
                 u'ba\N{Euro Sign}r/ba\N{Euro Sign}z',
279
283
                ]
280
284
        # bzr itself does not create unicode file ids, but we want them for
281
285
        # testing.
282
286
        file_ids = ['TREE_ROOT',
283
 
                    'f\xc3\xb6-id',
284
 
                    'b\xc3\xa5r-id',
285
 
                    'b\xc3\xa1z-id',
 
287
                    'fo\xe2\x82\xaco-id',
 
288
                    'ba\xe2\x82\xacr-id',
 
289
                    'ba\xe2\x82\xacz-id',
286
290
                   ]
287
291
        try:
288
292
            self.build_tree(paths[1:])
304
308
        """Generate a tree with utf8 ancestors."""
305
309
        self._create_tree_with_utf8(tree)
306
310
        tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
307
 
        self.build_tree([u'tree2/b\xe5r/z\xf7z'])
308
 
        tree2.add([u'b\xe5r/z\xf7z'], [u'z\xf7z-id'.encode('utf-8')])
 
311
        self.build_tree([u'tree2/ba\N{Euro Sign}r/qu\N{Euro Sign}x'])
 
312
        tree2.add([u'ba\N{Euro Sign}r/qu\N{Euro Sign}x'],
 
313
                  [u'qu\N{Euro Sign}x-id'.encode('utf-8')])
309
314
        tree2.commit(u'to m\xe9rge', rev_id=u'r\xe9v-2'.encode('utf8'))
310
315
 
311
316
        tree.merge_from_branch(tree2.branch)