subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1167304 - in /subversion/trunk/subversion/libsvn_wc: entries.c wc-queries.sql wc_db.c
Date Fri, 09 Sep 2011 17:35:55 GMT
Author: philip
Date: Fri Sep  9 17:35:54 2011
New Revision: 1167304

URL: http://svn.apache.org/viewvc?rev=1167304&view=rev
Log:
When upgrading set the file_external flag in file-external NODES rows
and use that to set kind='file' in the EXTERNALS rows.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_INSERT_EXTERNAL_UPGRADE): New.

* subversion/libsvn_wc/entries.c
  (write_entry): Set file_external in NODES row.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_upgrade_apply_props): Use STMT_INSERT_EXTERNAL_UPGRADE.

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1167304&r1=1167303&r2=1167304&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Fri Sep  9 17:35:54 2011
@@ -1979,6 +1979,9 @@ write_entry(struct write_baton **entry_n
       base_node->changed_date = entry->cmt_date;
       base_node->changed_author = entry->cmt_author;
 
+      if (entry->file_external_path)
+        base_node->file_external = TRUE;
+
       SVN_ERR(insert_node(sdb, base_node, scratch_pool));
 
       /* We have to insert the lock after the base node, because the node
@@ -1996,12 +1999,6 @@ write_entry(struct write_baton **entry_n
           SVN_ERR(svn_wc__db_lock_add(db, tmp_entry_abspath, &lock,
                                       scratch_pool));
         }
-
-      /* Now, update the file external information. */
-      if (entry->file_external_path)
-        {
-          base_node->file_external = TRUE;
-        }
     }
 
   if (below_working_node)

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1167304&r1=1167303&r2=1167304&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Fri Sep  9 17:35:54 2011
@@ -949,6 +949,16 @@ INSERT OR REPLACE INTO externals (
     repos_id, def_repos_relpath, def_operational_revision, def_revision)
 VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10)
 
+-- STMT_INSERT_EXTERNAL_UPGRADE
+INSERT OR REPLACE INTO externals (
+    wc_id, local_relpath, parent_relpath, presence, kind, def_local_relpath,
+    repos_id, def_repos_relpath, def_operational_revision, def_revision)
+SELECT ?1, ?2, ?3, ?4,
+       CASE WHEN file_external IS NOT NULL THEN 'file' ELSE 'unknown' END,
+       ?5, ?6, ?7, ?8, ?9
+FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
+
 -- STMT_SELECT_EXTERNAL_INFO
 SELECT presence, kind, def_local_relpath, repos_id,
     def_repos_relpath, def_operational_revision, def_revision

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1167304&r1=1167303&r2=1167304&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Sep  9 17:35:54 2011
@@ -10375,7 +10375,8 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
           int i;
           apr_array_header_t *ext;
 
-          SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_EXTERNAL));
+          SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+                                            STMT_INSERT_EXTERNAL_UPGRADE));
 
           SVN_ERR(svn_wc_parse_externals_description3(
                             &ext, svn_dirent_join(dir_abspath, local_relpath,
@@ -10390,13 +10391,12 @@ svn_wc__db_upgrade_apply_props(svn_sqlit
               item_relpath = svn_relpath_join(local_relpath, item->target_dir,
                                               scratch_pool);
 
-              SVN_ERR(svn_sqlite__bindf(stmt, "isssssis",
+              SVN_ERR(svn_sqlite__bindf(stmt, "issssis",
                                         wc_id,
                                         item_relpath,
                                         svn_relpath_dirname(item_relpath,
                                                             scratch_pool),
                                         "normal",
-                                        "unknown",
                                         local_relpath,
                                         (apr_int64_t)1, /* repos_id */
                                         "" /* repos_relpath */));



Mime
View raw message