[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svn commit: r979303 and issue #2530?

From: Paul Burba <ptburba_at_gmail.com>
Date: Thu, 21 Apr 2011 15:10:21 -0400

> 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?

Paul

> x3_1_4_6,
> x3_1_6_12,
> ]
>
Received on 2011-04-21 21:10:49 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.