You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/02/11 21:47:11 UTC

svn commit: r1444956 - in /subversion/branches/fsfs-format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c libsvn_repos/repos.c libsvn_wc/adm_files.c

Author: stefan2
Date: Mon Feb 11 20:47:10 2013
New Revision: 1444956

URL: http://svn.apache.org/r1444956
Log:
On the fsfs-format7 branch:  update callers of the deprecated
svn_io_file_create to svn_io_file_create2.  Use the default (0)
length value everywhere, except for those few places where the
actual length is obvious and unlikely to change

* subversion/libsvn_client/patch.c
  (install_patched_prop_targets): call with defaults

* subversion/libsvn_fs_fs/fs.c
  (fs_open_for_recovery): ditto

* subversion/libsvn_fs_fs/fs_fs.c
  (write_config,
   create_file_ignore_eexist,
   write_revision_zero): same here
  (upgrade_body): call with specific length
  (svn_fs_fs__create): do both

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_create_empty_dest): same here

* subversion/libsvn_fs_fs/transaction.c
  (get_lock_on_filesystem): call with defaults
  (svn_fs_fs__create_txn): call with specific length

* subversion/libsvn_repos/repos.c
  (create_db_logs_lock,
   create_db_lock,
   create_conf): call with defaults

* subversion/libsvn_wc/adm_files.c
  (init_adm): call with defaults

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/hotcopy.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/fsfs-format7/subversion/libsvn_repos/repos.c
    subversion/branches/fsfs-format7/subversion/libsvn_wc/adm_files.c

