Rev 3862: (mbp) add xfail tests for unicode symlink targets in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Nov 27 06:01:38 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3862
revision-id: pqm at pqm.ubuntu.com-20081127060133-uxj1a237vdm65w3d
parent: pqm at pqm.ubuntu.com-20081127052415-9hb2n5pppt7imsb3
parent: dcl441-bugs at yahoo.com-20081027010630-28hxmo4b37qzs8aw
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2008-11-27 06:01:33 +0000
message:
  (mbp) add xfail tests for unicode symlink targets
modified:
  bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
  bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.13
    revision-id: dcl441-bugs at yahoo.com-20081027010630-28hxmo4b37qzs8aw
    parent: dcl441-bugs at yahoo.com-20081027010206-a7jl4flseuk1zvvj
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests7
    timestamp: Mon 2008-10-27 02:06:30 +0100
    message:
      Broken long line
    modified:
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.12
    revision-id: dcl441-bugs at yahoo.com-20081027010206-a7jl4flseuk1zvvj
    parent: dcl441-bugs at yahoo.com-20081026181549-w2i3vws5jgqkfimp
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests7
    timestamp: Mon 2008-10-27 02:02:06 +0100
    message:
      Made the tests pass on Python 2.4 and 2.7a0
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.11
    revision-id: dcl441-bugs at yahoo.com-20081026181549-w2i3vws5jgqkfimp
    parent: dcl441-bugs at yahoo.com-20081018113213-ob1gg82a115yr2ky
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests7
    timestamp: Sun 2008-10-26 19:15:49 +0100
    message:
      More detailed comment and in broken line
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
    ------------------------------------------------------------
    revno: 3763.9.10
    revision-id: dcl441-bugs at yahoo.com-20081018113213-ob1gg82a115yr2ky
    parent: dcl441-bugs at yahoo.com-20081018102403-lcnunxpp70xe6hyl
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests7
    timestamp: Sat 2008-10-18 13:32:13 +0200
    message:
      Corrected call to set_parents_ids to simulate an uncommit instead of being a no-op
    modified:
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.9
    revision-id: dcl441-bugs at yahoo.com-20081018102403-lcnunxpp70xe6hyl
    parent: dcl441-bugs at yahoo.com-20081018101146-y5h988pyatx7jzd5
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests7
    timestamp: Sat 2008-10-18 12:24:03 +0200
    message:
      Used a greek omega instead of an accented 'o' to avoid combining characters
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.8
    revision-id: dcl441-bugs at yahoo.com-20081018101146-y5h988pyatx7jzd5
    parent: dcl441-bugs at yahoo.com-20081017091525-cwlnn4e7qj05k92c
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests7
    timestamp: Sat 2008-10-18 12:11:46 +0200
    message:
      Broken lines, and prepended # before bug numbers
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.7
    revision-id: dcl441-bugs at yahoo.com-20081017091525-cwlnn4e7qj05k92c
    parent: dcl441-bugs at yahoo.com-20081012001006-ly276ube53uz3xru
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests
    timestamp: Fri 2008-10-17 11:15:25 +0200
    message:
      Tested Unicode target rather than always trying to create it in UTF-8. Test renamed
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.6
    revision-id: dcl441-bugs at yahoo.com-20081012001006-ly276ube53uz3xru
    parent: dcl441-bugs at yahoo.com-20081012000926-lri7k9koo02hvh3s
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests6
    timestamp: Sun 2008-10-12 02:10:06 +0200
    message:
      Added bug number to the error reports
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.5
    revision-id: dcl441-bugs at yahoo.com-20081012000926-lri7k9koo02hvh3s
    parent: dcl441-bugs at yahoo.com-20081006195639-iwex98qlyt0y32b6
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests6
    timestamp: Sun 2008-10-12 02:09:26 +0200
    message:
      Used str instead of unicode type to create the intended the symlink target
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.4
    revision-id: dcl441-bugs at yahoo.com-20081006195639-iwex98qlyt0y32b6
    parent: dcl441-bugs at yahoo.com-20081006192628-95rujprocvrjy8sn
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests
    timestamp: Mon 2008-10-06 21:56:39 +0200
    message:
      New test for utf-8 symlinks in BzrDir.sprout
    modified:
      bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
    ------------------------------------------------------------
    revno: 3763.9.3
    revision-id: dcl441-bugs at yahoo.com-20081006192628-95rujprocvrjy8sn
    parent: dcl441-bugs at yahoo.com-20081005164148-t7ecivxr85scbmmk
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests
    timestamp: Mon 2008-10-06 21:26:28 +0200
    message:
      Clearer test with better names and just one parent
    modified:
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.2
    revision-id: dcl441-bugs at yahoo.com-20081005164148-t7ecivxr85scbmmk
    parent: dcl441-bugs at yahoo.com-20081005163037-o68zpgg667p4sqmf
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests3
    timestamp: Sun 2008-10-05 18:41:48 +0200
    message:
      Adapted test to use set_parent_ids and raise KnownFailure
    modified:
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
    ------------------------------------------------------------
    revno: 3763.9.1
    revision-id: dcl441-bugs at yahoo.com-20081005163037-o68zpgg667p4sqmf
    parent: pqm at pqm.ubuntu.com-20081002172844-d6df1l8dzpsqzyup
    committer: Daniel Clemente <dcl441-bugs at yahoo.com>
    branch nick: tests3
    timestamp: Sun 2008-10-05 18:30:37 +0200
    message:
      New testcase for bug 272444 (support symlinks to non-ASCII files)
    modified:
      bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
