~ubuntu-branches/ubuntu/oneiric/bzr-svn/oneiric

« back to all changes in this revision

Viewing changes to tests/test_fetch.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-08-26 19:47:18 UTC
  • mfrom: (1.1.31 upstream) (3.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20110826194718-iefslmdqyftcjyxx
Tags: 1.1.0-1
* New upstream release.
 + Fixes problems with sparse revision caches. LP: #795700, LP: #664085
 + Fixes test run against bzr 2.4.0. LP: #828381

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
"""Subversion fetch tests."""
20
20
 
21
 
 
22
21
import os
23
22
import shutil
24
23
import sys
41
40
    NULL_REVISION,
42
41
    )
43
42
from bzrlib.tests import (
44
 
    KnownFailure,
45
43
    TestCase,
46
44
    TestSkipped,
47
 
    SymlinkFeature,
48
45
    )
 
46
try:
 
47
    from bzrlib.tests.features import (
 
48
        SymlinkFeature,
 
49
        )
 
50
except ImportError: # bzr < 2.5
 
51
    from bzrlib.tests import (
 
52
        SymlinkFeature,
 
53
        )
49
54
from bzrlib.trace import (
50
55
    mutter,
51
56
    )
269
274
        rm = oldrepos._revmeta_provider.get_revision("trunk", 3)
270
275
        mapping = oldrepos.get_mapping()
271
276
        self.assertEquals((uuid, "trunk", 3), rm.metarev.get_foreign_revid())
272
 
        self.assertEquals((mapping.revision_id_foreign_to_bzr((uuid, "branches/trunk", 1)), ), rm.get_rhs_parents(mapping))
 
277
        self.assertEquals(
 
278
            (mapping.revision_id_foreign_to_bzr((uuid, "branches/trunk", 1)), ),
 
279
            rm.get_rhs_parents(mapping, rm.get_lhs_parent_revmeta(mapping)))
273
280
        self.assertEquals([], list(rf.find_rhs_parents([(rm, mapping)])))
274
281
 
275
282
    def test_fetch_file_branch(self):
1750
1757
 
1751
1758
    def test_fetch_symlink_with_newlines(self):
1752
1759
        self.requireFeature(SymlinkFeature)
1753
 
        raise KnownFailure("Bazaar doesn't support newlines in symlink targets (#219832)")
1754
1760
        repos_url = self.make_repository('d')
1755
1761
 
1756
1762
        dc = self.get_commit_editor(repos_url)
1763
1769
        oldrepos = Repository.open(repos_url)
1764
1770
        dir = BzrDir.create("f")
1765
1771
        newrepos = dir.create_repository()
1766
 
        self.copy_content(oldrepos, newrepos)
 
1772
        self.expectFailure(
 
1773
            "Bazaar doesn't support newlines in symlink targets (#219832)",
 
1774
            self.copy_content, oldrepos, newrepos)
1767
1775
        mapping = oldrepos.get_mapping()
1768
1776
        self.assertTrue(newrepos.has_revision(
1769
1777
            oldrepos.generate_revision_id(1, "", mapping)))
1858
1866
            oldrepos.generate_revision_id(2, "", mapping)))
1859
1867
        tree1 = newrepos.revision_tree(
1860
1868
                oldrepos.generate_revision_id(2, "", mapping))
1861
 
        raise KnownFailure("not allowing svn:special invalid files to be restored to symlinks yet")
1862
 
        self.assertEqual('symlink', tree1.kind(tree1.path2id("mylink")))
 
1869
        self.expectFailure(
 
1870
            "not allowing svn:special invalid files to be restored to symlinks "
 
1871
            "yet",
 
1872
            self.assertEqual,
 
1873
            'symlink', tree1.kind(tree1.path2id("mylink")))
1863
1874
 
1864
1875
    def test_fetch_symlink_kind_change(self):
1865
1876
        repos_url = self.make_repository('d')