On Thu, Apr 21, 2011 at 3:10 PM, Paul Burba <ptburba_at_gmail.com> wrote:
>> Add a simple property verifyer to the upgrade tests to test if the upgrade
>> code correctly handles property upgrades. This makes issue #2530 visible on
>> the current test data.
>>
>> * subversion/tests/cmdline/upgrade_tests.py
>> Â (simple_property_verify): New helper function.
>> Â (do_x3_upgrade): Verify properties before and after revert ti
>> Â Â show handling of revert properties.
>>
>> --- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py  2010/07/26
>> 14:21:47 Â Â Â Â 979302
>> +++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py  2010/07/26
>> 14:24:43 Â Â Â Â 979303
>> @@ -107,6 +107,60 @@
>>
>> Â db.close()
>>
>> +# Very simple working copy property diff handler for single line
>> textual properties
>> +# Should probably be moved to svntest/actions.py after some major refactoring.
>> +def simple_property_verify(dir_path, expected_props):
>> +
>> + Â # Shows all items in dict1 that are not also in dict2
>> + Â def diff_props(dict1, dict2, name, match):
>> +
>> + Â Â equal = True;
>> + Â Â for key in dict1:
>> + Â Â Â node = dict1[key]
>> + Â Â Â node2 = dict2.get(key, None)
>> + Â Â Â if node2:
>> + Â Â Â Â for prop in node:
>> + Â Â Â Â Â v1 = node[prop]
>> + Â Â Â Â Â v2 = node2.get(prop, None)
>> +
>> + Â Â Â Â Â if not v2:
>> + Â Â Â Â Â Â print('\'%s\' property on \'%s\' not found in %s' %
>> + Â Â Â Â Â Â Â Â Â (prop, key, name))
>> + Â Â Â Â Â Â equal = False
>> + Â Â Â Â Â if match and v1 != v2:
>> + Â Â Â Â Â Â print('Expected \'%s\' on \'%s\' to be \'%s\', but found \'%s\'' %
>> + Â Â Â Â Â Â Â Â Â (prop, key, v1, v2))
>> + Â Â Â Â Â Â equal = False
>> + Â Â Â else:
>> + Â Â Â Â print('\'%s\': %s not found in %s' % (key, dict1[key], name))
>> + Â Â Â Â equal = False
>> +
>> + Â Â return equal
>> +
>> +
>> + Â exit_code, output, errput = svntest.main.run_svn(None, 'proplist', '-R',
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â '-v', dir_path)
>> +
>> + Â actual_props = {}
>> + Â target = None
>> + Â name = None
>> +
>> + Â for i in output:
>> + Â Â if i.startswith('Properties on '):
>> + Â Â Â target = i[15+len(dir_path)+1:-3].replace(os.path.sep, '/')
>> + Â Â elif not i.startswith(' Â Â '):
>> + Â Â Â name = i.strip()
>> + Â Â else:
>> + Â Â Â v = actual_props.get(target, {})
>> + Â Â Â v[name] = i.strip()
>> + Â Â Â actual_props[target] = v
>> +
>> + Â v1 = diff_props(expected_props, actual_props, 'actual', True)
>> + Â v2 = diff_props(actual_props, expected_props, 'expected', False)
>> +
>> + Â if not v1 or not v2:
>> + Â Â print('Actual properties: %s' % actual_props)
>> + Â Â raise svntest.Failure("Properties unequal")
>>
>> Â def run_and_verify_status_no_server(wc_dir, expected_status):
>> Â "same as svntest.actions.run_and_verify_status(), but without '-u'"
>> @@ -401,6 +455,29 @@
>> Â Â })
>> Â run_and_verify_status_no_server(sbox.wc_dir, expected_status)
>>
>> + Â simple_property_verify(sbox.wc_dir, {
>> + Â Â Â 'A/B_new/E/beta' Â Â : {'x3' Â Â Â Â Â : '3x',
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â 'svn:eol-style': 'native'},
>> + Â Â Â 'A/B/E/beta' Â Â Â Â : {'s' Â Â Â Â Â Â : 't',
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â 'svn:eol-style': 'native'},
>> + Â Â Â 'A/B_new/B/E/alpha' : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B/E/alpha' Â Â Â : {'q': 'r',
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â 'svn:eol-style': 'native'},
>> + Â Â Â 'A_new/alpha' Â Â Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B_new/B/new' Â Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B_new/E/alpha' Â : {'svn:eol-style': 'native',
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â 'u': 'v'},
>> + Â Â Â 'A/B_new/B/E' Â Â Â : {'q': 'r'},
>> + Â Â Â 'A/B_new/lambda' Â Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B_new/E' Â Â Â Â : {'x3': '3x'},
>> + Â Â Â 'A/B_new/new' Â Â Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B/lambda' Â Â Â Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B_new/B/E/beta' Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B_new/B/lambda' Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B/new' Â Â Â Â Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/G_new/rho' Â Â Â : {'svn:eol-style': 'native'}
>> + Â })
>> +
>> Â svntest.actions.run_and_verify_svn(None, 'Reverted.*', [],
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 'revert', '-R', sbox.wc_dir)
>>
>> @@ -425,6 +502,12 @@
>> Â Â })
>> Â run_and_verify_status_no_server(sbox.wc_dir, expected_status)
>>
>> + Â simple_property_verify(sbox.wc_dir, {
>> + Â Â Â 'A/B/E/beta' Â Â Â Â : {'svn:eol-style': 'native'},
>> +# Â Â Â 'A/B/lambda' Â Â Â Â : {'svn:eol-style': 'native'},
>> + Â Â Â 'A/B/E/alpha' Â Â Â : {'svn:eol-style': 'native'}
>> + Â })
>> +
>> Â def x3_1_4_0(sbox):
>> Â "3x same wc upgrade 1.4.0 test"
>>
>> @@ -462,7 +545,9 @@
>> Â Â Â Â Â Â Â logs_left_1_5,
>> Â Â Â Â Â Â Â upgrade_wcprops,
>> Â Â Â Â Â Â Â basic_upgrade_1_0,
>> - Â Â Â Â Â Â Â x3_1_4_0,
>> + Â Â Â Â Â Â Â # Upgrading from 1.4.0-1.4.5 with specific states fails
>> + Â Â Â Â Â Â Â # See issue #2530
>> + Â Â Â Â Â Â Â XFail(x3_1_4_0),
>
> Bert,
>
> I assume the reference to issue #2530 'merging a
> symlink-turned-into-regular file fails and wedges working copy' is a
> typo as it doesn't appear to have anything to do with this test(?).
> Further, issue #2530 is marked as Resolved/Fixed. Â What is the correct
> issue for this test?
Ping...
> Paul
>
>> Â Â Â Â Â Â Â x3_1_4_6,
>> Â Â Â Â Â Â Â x3_1_6_12,
>> Â Â Â Â Â Â Â ]
>>
>
Received on 2011-05-06 16:01:38 CEST