Modified: subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c?rev=1444956&r1=1444955&r2=1444956&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_client/patch.c Mon Feb 11 20:47:10 2013
@@ -2672,8 +2672,8 @@ install_patched_prop_targets(patch_targe
         {
           if (! dry_run)
             {
-              SVN_ERR(svn_io_file_create(target->local_abspath, "",
-                                         scratch_pool));
+              SVN_ERR(svn_io_file_create2(target->local_abspath, "", 0,
+                                          scratch_pool));
               SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, target->local_abspath,
                                             NULL /*props*/,
                                             /* suppress notification */

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c?rev=1444956&r1=1444955&r2=1444956&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c Mon Feb 11 20:47:10 2013
@@ -265,8 +265,8 @@ fs_open_for_recovery(svn_fs_t *fs,
   /* Use a partly-filled fs pointer first to create 'current'.  This will fail
      if 'current' already exists, but we don't care about that. */
   fs->path = apr_pstrdup(fs->pool, path);
-  svn_error_clear(svn_io_file_create(svn_fs_fs__path_current(fs, pool),
-                                     "0 1 1\n", pool));
+  svn_error_clear(svn_io_file_create2(svn_fs_fs__path_current(fs, pool),
+                                      "0 1 1\n", 0, pool));
 
   /* Now open the filesystem properly by calling the vtable method directly. */
   return fs_open(fs, path, pool, common_pool);

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c?rev=1444956&r1=1444955&r2=1444956&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs_fs.c Mon Feb 11 20:47:10 2013
@@ -528,8 +528,8 @@ write_config(svn_fs_t *fs,
 "# " CONFIG_OPTION_P2L_PAGE_SIZE " = 64"                                     NL
 ;
 #undef NL
-  return svn_io_file_create(svn_dirent_join(fs->path, PATH_CONFIG, pool),
-                            fsfs_conf_contents, pool);
+  return svn_io_file_create2(svn_dirent_join(fs->path, PATH_CONFIG, pool),
+                             fsfs_conf_contents, 0, pool);
 }
 
 svn_error_t *
@@ -578,7 +578,7 @@ create_file_ignore_eexist(const char *fi
                           const char *contents,
                           apr_pool_t *pool)
 {
-  svn_error_t *err = svn_io_file_create(file, contents, pool);
+  svn_error_t *err = svn_io_file_create2(file, contents, 0, pool);
   if (err && APR_STATUS_IS_EEXIST(err->apr_err))
     {
       svn_error_clear(err);
@@ -644,7 +644,8 @@ upgrade_body(void *baton, apr_pool_t *po
 
   /* If our filesystem is new enough, write the min unpacked rev file. */
   if (format < SVN_FS_FS__MIN_PACKED_FORMAT)
-    SVN_ERR(svn_io_file_create(path_min_unpacked_rev(fs, pool), "0\n", pool));
+    SVN_ERR(svn_io_file_create2(path_min_unpacked_rev(fs, pool), "0\n", 2,
+                                pool));
 
   /* If the file system supports revision packing but not revprop packing,
      pack the revprops up to the point that revision data has been packed. */
@@ -902,25 +903,25 @@ write_revision_zero(svn_fs_t *fs)
 
   /* Write out a rev file for revision 0. */
   if (ffd->format < SVN_FS_FS__MIN_LOG_ADDRESSING_FORMAT)
-    SVN_ERR(svn_io_file_create(path_revision_zero,
-                               "PLAIN\nEND\nENDREP\n"
-                               "id: 0.0.r0/17\n"
-                               "type: dir\n"
-                               "count: 0\n"
-                               "text: 0 0 4 4 "
-                               "2d2977d1c96f487abe4a1e202dd03b4e\n"
-                               "cpath: /\n"
-                               "\n\n17 107\n", fs->pool));
+    SVN_ERR(svn_io_file_create2(path_revision_zero,
+                                "PLAIN\nEND\nENDREP\n"
+                                "id: 0.0.r0/17\n"
+                                "type: dir\n"
+                                "count: 0\n"
+                                "text: 0 0 4 4 "
+                                "2d2977d1c96f487abe4a1e202dd03b4e\n"
+                                "cpath: /\n"
+                                "\n\n17 107\n", 0, fs->pool));
   else
-    SVN_ERR(svn_io_file_create(path_revision_zero,
-                               "PLAIN\nEND\nENDREP\n"
-                               "id: 0.0.r0/2\n"
-                               "type: dir\n"
-                               "count: 0\n"
-                               "text: 0 3 4 4 "
-                               "2d2977d1c96f487abe4a1e202dd03b4e\n"
-                               "cpath: /\n"
-                               "\n\n", fs->pool));
+    SVN_ERR(svn_io_file_create2(path_revision_zero,
+                                "PLAIN\nEND\nENDREP\n"
+                                "id: 0.0.r0/2\n"
+                                "type: dir\n"
+                                "count: 0\n"
+                                "text: 0 3 4 4 "
+                                "2d2977d1c96f487abe4a1e202dd03b4e\n"
+                                "cpath: /\n"
+                                "\n\n", 0, fs->pool));
 
   SVN_ERR(svn_io_set_file_read_only(path_revision_zero, FALSE, fs->pool));
 
@@ -1023,11 +1024,11 @@ svn_fs_fs__create(svn_fs_t *fs,
                                         pool));
 
   /* Create the 'current' file. */
-  SVN_ERR(svn_io_file_create(svn_fs_fs__path_current(fs, pool),
-                             (format >= SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT
-                              ? "0\n" : "0 1 1\n"),
-                             pool));
-  SVN_ERR(svn_io_file_create(path_lock(fs, pool), "", pool));
+  SVN_ERR(svn_io_file_create2(svn_fs_fs__path_current(fs, pool),
+                              (format >= SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT
+                               ? "0\n" : "0 1 1\n"), 0,
+                              pool));
+  SVN_ERR(svn_io_file_create2(path_lock(fs, pool), "", 0, pool));
   SVN_ERR(svn_fs_fs__set_uuid(fs, NULL, pool));
 
   SVN_ERR(write_revision_zero(fs));
@@ -1038,16 +1039,17 @@ svn_fs_fs__create(svn_fs_t *fs,
 
   /* Create the min unpacked rev file. */
   if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-    SVN_ERR(svn_io_file_create(path_min_unpacked_rev(fs, pool), "0\n", pool));
+    SVN_ERR(svn_io_file_create2(path_min_unpacked_rev(fs, pool), "0\n",
+                                2, pool));
 
   /* Create the txn-current file if the repository supports
      the transaction sequence file. */
   if (format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
     {
-      SVN_ERR(svn_io_file_create(path_txn_current(fs, pool),
-                                 "0\n", pool));
-      SVN_ERR(svn_io_file_create(path_txn_current_lock(fs, pool),
-                                 "", pool));
+      SVN_ERR(svn_io_file_create2(path_txn_current(fs, pool),
+                                  "0\n", 2, pool));
+      SVN_ERR(svn_io_file_create2(path_txn_current_lock(fs, pool),
+                                  "", 0, pool));
     }
 
   /* This filesystem is ready.  Stamp it with a format number. */

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/hotcopy.c?rev=1444956&r1=1444955&r2=1444956&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/hotcopy.c Mon Feb 11 20:47:10 2013
@@ -903,28 +903,28 @@ hotcopy_create_empty_dest(svn_fs_t *src_
                                         pool));
 
   /* Create the 'current' file. */
-  SVN_ERR(svn_io_file_create(svn_fs_fs__path_current(dst_fs, pool),
-                             (dst_ffd->format >=
-                                SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT
-                                ? "0\n" : "0 1 1\n"),
-                             pool));
+  SVN_ERR(svn_io_file_create2(svn_fs_fs__path_current(dst_fs, pool),
+                              (dst_ffd->format >=
+                                 SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT
+                                 ? "0\n" : "0 1 1\n"), 0, 
+                              pool));
 
   /* Create lock file and UUID. */
-  SVN_ERR(svn_io_file_create(path_lock(dst_fs, pool), "", pool));
+  SVN_ERR(svn_io_file_create2(path_lock(dst_fs, pool), "", 0, pool));
   SVN_ERR(svn_fs_fs__set_uuid(dst_fs, src_fs->uuid, pool));
 
   /* Create the min unpacked rev file. */
   if (dst_ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-    SVN_ERR(svn_io_file_create(path_min_unpacked_rev(dst_fs, pool),
-                                                     "0\n", pool));
+    SVN_ERR(svn_io_file_create2(path_min_unpacked_rev(dst_fs, pool),
+                                                      "0\n", 2, pool));
   /* Create the txn-current file if the repository supports
      the transaction sequence file. */
   if (dst_ffd->format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
     {
-      SVN_ERR(svn_io_file_create(path_txn_current(dst_fs, pool),
-                                 "0\n", pool));
-      SVN_ERR(svn_io_file_create(path_txn_current_lock(dst_fs, pool),
-                                 "", pool));
+      SVN_ERR(svn_io_file_create2(path_txn_current(dst_fs, pool),
+                                  "0\n", 2, pool));
+      SVN_ERR(svn_io_file_create2(path_txn_current_lock(dst_fs, pool),
+                                  "", 0, pool));
     }
 
   dst_ffd->youngest_rev_cache = 0;

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c?rev=1444956&r1=1444955&r2=1444956&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/transaction.c Mon Feb 11 20:47:10 2013
@@ -177,7 +177,7 @@ get_lock_on_filesystem(const char *lock_
       svn_error_clear(err);
       err = NULL;
 
-      SVN_ERR(svn_io_file_create(lock_filename, "", pool));
+      SVN_ERR(svn_io_file_create2(lock_filename, "", 0, pool));
       SVN_ERR(svn_io_file_lock2(lock_filename, TRUE, FALSE, pool));
     }
 
@@ -1134,20 +1134,20 @@ svn_fs_fs__create_txn(svn_fs_txn_t **txn
   SVN_ERR(create_new_txn_noderev_from_rev(fs, txn->id, root_id, pool));
 
   /* Create an empty rev file. */
-  SVN_ERR(svn_io_file_create(path_txn_proto_rev(fs, txn->id, pool), "",
-                             pool));
+  SVN_ERR(svn_io_file_create2(path_txn_proto_rev(fs, txn->id, pool), "",
+                              0, pool));
 
   /* Create an empty rev-lock file. */
-  SVN_ERR(svn_io_file_create(path_txn_proto_rev_lock(fs, txn->id, pool), "",
-                             pool));
+  SVN_ERR(svn_io_file_create2(path_txn_proto_rev_lock(fs, txn->id, pool),
+                              "", 0, pool));
 
   /* Create an empty changes file. */
-  SVN_ERR(svn_io_file_create(path_txn_changes(fs, txn->id, pool), "",
-                             pool));
+  SVN_ERR(svn_io_file_create2(path_txn_changes(fs, txn->id, pool), "",
+                              0, pool));
 
   /* Create the next-ids file. */
-  return svn_io_file_create(path_txn_next_ids(fs, txn->id, pool), "0 0\n",
-                            pool);
+  return svn_io_file_create2(path_txn_next_ids(fs, txn->id, pool), "0 0\n",
+                             5, pool);
 }
 
 /* Store the property list for transaction TXN_ID in PROPLIST.

Modified: subversion/branches/fsfs-format7/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_repos/repos.c?rev=1444956&r1=1444955&r2=1444956&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_repos/repos.c Mon Feb 11 20:47:10 2013
@@ -230,7 +230,7 @@ create_db_logs_lock(svn_repos_t *repos, 
   else
     contents = pre12_compat_unneeded_file_contents;
 
-  SVN_ERR_W(svn_io_file_create(lockfile_path, contents, pool),
+  SVN_ERR_W(svn_io_file_create2(lockfile_path, contents, 0, pool),
             _("Creating db logs lock file"));
 
   return SVN_NO_ERROR;
@@ -248,7 +248,7 @@ create_db_lock(svn_repos_t *repos, apr_p
   else
     contents = pre12_compat_unneeded_file_contents;
 
-  SVN_ERR_W(svn_io_file_create(lockfile_path, contents, pool),
+  SVN_ERR_W(svn_io_file_create2(lockfile_path, contents, 0, pool),
             _("Creating db lock file"));
 
   return SVN_NO_ERROR;
@@ -369,7 +369,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               _("Creating start-commit hook"));
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -461,7 +461,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               _("Creating pre-commit hook"));
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -539,7 +539,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               _("Creating pre-revprop-change hook"));
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -631,7 +631,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               "Creating pre-lock hook");
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -715,7 +715,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               "Creating pre-unlock hook");
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -779,7 +779,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               _("Creating post-commit hook"));
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -842,7 +842,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               "Creating post-lock hook");
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -903,7 +903,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               "Creating post-unlock hook");
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -971,7 +971,7 @@ PREWRITTEN_HOOKS_TEXT
 
 #undef SCRIPT_NAME
 
-    SVN_ERR_W(svn_io_file_create(this_path, contents, pool),
+    SVN_ERR_W(svn_io_file_create2(this_path, contents, 0, pool),
               _("Creating post-revprop-change hook"));
 
     SVN_ERR(svn_io_set_file_executable(this_path, TRUE, FALSE, pool));
@@ -1066,8 +1066,8 @@ create_conf(svn_repos_t *repos, apr_pool
 "# min-encryption = 0"                                                       NL
 "# max-encryption = 256"                                                     NL;
 
-    SVN_ERR_W(svn_io_file_create(svn_repos_svnserve_conf(repos, pool),
-                                 svnserve_conf_contents, pool),
+    SVN_ERR_W(svn_io_file_create2(svn_repos_svnserve_conf(repos, pool),
+                                  svnserve_conf_contents, 0, pool),
               _("Creating svnserve.conf file"));
   }
 
@@ -1082,10 +1082,10 @@ create_conf(svn_repos_t *repos, apr_pool
 "# harry = harryssecret"                                                     NL
 "# sally = sallyssecret"                                                     NL;
 
-    SVN_ERR_W(svn_io_file_create(svn_dirent_join(repos->conf_path,
-                                                 SVN_REPOS__CONF_PASSWD,
-                                                 pool),
-                                 passwd_contents, pool),
+    SVN_ERR_W(svn_io_file_create2(svn_dirent_join(repos->conf_path,
+                                                  SVN_REPOS__CONF_PASSWD,
+                                                  pool),
+                                  passwd_contents, 0, pool),
               _("Creating passwd file"));
   }
 
@@ -1124,10 +1124,10 @@ create_conf(svn_repos_t *repos, apr_pool
 "# @harry_and_sally = rw"                                                    NL
 "# * = r"                                                                    NL;
 
-    SVN_ERR_W(svn_io_file_create(svn_dirent_join(repos->conf_path,
-                                                 SVN_REPOS__CONF_AUTHZ,
-                                                 pool),
-                                 authz_contents, pool),
+    SVN_ERR_W(svn_io_file_create2(svn_dirent_join(repos->conf_path,
+                                                  SVN_REPOS__CONF_AUTHZ,
+                                                  pool),
+                                  authz_contents, 0, pool),
               _("Creating authz file"));
   }
 
@@ -1153,10 +1153,10 @@ create_conf(svn_repos_t *repos, apr_pool
 "# [pre-commit]"                                                             NL
 "# PATH = /usr/local/bin:/usr/bin:/usr/sbin"                                 NL;
 
-    SVN_ERR_W(svn_io_file_create(svn_dirent_join(repos->conf_path,
-                                                 SVN_REPOS__CONF_HOOKS_ENV,
-                                                 pool),
-                                 hooks_env_contents, pool),
+    SVN_ERR_W(svn_io_file_create2(svn_dirent_join(repos->conf_path,
+                                                  SVN_REPOS__CONF_HOOKS_ENV,
+                                                  pool),
+                                  hooks_env_contents, 0, pool),
               _("Creating hooks-env file"));
   }
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_wc/adm_files.c?rev=1444956&r1=1444955&r2=1444956&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_wc/adm_files.c Mon Feb 11 20:47:10 2013
@@ -378,16 +378,16 @@ init_adm(svn_wc__db_t *db,
                           pool));
 
   /* Stamp ENTRIES and FORMAT files for old clients.  */
-  SVN_ERR(svn_io_file_create(svn_wc__adm_child(local_abspath,
-                                               SVN_WC__ADM_ENTRIES,
-                                               pool),
-                             SVN_WC__NON_ENTRIES_STRING,
-                             pool));
-  SVN_ERR(svn_io_file_create(svn_wc__adm_child(local_abspath,
-                                               SVN_WC__ADM_FORMAT,
-                                               pool),
-                             SVN_WC__NON_ENTRIES_STRING,
-                             pool));
+  SVN_ERR(svn_io_file_create2(svn_wc__adm_child(local_abspath,
+                                                SVN_WC__ADM_ENTRIES,
+                                                pool),
+                              SVN_WC__NON_ENTRIES_STRING, 0,
+                              pool));
+  SVN_ERR(svn_io_file_create2(svn_wc__adm_child(local_abspath,
+                                                SVN_WC__ADM_FORMAT,
+                                                pool),
+                              SVN_WC__NON_ENTRIES_STRING, 0,
+                              pool));
 
   return SVN_NO_ERROR;
 }



Re: svn commit: r1444956 - in /subversion/branches/fsfs-format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c libsvn_repos/repos.c libsvn_wc/adm_files.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Tue, Feb 12, 2013 at 8:33 AM, Ivan Zhakov <iv...@visualsvn.com> wrote:

> On Tue, Feb 12, 2013 at 11:21 AM, Stefan Fuhrmann
> <st...@wandisco.com> wrote:
> > On Mon, Feb 11, 2013 at 10:03 PM, Bert Huijben <be...@qqmail.nl> wrote:
> >>
> >>
> >>
> >> > -----Original Message-----
> >> > From: stefan2@apache.org [mailto:stefan2@apache.org]
> >> > Sent: maandag 11 februari 2013 21:47
> >> > To: commits@subversion.apache.org
> >> > Subject: svn commit: r1444956 - in /subversion/branches/fsfs-
> >> > format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c
> >> > libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c
> >> > libsvn_repos/repos.c libsvn_wc/adm_files.c
> >> >
> >> > Author: stefan2
> >> > Date: Mon Feb 11 20:47:10 2013
> >> > New Revision: 1444956
> >> >
> >> > URL: http://svn.apache.org/r1444956
> >> > Log:
> >> > On the fsfs-format7 branch:  update callers of the deprecated
> >> > svn_io_file_create to svn_io_file_create2.  Use the default (0)
> >> > length value everywhere, except for those few places where the
> >> > actual length is obvious and unlikely to change
> >>
> >> Why did you deprecate this function instead of adding a separate
> optimized
> >> variant for your use case.
> >
> >
> > I didn't want to introduce e.g. svn_io_file_create_binary
> > alongside svn_io_file_create. svn_io_file_create2 lifting
> > svn_io_file_create's limitation of accepting C strings only
> > seemed like a logical extension of the original functionality
> > and not something completely different.
> >
> >> I don't think providing an explicit size makes sense for the average
> >> caller?
> >
> > svn_io_file_create is often used to create empty files.
> > So, we should then also have svn_io_file_create_empty()
> > to save the unnecessary empty string parameter.
> >
> > I opted for keeping the number of functions in our API low.
> > But I don't have strong feelings about that.
> >
> I completely agree with Bert: optimization should not make developing
> harder. svn_io_file_create_empty() is fine for me. We already have
> such functions for string_t and stringbuf_t.
>

Ok. Implemented in r1445080.

-- Stefan^2.

-- 
Certified & Supported Apache Subversion Downloads:
*

http://www.wandisco.com/subversion/download
*

Re: svn commit: r1444956 - in /subversion/branches/fsfs-format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c libsvn_repos/repos.c libsvn_wc/adm_files.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Tue, Feb 12, 2013 at 11:21 AM, Stefan Fuhrmann
<st...@wandisco.com> wrote:
> On Mon, Feb 11, 2013 at 10:03 PM, Bert Huijben <be...@qqmail.nl> wrote:
>>
>>
>>
>> > -----Original Message-----
>> > From: stefan2@apache.org [mailto:stefan2@apache.org]
>> > Sent: maandag 11 februari 2013 21:47
>> > To: commits@subversion.apache.org
>> > Subject: svn commit: r1444956 - in /subversion/branches/fsfs-
>> > format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c
>> > libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c
>> > libsvn_repos/repos.c libsvn_wc/adm_files.c
>> >
>> > Author: stefan2
>> > Date: Mon Feb 11 20:47:10 2013
>> > New Revision: 1444956
>> >
>> > URL: http://svn.apache.org/r1444956
>> > Log:
>> > On the fsfs-format7 branch:  update callers of the deprecated
>> > svn_io_file_create to svn_io_file_create2.  Use the default (0)
>> > length value everywhere, except for those few places where the
>> > actual length is obvious and unlikely to change
>>
>> Why did you deprecate this function instead of adding a separate optimized
>> variant for your use case.
>
>
> I didn't want to introduce e.g. svn_io_file_create_binary
> alongside svn_io_file_create. svn_io_file_create2 lifting
> svn_io_file_create's limitation of accepting C strings only
> seemed like a logical extension of the original functionality
> and not something completely different.
>
>> I don't think providing an explicit size makes sense for the average
>> caller?
>
> svn_io_file_create is often used to create empty files.
> So, we should then also have svn_io_file_create_empty()
> to save the unnecessary empty string parameter.
>
> I opted for keeping the number of functions in our API low.
> But I don't have strong feelings about that.
>
I completely agree with Bert: optimization should not make developing
harder. svn_io_file_create_empty() is fine for me. We already have
such functions for string_t and stringbuf_t.


-- 
Ivan Zhakov

Re: svn commit: r1444956 - in /subversion/branches/fsfs-format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c libsvn_repos/repos.c libsvn_wc/adm_files.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Mon, Feb 11, 2013 at 10:03 PM, Bert Huijben <be...@qqmail.nl> wrote:

>
>
> > -----Original Message-----
> > From: stefan2@apache.org [mailto:stefan2@apache.org]
> > Sent: maandag 11 februari 2013 21:47
> > To: commits@subversion.apache.org
> > Subject: svn commit: r1444956 - in /subversion/branches/fsfs-
> > format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c
> > libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c
> > libsvn_repos/repos.c libsvn_wc/adm_files.c
> >
> > Author: stefan2
> > Date: Mon Feb 11 20:47:10 2013
> > New Revision: 1444956
> >
> > URL: http://svn.apache.org/r1444956
> > Log:
> > On the fsfs-format7 branch:  update callers of the deprecated
> > svn_io_file_create to svn_io_file_create2.  Use the default (0)
> > length value everywhere, except for those few places where the
> > actual length is obvious and unlikely to change
>
> Why did you deprecate this function instead of adding a separate optimized
> variant for your use case.
>

I didn't want to introduce e.g. svn_io_file_create_binary
alongside svn_io_file_create. svn_io_file_create2 lifting
svn_io_file_create's limitation of accepting C strings only
seemed like a logical extension of the original functionality
and not something completely different.

I don't think providing an explicit size makes sense for the average caller?
>

svn_io_file_create is often used to create empty files.
So, we should then also have svn_io_file_create_empty()
to save the unnecessary empty string parameter.

I opted for keeping the number of functions in our API low.
But I don't have strong feelings about that.

-- Stefan^2.

-- 
Certified & Supported Apache Subversion Downloads:
*

http://www.wandisco.com/subversion/download
*

RE: svn commit: r1444956 - in /subversion/branches/fsfs-format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c libsvn_repos/repos.c libsvn_wc/adm_files.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stefan2@apache.org [mailto:stefan2@apache.org]
> Sent: maandag 11 februari 2013 21:47
> To: commits@subversion.apache.org
> Subject: svn commit: r1444956 - in /subversion/branches/fsfs-
> format7/subversion: libsvn_client/patch.c libsvn_fs_fs/fs.c
> libsvn_fs_fs/fs_fs.c libsvn_fs_fs/hotcopy.c libsvn_fs_fs/transaction.c
> libsvn_repos/repos.c libsvn_wc/adm_files.c
> 
> Author: stefan2
> Date: Mon Feb 11 20:47:10 2013
> New Revision: 1444956
> 
> URL: http://svn.apache.org/r1444956
> Log:
> On the fsfs-format7 branch:  update callers of the deprecated
> svn_io_file_create to svn_io_file_create2.  Use the default (0)
> length value everywhere, except for those few places where the
> actual length is obvious and unlikely to change

Why did you deprecate this function instead of adding a separate optimized variant for your use case.

I don't think providing an explicit size makes sense for the average caller?

	Bert

<snip>

> Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c
> URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-
> format7/subversion/libsvn_fs_fs/fs.c?rev=1444956&r1=1444955&r2=1444956
> &view=diff
> ==========================================================
> ====================
> --- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c (original)
> +++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/fs.c Mon
> Feb 11 20:47:10 2013
> @@ -265,8 +265,8 @@ fs_open_for_recovery(svn_fs_t *fs,
>    /* Use a partly-filled fs pointer first to create 'current'.  This will fail
>       if 'current' already exists, but we don't care about that. */
>    fs->path = apr_pstrdup(fs->pool, path);
> -  svn_error_clear(svn_io_file_create(svn_fs_fs__path_current(fs, pool),
> -                                     "0 1 1\n", pool));
> +  svn_error_clear(svn_io_file_create2(svn_fs_fs__path_current(fs, pool),
> +                                      "0 1 1\n", 0, pool));
> 

Not new in this patch, but can you please try to avoid clearing *any* error when possible. Please check for the sensible errors to clear and return the rest. (There are standard macros to check for file exists, etc.)

That makes it much easier to resolve problems in the future and with the simple svn_error_compose_create() there is no good reason to drop errors.

	Bert