On Thu, Aug 18, 2011 at 11:22:38AM +0200, Bert Huijben wrote:
> > -----Original Message-----
> > From: s...@apache.org [mailto:s...@apache.org]
> > Sent: vrijdag 12 augustus 2011 22:49
> > To: comm...@subversion.apache.org
> > Subject: svn commit: r1157246 - in /subversion/trunk/subversion/libsvn_wc:
> > wc-queries.sql wc_db.c
> > 
> > Author: stsp
> > Date: Fri Aug 12 20:49:09 2011
> > New Revision: 1157246
> 
> Reviewing an old patch.
> 
> > 
> > URL: http://svn.apache.org/viewvc?rev=1157246&view=rev
> > Log:
> > When reverting one half of a move, transform the other half into a
> > plain addition/copy.
> > 
> > * subversion/libsvn_wc/wc-queries.sql
> >   (STMT_SELECT_NODE_INFO): Return the moved_here column.
> >   (STMT_SELECT_NODE_INFO_WITH_LOCK): Same here, just for consistency.
> > 
> > * subversion/libsvn_wc/wc_db.c
> >   (clear_moved_to): New helper for op_revert_txn and
> > op_revert_recursive_txn.
> >   (op_revert_txn, op_revert_recursive_txn): Clear the moved-to relpath at
> >    the delete-half of a move for any reverted moved-here node.
> 
> This doesn't look right.
> STMT_SELECT_NODE_INFO and STMT_SELECT_NODE_INFO_WITH_LOCK have exactly the 
> same data in the same column numbers, yet the users of 
> STMT_SELECT_NODE_INFO_WITH_LOCK
> (read: read_info and read_info_children) weren't updated.

Not sure why you mention read_info_children().
It uses STMT_SELECT_NODE_CHILDREN_INFO, not STMT_SELECT_NODE_INFO_WITH_LOCK. 

> The new column that was queried should be at the same position in both 
> queries and the offset of the lock data updated.
 
Does this patch do what you have in mind?

Index: subversion/libsvn_wc/wc-queries.sql
===================================================================
--- subversion/libsvn_wc/wc-queries.sql (revision 1158975)
+++ subversion/libsvn_wc/wc-queries.sql (working copy)
@@ -37,8 +37,8 @@ ORDER BY op_depth DESC
 -- STMT_SELECT_NODE_INFO_WITH_LOCK
 SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision,
   checksum, translated_size, changed_revision, changed_date, changed_author,
-  depth, symlink_target, last_mod_time, properties, lock_token, lock_owner,
-  lock_comment, lock_date, moved_here
+  depth, symlink_target, last_mod_time, properties, moved_here, lock_token,
+  lock_owner, lock_comment, lock_date
 FROM nodes
 LEFT OUTER JOIN lock ON nodes.repos_id = lock.repos_id
   AND nodes.repos_path = lock.repos_relpath
Index: subversion/libsvn_wc/wc_db.c
===================================================================
--- subversion/libsvn_wc/wc_db.c        (revision 1158975)
+++ subversion/libsvn_wc/wc_db.c        (working copy)
@@ -6776,7 +6776,7 @@ read_info(svn_wc__db_status_t *status,
           if (op_depth != 0)
             *lock = NULL;
           else
-            *lock = lock_from_columns(stmt_info, 15, 16, 17, 18, result_pool);
+            *lock = lock_from_columns(stmt_info, 16, 17, 18, 19, result_pool);
         }
 
       if (have_work)

Reply via email to