=== modified file 'bzrlib/tests/branch_implementations/test_sprout.py'
--- a/bzrlib/tests/branch_implementations/test_sprout.py	2007-11-01 09:52:45 +0000
+++ b/bzrlib/tests/branch_implementations/test_sprout.py	2008-10-27 01:02:06 +0000
@@ -16,11 +16,13 @@
 
 """Tests for Branch.sprout()"""
 
+import os
 from bzrlib import (
     remote,
     revision as _mod_revision,
     tests,
     )
+from bzrlib.tests import KnownFailure, SymlinkFeature, UnicodeFilenameFeature
 from bzrlib.tests.branch_implementations import TestCaseWithBranch
 
 
@@ -97,3 +99,29 @@
             revision_id='rev1a').open_workingtree()
         self.assertEqual('rev1a', wt2.last_revision())
         self.failUnlessExists('target/a')
+
+    def test_sprout_with_unicode_symlink(self):
+        # this tests bug #272444
+        # Since the trigger function seems to be set_parent_trees, there exists
+        # also a similar test, with name test_unicode_symlink, in class
+        # TestSetParents at file workingtree_implementations/test_parents.py
+        self.requireFeature(SymlinkFeature)
+        self.requireFeature(UnicodeFilenameFeature)
+
+        tree = self.make_branch_and_tree('tree1')
+
+        # The link points to a file whose name is an omega
+        # U+03A9 GREEK CAPITAL LETTER OMEGA
+        # UTF-8: ce a9  UTF-16BE: 03a9  Decimal: &#937;
+        os.symlink(u'\u03a9','tree1/link_name')
+        tree.add(['link_name'],['link-id'])
+
+        try:
+            # python 2.7a0 failed on commit:
+            revision = tree.commit('added a link to a Unicode target')
+            # python 2.5 failed on sprout:
+            tree.bzrdir.sprout('target')
+        except UnicodeEncodeError, e:
+            raise KnownFailure('there is no support for'
+                               ' symlinks to non-ASCII targets (bug #272444)')
+

=== modified file 'bzrlib/tests/workingtree_implementations/test_parents.py'
--- a/bzrlib/tests/workingtree_implementations/test_parents.py	2008-08-12 13:07:00 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_parents.py	2008-10-27 01:06:30 +0000
@@ -32,7 +32,12 @@
     InventoryLink,
     )
 from bzrlib.revision import Revision
-from bzrlib.tests import SymlinkFeature, TestNotApplicable
+from bzrlib.tests import (
+    KnownFailure,
+    SymlinkFeature,
+    TestNotApplicable,
+    UnicodeFilenameFeature,
+    )
 from bzrlib.tests.workingtree_implementations import TestCaseWithWorkingTree
 from bzrlib.uncommit import uncommit
 
@@ -227,6 +232,30 @@
                             (rev3, rev_tree3)])
         self.assertConsistentParents([rev2, rev3], t)
 
+    def test_unicode_symlink(self):
+        # this tests bug #272444
+        self.requireFeature(SymlinkFeature)
+        self.requireFeature(UnicodeFilenameFeature)
+
+        tree = self.make_branch_and_tree('tree1')
+
+        # The link points to a file whose name is an omega
+        # U+03A9 GREEK CAPITAL LETTER OMEGA
+        # UTF-8: ce a9  UTF-16BE: 03a9  Decimal: &#937;
+        os.symlink(u'\u03a9','tree1/link_name')
+        tree.add(['link_name'],['link-id'])
+
+        try:
+            # the actual commit occurs without errors (strangely):
+            revision1 = tree.commit('added a link to a Unicode target')
+            # python 2.4 failed with UnicodeDecodeError on this commit:
+            revision2 = tree.commit('this revision will be discarded')
+            # python 2.5 failed with UnicodeEncodeError on set_parent_ids:
+            tree.set_parent_ids([revision1])
+        except (UnicodeEncodeError, UnicodeDecodeError):
+            raise KnownFailure('there is no support for'
+                               ' symlinks to non-ASCII targets (bug #272444)')
+
 
 class TestAddParent(TestParents):
 




More information about the bazaar-commits mailing list