Author: rhuijben
Date: Sat Jun 30 21:04:30 2012
New Revision: 1355813

URL: http://svn.apache.org/viewvc?rev=1355813&view=rev
Log:
Fix the conflict marker fetch query, to really fetch the information that it
needs.

Somehow our test suite doesn't detect this error class.
I'm surprised that out of range column indexes are handled as NULL by Sqlite.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_CONFLICT_MARKER_FILES1): Don't check uninteresting columns.
  (STMT_SELECT_CONFLICT_MARKER_FILES2): Fetch all interesting columns.

* subversion/tests/cmdline/copy_tests.py
  (copy_text_conflict): New function.
  (test_list): Add copy_text_conflict.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/tests/cmdline/copy_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1355813&r1=1355812&r2=1355813&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Sat Jun 30 21:04:30 
2012
@@ -746,11 +746,10 @@ WHERE wc_id = ?1 AND parent_relpath = ?2
 SELECT prop_reject
 FROM actual_node
 WHERE wc_id = ?1 AND local_relpath = ?2
-  AND ((prop_reject IS NOT NULL) OR (conflict_old IS NOT NULL)
-       OR (conflict_new IS NOT NULL) OR (conflict_working IS NOT NULL))
+  AND (prop_reject IS NOT NULL)
 
 -- STMT_SELECT_CONFLICT_MARKER_FILES2
-SELECT prop_reject
+SELECT prop_reject, conflict_old, conflict_new, conflict_working
 FROM actual_node
 WHERE wc_id = ?1 AND parent_relpath = ?2
   AND ((prop_reject IS NOT NULL) OR (conflict_old IS NOT NULL)

Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=1355813&r1=1355812&r2=1355813&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Sat Jun 30 21:04:30 
2012
@@ -5694,6 +5694,54 @@ def copy_to_unversioned_parent(sbox):
                                      sbox.ospath('A/B'),
                                      sbox.ospath('Unversioned/B2'))
 
+def copy_text_conflict(sbox):
+  "copy with a text conflict should not copy markers"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  mu_path = sbox.ospath('A/mu')
+  svntest.main.file_append(mu_path, 'appended mu text')
+
+  sbox.simple_commit()
+  svntest.main.file_append(mu_path, 'appended mu text')
+
+  sbox.simple_update(revision='1')
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     sbox.ospath('A'),
+                                     sbox.ospath('A_copied'))
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', status='C ')
+  expected_status.add({
+    # The markers in A
+    'A/mu.mine'         : Item(status='? '),
+    'A/mu.r1'           : Item(status='? '),
+    'A/mu.r2'           : Item(status='? '),
+    # And what is copied (without markers)
+    'A_copied'          : Item(status='A ', copied='+', wc_rev='-'),
+    'A_copied/C'        : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/B'        : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/B/lambda' : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/B/E'      : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/B/E/alpha': Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/B/E/beta' : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/B/F'      : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D'        : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/G'      : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/G/tau'  : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/G/rho'  : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/G/pi'   : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/H'      : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/H/omega': Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/H/psi'  : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/H/chi'  : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/D/gamma'  : Item(status='  ', copied='+', wc_rev='-'),
+    'A_copied/mu'       : Item(status='M ', copied='+', wc_rev='-'),
+  })
+  svntest.actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
 ########################################################################
 # Run the tests
 
@@ -5809,6 +5857,7 @@ test_list = [ None,
               wc_wc_copy_incomplete,
               three_nested_moves,
               copy_to_unversioned_parent,
+              copy_text_conflict,
              ]
 
 if __name__ == '__main__':


Reply via email to