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/05/04 16:17:33 UTC

svn commit: r1333979 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: philip
Date: Fri May  4 14:17:33 2012
New Revision: 1333979

URL: http://svn.apache.org/viewvc?rev=1333979&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (follow_moved_to): Rename variables, remove one and reuse an earlier one.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1333979&r1=1333978&r2=1333979&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri May  4 14:17:33 2012
@@ -10191,7 +10191,7 @@ follow_moved_to(apr_array_header_t **mov
   svn_sqlite__stmt_t *stmt;
   svn_boolean_t have_row;
   int working_op_depth;
-  const char *node_relpath, *node_moved_to = NULL;
+  const char *ancestor_relpath, *node_moved_to = NULL;
   int i;
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
@@ -10236,67 +10236,65 @@ follow_moved_to(apr_array_header_t **mov
     return SVN_NO_ERROR;
 
   /* Need to handle being moved via an ancestor. */
-  node_relpath = local_relpath;
+  ancestor_relpath = local_relpath;
   for (i = relpath_depth(local_relpath); i > working_op_depth; --i)
     {
-      const char *node_moved_to_relpath, *moved_to_relpath;
+      const char *ancestor_moved_to;
 
-      node_relpath = svn_relpath_dirname(node_relpath, scratch_pool);
+      ancestor_relpath = svn_relpath_dirname(ancestor_relpath, scratch_pool);
 
       SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                         STMT_SELECT_MOVED_TO));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, node_relpath,
+      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, ancestor_relpath,
                                 working_op_depth));
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
       SVN_ERR_ASSERT(have_row);
-      node_moved_to_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
+      ancestor_moved_to = svn_sqlite__column_text(stmt, 0, scratch_pool);
       SVN_ERR(svn_sqlite__reset(stmt));
-      if (node_moved_to_relpath)
+      if (ancestor_moved_to)
         {
-          moved_to_relpath
-            = svn_relpath_join(node_moved_to_relpath,
-                               svn_relpath_skip_ancestor(node_relpath,
+          node_moved_to
+            = svn_relpath_join(ancestor_moved_to,
+                               svn_relpath_skip_ancestor(ancestor_relpath,
                                                          local_relpath),
                                result_pool);
 
           SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                             STMT_SELECT_MOVED_HERE));
-          SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
-                                    moved_to_relpath,
-                                    relpath_depth(node_moved_to_relpath)));
+          SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, node_moved_to,
+                                    relpath_depth(ancestor_moved_to)));
           SVN_ERR(svn_sqlite__step(&have_row, stmt));
           if (!have_row)
-            node_moved_to_relpath = NULL;
+            ancestor_moved_to = NULL;
           else if (!svn_sqlite__column_int(stmt, 0))
             {
               svn_wc__db_status_t presence
                 = svn_sqlite__column_token(stmt, 1, presence_map);
               if (presence != svn_wc__db_status_not_present)
-                node_moved_to_relpath = NULL;
+                ancestor_moved_to = NULL;
               else
                 {
                   SVN_ERR(svn_sqlite__step(&have_row, stmt));
                   if (!have_row && !svn_sqlite__column_int(stmt, 0))
-                    node_moved_to_relpath = NULL;
+                    ancestor_moved_to = NULL;
                 }
             }
           SVN_ERR(svn_sqlite__reset(stmt));
-          if (!node_moved_to_relpath)
+          if (!ancestor_moved_to)
             break;
           /* verify repos_path points back? */
         }
-      if (node_moved_to_relpath)
+      if (ancestor_moved_to)
         {
           struct svn_wc__db_moved_to_t *moved_to;
 
           moved_to = apr_palloc(result_pool, sizeof(*moved_to));
           moved_to->op_depth = working_op_depth;
-          moved_to->local_relpath = moved_to_relpath;
+          moved_to->local_relpath = node_moved_to;
           APR_ARRAY_PUSH(*moved_tos, struct svn_wc__db_moved_to_t *) = moved_to;
 
-          SVN_ERR(follow_moved_to(moved_tos,
-                                  relpath_depth(node_moved_to_relpath),
-                                  wcroot, moved_to_relpath,
+          SVN_ERR(follow_moved_to(moved_tos, relpath_depth(ancestor_moved_to),
+                                  wcroot, node_moved_to,
                                   result_pool, scratch_pool));
           break;
         }