subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1479901 [4/7] - in /subversion/branches/wc-collate-path: ./ build/ac-macros/ build/generator/ build/generator/templates/ contrib/server-side/fsfsfixer/ contrib/server-side/fsfsfixer/fixer/ subversion/bindings/ctypes-python/ subversion/bind...
Date Tue, 07 May 2013 13:26:27 GMT
Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/entries.c Tue May  7 13:26:25
2013
@@ -73,6 +73,7 @@ typedef struct db_node_t {
   apr_time_t recorded_time;
   apr_hash_t *properties;
   svn_boolean_t file_external;
+  apr_array_header_t *inherited_props;
 } db_node_t;
 
 typedef struct db_actual_node_t {
@@ -1521,6 +1522,10 @@ insert_node(svn_sqlite__db_t *sdb,
   if (node->file_external)
     SVN_ERR(svn_sqlite__bind_int(stmt, 20, 1));
 
+  if (node->inherited_props)
+    SVN_ERR(svn_sqlite__bind_iprops(stmt, 23, node->inherited_props,
+                                    scratch_pool));
+
   SVN_ERR(svn_sqlite__insert(NULL, stmt));
 
   return SVN_NO_ERROR;
@@ -1574,6 +1579,31 @@ insert_actual_node(svn_sqlite__db_t *sdb
   return svn_error_trace(svn_sqlite__insert(NULL, stmt));
 }
 
+static svn_boolean_t
+is_switched(db_node_t *parent,
+            db_node_t *child,
+            apr_pool_t *scratch_pool)
+{
+  if (parent && child)
+    {
+      if (parent->repos_id != child->repos_id)
+        return TRUE;
+
+      if (parent->repos_relpath && child->repos_relpath)
+        {
+          const char *unswitched
+            = svn_relpath_join(parent->repos_relpath,
+                               svn_relpath_basename(child->local_relpath,
+                                                    scratch_pool),
+                               scratch_pool);
+          if (strcmp(unswitched, child->repos_relpath))
+            return TRUE;
+        }
+    }
+
+  return FALSE;
+}
+
 struct write_baton {
   db_node_t *base;
   db_node_t *work;
@@ -2071,6 +2101,12 @@ write_entry(struct write_baton **entry_n
       if (entry->file_external_path)
         base_node->file_external = TRUE;
 
+      /* Switched nodes get an empty iprops cache. */
+      if (parent_node
+          && is_switched(parent_node->base, base_node, scratch_pool))
+        base_node->inherited_props
+          = apr_array_make(scratch_pool, 0, sizeof(svn_prop_inherited_item_t*));
+
       SVN_ERR(insert_node(sdb, base_node, scratch_pool));
 
       /* We have to insert the lock after the base node, because the node

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/props.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/props.c Tue May  7 13:26:25 2013
@@ -1626,9 +1626,9 @@ validate_eol_prop_against_file(const cha
   if (mime_type && svn_mime_type_is_binary(mime_type->data))
     return svn_error_createf
       (SVN_ERR_ILLEGAL_TARGET, NULL,
-       _("Can't set '" SVN_PROP_EOL_STYLE "': "
+       _("Can't set '%s': "
          "file '%s' has binary mime type property"),
-       path_display);
+       SVN_PROP_EOL_STYLE, path_display);
 
   /* Now ask the getter for the contents of the file; this will do a
      newline translation.  All we really care about here is whether or

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/update_editor.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/update_editor.c Tue May  7 13:26:25
2013
@@ -3525,6 +3525,48 @@ open_file(const char *path,
   return SVN_NO_ERROR;
 }
 
+/* Implements svn_stream_lazyopen_func_t. */
+static svn_error_t *
+lazy_open_source(svn_stream_t **stream,
+                 void *baton,
+                 apr_pool_t *result_pool,
+                 apr_pool_t *scratch_pool)
+{
+  struct file_baton *fb = baton;
+
+  SVN_ERR(svn_wc__db_pristine_read(stream, NULL, fb->edit_baton->db,
+                                   fb->local_abspath,
+                                   fb->original_checksum,
+                                   result_pool, scratch_pool));
+
+
+  return SVN_NO_ERROR;
+}
+
+struct lazy_target_baton {
+  struct file_baton *fb;
+  struct handler_baton *hb;
+  struct edit_baton *eb;
+};
+
+/* Implements svn_stream_lazyopen_func_t. */
+static svn_error_t *
+lazy_open_target(svn_stream_t **stream,
+                 void *baton,
+                 apr_pool_t *result_pool,
+                 apr_pool_t *scratch_pool)
+{
+  struct lazy_target_baton *tb = baton;
+
+  SVN_ERR(svn_wc__open_writable_base(stream, &tb->hb->new_text_base_tmp_abspath,
+                                     NULL, &tb->hb->new_text_base_sha1_checksum,
+                                     tb->fb->edit_baton->db,
+                                     tb->eb->wcroot_abspath,
+                                     result_pool, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* An svn_delta_editor_t function. */
 static svn_error_t *
 apply_textdelta(void *file_baton,
@@ -3537,10 +3579,10 @@ apply_textdelta(void *file_baton,
   apr_pool_t *handler_pool = svn_pool_create(fb->pool);
   struct handler_baton *hb = apr_pcalloc(handler_pool, sizeof(*hb));
   struct edit_baton *eb = fb->edit_baton;
-  svn_error_t *err;
   const svn_checksum_t *recorded_base_checksum;
   svn_checksum_t *expected_base_checksum;
   svn_stream_t *source;
+  struct lazy_target_baton *tb;
   svn_stream_t *target;
 
   if (fb->skip_this)
@@ -3607,10 +3649,8 @@ apply_textdelta(void *file_baton,
       SVN_ERR_ASSERT(!fb->original_checksum
                      || fb->original_checksum->kind == svn_checksum_sha1);
 
-      SVN_ERR(svn_wc__db_pristine_read(&source, NULL, fb->edit_baton->db,
-                                       fb->local_abspath,
-                                       fb->original_checksum,
-                                       handler_pool, handler_pool));
+      source = svn_stream_lazyopen_create(lazy_open_source, fb, FALSE,
+                                          handler_pool);
     }
   else
     {
@@ -3636,16 +3676,11 @@ apply_textdelta(void *file_baton,
       hb->source_checksum_stream = source;
     }
 
-  /* Open the text base for writing (this will get us a temporary file).  */
-  err = svn_wc__open_writable_base(&target, &hb->new_text_base_tmp_abspath,
-                                   NULL, &hb->new_text_base_sha1_checksum,
-                                   fb->edit_baton->db, eb->wcroot_abspath,
-                                   handler_pool, pool);
-  if (err)
-    {
-      svn_pool_destroy(handler_pool);
-      return svn_error_trace(err);
-    }
+  tb = apr_palloc(handler_pool, sizeof(struct lazy_target_baton));
+  tb->hb = hb;
+  tb->fb = fb;
+  tb->eb = eb;
+  target = svn_stream_lazyopen_create(lazy_open_target, tb, TRUE, handler_pool);
 
   /* Prepare to apply the delta.  */
   svn_txdelta_apply(source, target,

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/upgrade.c Tue May  7 13:26:25
2013
@@ -1590,6 +1590,7 @@ bump_to_31(void *baton,
   apr_array_header_t *empty_iprops = apr_array_make(
     scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
   svn_boolean_t iprops_column_exists = FALSE;
+  svn_error_t *err;
 
   /* Add the inherited_props column to NODES if it does not yet exist.
    *
@@ -1631,23 +1632,42 @@ bump_to_31(void *baton,
                                     STMT_UPGRADE_31_SELECT_WCROOT_NODES));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
 
-  SVN_ERR(svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
-                                    STMT_UPDATE_IPROP));
+  err = svn_sqlite__get_statement(&stmt_mark_switch_roots, sdb,
+                                  STMT_UPDATE_IPROP);
+  if (err)
+    return svn_error_compose_create(err, svn_sqlite__reset(stmt));
+
   while (have_row)
     {
       const char *switched_relpath = svn_sqlite__column_text(stmt, 1, NULL);
       apr_int64_t wc_id = svn_sqlite__column_int64(stmt, 0);
 
-      SVN_ERR(svn_sqlite__bindf(stmt_mark_switch_roots, "is", wc_id,
-                                switched_relpath));
-      SVN_ERR(svn_sqlite__bind_iprops(stmt_mark_switch_roots, 3,
-                                      empty_iprops, iterpool));
-      SVN_ERR(svn_sqlite__step_done(stmt_mark_switch_roots));
-      SVN_ERR(svn_sqlite__step(&have_row, stmt));
+      err = svn_sqlite__bindf(stmt_mark_switch_roots, "is", wc_id,
+                              switched_relpath);
+      if (!err)
+        err = svn_sqlite__bind_iprops(stmt_mark_switch_roots, 3,
+                                      empty_iprops, iterpool);
+      if (!err)
+        err = svn_sqlite__step_done(stmt_mark_switch_roots);
+      if (!err)
+        err = svn_sqlite__step(&have_row, stmt);
+
+      if (err)
+        return svn_error_compose_create(
+                err,
+                svn_error_compose_create(
+                  /* Reset in either order is OK. */
+                  svn_sqlite__reset(stmt),
+                  svn_sqlite__reset(stmt_mark_switch_roots)));
     }
 
+  err = svn_sqlite__reset(stmt_mark_switch_roots);
+  if (err)
+    return svn_error_compose_create(err, svn_sqlite__reset(stmt));
   SVN_ERR(svn_sqlite__reset(stmt));
+
   svn_pool_destroy(iterpool);
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/wc-metadata.sql?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/wc-metadata.sql Tue May  7 13:26:25
2013
@@ -820,6 +820,14 @@ ALTER TABLE NODES ADD COLUMN inherited_p
 DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST;
 DROP INDEX IF EXISTS I_EXTERNALS_PARENT;
 
+DROP INDEX I_NODES_PARENT;
+CREATE UNIQUE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath,
+                                             local_relpath, op_depth);
+
+DROP INDEX I_ACTUAL_PARENT;
+CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath,
+                                                    local_relpath);
+
 PRAGMA user_version = 31;
 
 -- STMT_UPGRADE_31_SELECT_WCROOT_NODES
@@ -832,17 +840,13 @@ PRAGMA user_version = 31;
 SELECT l.wc_id, l.local_relpath FROM nodes as l
 LEFT OUTER JOIN nodes as r
 ON l.wc_id = r.wc_id
-   AND l.repos_id = r.repos_id
    AND r.local_relpath = l.parent_relpath
-WHERE (l.local_relpath = '' AND l.repos_path != '')
-   OR (l.op_depth = 0
-       AND l.local_relpath != ''
-       AND l.repos_path != ltrim(r.repos_path
-                                 || '/'
-                                 || ltrim(substr(l.local_relpath,
-                                                 length(l.parent_relpath) + 1),
-                                          '/'),
-                                 '/'))
+   AND r.op_depth = 0
+WHERE l.op_depth = 0
+  AND l.repos_path != ''
+  AND ((l.repos_id IS NOT r.repos_id)
+       OR (l.repos_path IS NOT RELPATH_SKIP_JOIN(r.local_relpath, r.repos_path, l.local_relpath)))
+
 
 /* ------------------------------------------------------------------------- */
 /* Format 32 ....  */
@@ -858,8 +862,8 @@ CREATE UNIQUE INDEX I_NODES_PARENT ON NO
                                              local_relpath, op_depth);
 
 DROP INDEX I_ACTUAL_PARENT;
-CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL (wc_id, parent_relpath,
-                                               local_relpath);
+CREATE UNIQUE INDEX I_ACTUAL_PARENT ON ACTUAL_NODE (wc_id, parent_relpath,
+                                                    local_relpath);
 
 /* ------------------------------------------------------------------------- */
 

Modified: subversion/branches/wc-collate-path/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_wc/workqueue.h?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_wc/workqueue.h Tue May  7 13:26:25
2013
@@ -73,7 +73,11 @@ extern "C" {
    These will be combined as appropriate, and returned in one of the
    above three styles.
 
-   The resulting list will be ordered: WORK_ITEM1 first, then WORK_ITEM2  */
+   The resulting list will be ordered: WORK_ITEM1 first, then WORK_ITEM2.
+
+   The result contains a shallow copy of the inputs.  Allocate any
+   additional storage needed in RESULT_POOL.
+ */
 svn_skel_t *
 svn_wc__wq_merge(svn_skel_t *work_item1,
                  svn_skel_t *work_item2,

Modified: subversion/branches/wc-collate-path/subversion/po/de.po
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/po/de.po?rev=1479901&r1=1479900&r2=1479901&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/po/de.po [UTF-8] (original)
+++ subversion/branches/wc-collate-path/subversion/po/de.po [UTF-8] Tue May  7 13:26:25 2013
@@ -14369,7 +14369,7 @@ msgid ""
 msgstr ""
 "Aktiviert oder deaktiviert die Zwischenspeicherung von\n"
 "                             Deltas zwischen älteren Revisionen.\n"
-"                             Vorgabe ist »yes«.\n"
+"                             Vorgabe ist »no«.\n"
 "                             [nur für FSFS-Projektarchive verwendet]"
 
 #: ../svnserve/svnserve.c:227



Mime
View raw message