You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2012/03/30 16:12:54 UTC

svn commit: r1307434 [4/6] - in /subversion/branches/revprop-packing: ./ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_fs/ subversion/libsvn_ra_serf/ subversion/libsvn_ra_svn/ subversion/libsvn_repos/ su...

Modified: subversion/branches/revprop-packing/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_ra_svn/client.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_ra_svn/client.c Fri Mar 30 14:12:52 2012
@@ -1152,7 +1152,18 @@ static svn_error_t *ra_svn_get_dir(svn_r
       dirent->size = size;/* FIXME: svn_filesize_t */
       dirent->has_props = has_props;
       dirent->created_rev = crev;
-      SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
+      /* NOTE: the tuple's format string says CDATE may be NULL. But this
+         function does not allow that. The server has always sent us some
+         random date, however, so this just happens to work. But let's
+         be wary of servers that are (improperly) fixed to send NULL.
+
+         Note: they should NOT be "fixed" to send NULL, as that would break
+         any older clients which received that NULL. But we may as well
+         be defensive against a malicous server.  */
+      if (cdate == NULL)
+        dirent->time = 0;
+      else
+        SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
       dirent->last_author = cauthor;
       apr_hash_set(*dirents, name, APR_HASH_KEY_STRING, dirent);
     }

Modified: subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_repos/dump.c Fri Mar 30 14:12:52 2012
@@ -1406,7 +1406,7 @@ svn_repos_verify_fs2(svn_repos_t *repos,
 
   for (rev = start_rev; rev <= end_rev; rev++)
     {
-      svn_delta_editor_t *dump_editor;
+      const svn_delta_editor_t *dump_editor;
       void *dump_edit_baton;
       const svn_delta_editor_t *cancel_editor;
       void *cancel_edit_baton;
@@ -1416,8 +1416,8 @@ svn_repos_verify_fs2(svn_repos_t *repos,
       svn_pool_clear(iterpool);
 
       /* Get cancellable dump editor, but with our close_directory handler. */
-      SVN_ERR(get_dump_editor((const svn_delta_editor_t **)&dump_editor,
-                              &dump_edit_baton, fs, rev, "",
+      SVN_ERR(get_dump_editor(&dump_editor, &dump_edit_baton,
+                              fs, rev, "",
                               svn_stream_empty(iterpool),
                               NULL, NULL,
                               verify_close_directory,

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/cache-inprocess.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/cache-inprocess.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/cache-inprocess.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/cache-inprocess.c Fri Mar 30 14:12:52 2012
@@ -304,7 +304,7 @@ inprocess_cache_set_internal(inprocess_c
       cache->data_size -= existing_entry->size;
       if (value)
         {
-          SVN_ERR(cache->serialize_func((char **)&existing_entry->value,
+          SVN_ERR(cache->serialize_func(&existing_entry->value,
                                         &existing_entry->size,
                                         value,
                                         page->page_pool));
@@ -356,7 +356,7 @@ inprocess_cache_set_internal(inprocess_c
     new_entry->key = duplicate_key(cache, key, page->page_pool);
     if (value)
       {
-        SVN_ERR(cache->serialize_func((char **)&new_entry->value,
+        SVN_ERR(cache->serialize_func(&new_entry->value,
                                       &new_entry->size,
                                       value,
                                       page->page_pool));
@@ -512,10 +512,10 @@ inprocess_cache_set_partial_internal(inp
       SVN_ERR(move_page_to_front(cache, entry->page));
 
       cache->data_size -= entry->size;
-      SVN_ERR(func((char **)&entry->value,
-                  &entry->size,
-                  baton,
-                  entry->page->page_pool));
+      SVN_ERR(func(&entry->value,
+                   &entry->size,
+                   baton,
+                   entry->page->page_pool));
       cache->data_size += entry->size;
     }
 

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/cache-membuffer.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/cache-membuffer.c Fri Mar 30 14:12:52 2012
@@ -1162,7 +1162,7 @@ membuffer_cache_set(svn_membuffer_t *cac
 {
   apr_uint32_t group_index;
   unsigned char to_find[KEY_SIZE];
-  char *buffer = NULL;
+  void *buffer = NULL;
   apr_size_t size;
 
   /* find the entry group that will hold the key.
@@ -1457,7 +1457,7 @@ membuffer_cache_set_partial_internal(svn
 
       /* modify it, preferrably in-situ.
        */
-      err = func(&data, &size, baton, scratch_pool);
+      err = func((void **)&data, &size, baton, scratch_pool);
 
       if (err)
         {
@@ -2014,7 +2014,7 @@ static svn_cache__vtable_t membuffer_cac
  * Implements svn_cache__serialize_func_t.
  */
 static svn_error_t *
-serialize_svn_stringbuf(char **buffer,
+serialize_svn_stringbuf(void **buffer,
                         apr_size_t *buffer_size,
                         void *item,
                         apr_pool_t *result_pool)
@@ -2032,7 +2032,7 @@ serialize_svn_stringbuf(char **buffer,
  */
 static svn_error_t *
 deserialize_svn_stringbuf(void **item,
-                          char *buffer,
+                          void *buffer,
                           apr_size_t buffer_size,
                           apr_pool_t *result_pool)
 {

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/cache-memcache.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/cache-memcache.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/cache-memcache.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/cache-memcache.c Fri Mar 30 14:12:52 2012
@@ -247,7 +247,7 @@ memcache_set(void *cache_void,
 {
   memcache_t *cache = cache_void;
   apr_pool_t *subpool = svn_pool_create(scratch_pool);
-  char *data;
+  void *data;
   apr_size_t data_len;
   svn_error_t *err;
 
@@ -307,12 +307,12 @@ memcache_set_partial(void *cache_void,
 {
   svn_error_t *err = SVN_NO_ERROR;
 
-  char *data;
+  void *data;
   apr_size_t size;
   svn_boolean_t found = FALSE;
 
   apr_pool_t *subpool = svn_pool_create(scratch_pool);
-  SVN_ERR(memcache_internal_get(&data,
+  SVN_ERR(memcache_internal_get((char **)&data,
                                 &size,
                                 &found,
                                 cache_void,

Modified: subversion/branches/revprop-packing/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_subr/spillbuf.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_subr/spillbuf.c Fri Mar 30 14:12:52 2012
@@ -184,8 +184,14 @@ svn_spillbuf__write(svn_spillbuf_t *buf,
      in memory.  */
   if (buf->spill != NULL)
     {
-      /* NOTE: we assume the file position is at the END. The caller should
-         ensure this, so that we will append.  */
+      apr_off_t output_unused = 0;  /* ### stupid API  */
+
+      /* Seek to the end of the spill file. We don't know if a read has
+         occurred since our last write, and moved the file position.  */
+      SVN_ERR(svn_io_file_seek(buf->spill,
+                               APR_END, &output_unused,
+                               scratch_pool));
+
       SVN_ERR(svn_io_file_write_full(buf->spill, data, len,
                                      NULL, scratch_pool));
       buf->spill_size += len;
@@ -305,8 +311,10 @@ read_data(struct memblock_t **mem,
   /* Did we consume all the data from the spill file?  */
   if ((buf->spill_size -= (*mem)->size) == 0)
     {
+      /* Close and reset our spill file information.  */
       SVN_ERR(svn_io_file_close(buf->spill, scratch_pool));
       buf->spill = NULL;
+      buf->spill_start = 0;
     }
 
   /* *mem has been initialized. Done.  */

Modified: subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c?rev=1307434&r1=1307433&r2=1307434&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_wc/wc_db.c Fri Mar 30 14:12:52 2012
@@ -3414,8 +3414,9 @@ get_info_for_copy(apr_int64_t *copyfrom_
 {
   const char *repos_relpath;
   svn_revnum_t revision;
+  svn_wc__db_status_t node_status;
 
-  SVN_ERR(read_info(status, kind, &revision, &repos_relpath, copyfrom_id,
+  SVN_ERR(read_info(&node_status, kind, &revision, &repos_relpath, copyfrom_id,
                     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                     NULL, NULL, NULL, NULL, NULL, op_root, NULL, NULL,
                     NULL /* have_base */,
@@ -3423,32 +3424,27 @@ get_info_for_copy(apr_int64_t *copyfrom_
                     have_work,
                     wcroot, local_relpath, result_pool, scratch_pool));
 
-  if (*status == svn_wc__db_status_excluded)
+  if (node_status == svn_wc__db_status_excluded)
     {
       /* The parent cannot be excluded, so look at the parent and then
          adjust the relpath */
       const char *parent_relpath, *base_name;
-      svn_wc__db_status_t parent_status;
-      svn_kind_t parent_kind;
-      svn_boolean_t parent_have_work;
 
       svn_dirent_split(&parent_relpath, &base_name, local_relpath,
                        scratch_pool);
       SVN_ERR(get_info_for_copy(copyfrom_id, copyfrom_relpath, copyfrom_rev,
-                                &parent_status,
-                                &parent_kind,
-                                NULL, &parent_have_work,
+                                NULL, NULL, NULL, NULL,
                                 wcroot, parent_relpath,
                                 scratch_pool, scratch_pool));
       if (*copyfrom_relpath)
         *copyfrom_relpath = svn_relpath_join(*copyfrom_relpath, base_name,
                                              result_pool);
     }
-  else if (*status == svn_wc__db_status_added)
+  else if (node_status == svn_wc__db_status_added)
     {
       const char *op_root_relpath;
 
-      SVN_ERR(scan_addition(NULL, &op_root_relpath,
+      SVN_ERR(scan_addition(&node_status, &op_root_relpath,
                             NULL, NULL, /* repos_* */
                             copyfrom_relpath, copyfrom_id, copyfrom_rev,
                             NULL, NULL, NULL, wcroot, local_relpath,
@@ -3462,7 +3458,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
                                result_pool);
         }
     }
-  else if (*status == svn_wc__db_status_deleted)
+  else if (node_status == svn_wc__db_status_deleted)
     {
       const char *base_del_relpath, *work_del_relpath;
 
@@ -3506,6 +3502,9 @@ get_info_for_copy(apr_int64_t *copyfrom_
       *copyfrom_rev = revision;
     }
 
+  if (status)
+    *status = node_status;
+
   return SVN_NO_ERROR;
 }
 
@@ -3662,7 +3661,11 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
                     dst_op_depth,
                     dst_parent_relpath,
                     presence_map, dst_presence));
-      if (is_move)
+
+      /* ### What about other results from scan_addition()?
+       * ### 'cp A B; mv B C' currently results in C being marked moved-here
+       * ### with no corresponding moved-from. */
+      if (is_move && status != svn_wc__db_status_added)
         SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));
 
       SVN_ERR(svn_sqlite__step_done(stmt));