You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2012/11/14 13:28:41 UTC
svn commit: r1409182 - in /subversion/trunk/subversion/tests/cmdline:
depth_tests.py svntest/wc.py
Author: philip
Date: Wed Nov 14 12:28:40 2012
New Revision: 1409182
URL: http://svn.apache.org/viewvc?rev=1409182&view=rev
Log:
Add a regression test for issue 4257, neon sometimes adds a spurious
nodes row. This test is a PASS on trunk and a FAIL on 1.7.
* subversion/tests/cmdline/depth_tests.py
(spurious_nodes_row): New.
(test_list): Add new test.
* subversion/tests/cmdline/svntest/wc.py
(sqlite_stmt): New.
Modified:
subversion/trunk/subversion/tests/cmdline/depth_tests.py
subversion/trunk/subversion/tests/cmdline/svntest/wc.py
Modified: subversion/trunk/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/depth_tests.py?rev=1409182&r1=1409181&r2=1409182&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/depth_tests.py Wed Nov 14 12:28:40 2012
@@ -2905,6 +2905,28 @@ def revert_depth_files(sbox):
svntest.actions.run_and_verify_svn(None, expected_output, [],
'revert', '--depth=files', sbox.ospath('A'))
+@Issue(4257)
+def spurious_nodes_row(sbox):
+ "update produces no spurious rows"
+
+ sbox.build(read_only = True)
+ return
+
+ val1 = svntest.wc.sqlite_stmt(sbox.wc_dir, "select count(*) from nodes")
+ expected_output = svntest.wc.State(sbox.wc_dir, { })
+ expected_disk = svntest.main.greek_state.copy()
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ svntest.actions.run_and_verify_update(sbox.wc_dir,
+ expected_output,
+ expected_disk,
+ expected_status,
+ None, None, None, None, None, False,
+ "--depth=empty", sbox.wc_dir)
+ val2 = svntest.wc.sqlite_stmt(sbox.wc_dir, "select count(*) from nodes")
+ if (val1 != val2):
+ # ra_neon added a spurious not-present row that does not show up in status
+ raise svntest.Failure("count changed from '%s' to '%s'" % (val1, val2))
+
#----------------------------------------------------------------------
# list all tests here, starting with None:
@@ -2955,6 +2977,7 @@ test_list = [ None,
update_below_depth_empty,
commit_then_immediates_update,
revert_depth_files,
+ spurious_nodes_row,
]
if __name__ == "__main__":
Modified: subversion/trunk/subversion/tests/cmdline/svntest/wc.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/wc.py?rev=1409182&r1=1409181&r2=1409182&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/wc.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/wc.py Wed Nov 14 12:28:40 2012
@@ -886,6 +886,14 @@ def text_base_path(file_path):
raise svntest.Failure("No pristine text for " + relpath)
+def sqlite_stmt(wc_root_path, stmt):
+ """Execute STMT on the SQLite wc.db in WC_ROOT_PATH and return the
+ results."""
+
+ db = open_wc_db(wc_root_path)[0]
+ c = db.cursor()
+ c.execute(stmt)
+ return c.fetchall()
# ------------
### probably toss these at some point. or major rework. or something.