view tests/test_fetch_symlinks.py @ 1365:89997a5fc181 stable 1.8.4

stupid: self-disable if svn bindings are too new to work with stupid mode Subversion 1.9 enhanced the diff format slightly in a way that we can't parse. We're collectively weary in hgsubversion of parsing diffs to emulate replay given that ra_replay was new in Subversion 1.5, which is now 7.5 years old. Rather than try to adapt to the diff format changes, we'll disable stupid mode for 1.9 bindings and see if anyone actually bothers to email the list and tell us they saw the message. I figure if we don't see anything by mid 2016 or so we can rip out stupid mode entirely. Disable all tests that use stupid mode when 1.9 is in play. This should actually be a nice runtime win on the testsuite since we'll be running many hundreds fewer tests overall.
author Augie Fackler <raf@durin42.com>
date Thu, 31 Dec 2015 12:06:58 -0500
parents 8b6fb32b001e
children
line wrap: on
line source

import test_util

import unittest

class TestFetchSymlinks(test_util.TestBase):
    stupid_mode_tests = True

    def test_symlinks(self):
        repo = self._load_fixture_and_fetch('symlinks.svndump')
        # Check symlinks throughout history
        links = {
            0: {
                'linka': 'a',
                'linka2': 'a',
                'd/linka': 'a',
                },
            1: {
                'linkaa': 'a',
                'linka2': 'a',
                'd2/linka': 'a',
                },
            2: {
                'linkaa': 'b',
                'linka2': 'a',
                'd2/linka': 'b',
                },
            3: {
                },
            4: {
                'linka3': 'a',
                },
            5: {
                'linka3': 'a',
                },
            6: {
                'linka3': 'a',
                'linka4': 'link to this',
                },
            }

        for rev in repo:
            ctx = repo[rev]
            for f in ctx.manifest():
                l = 'l' in ctx[f].flags()
                lref = f in links[rev]
                self.assertEqual(lref, l, '%r != %r for %s@%r' % (lref, l, f, rev))
                if f in links[rev]:
                    self.assertEqual(links[rev][f], ctx[f].data())
            for f in links[rev]:
                self.assertTrue(f in ctx)

class TestMergeSpecial(test_util.TestBase):
    stupid_mode_tests = True

    def test_special(self):
        repo = self._load_fixture_and_fetch('addspecial.svndump',
                                            subdir='trunk')
        ctx = repo['tip']
        self.assertEqual(ctx['fnord'].flags(), 'l')
        self.assertEqual(ctx['exe'].flags(), 'x')