You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/12/11 01:16:08 UTC
svn commit: r1044548 [11/39] - in /subversion/branches/ignore-mergeinfo: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ contrib/client-side/ contrib/hook-scripts/
contrib/server-side/ notes/api-errata/ notes/api-err...
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/checksum.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/checksum.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/checksum.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/checksum.c Sat Dec 11 00:15:55 2010
@@ -135,6 +135,9 @@ const char *
svn_checksum_to_cstring(const svn_checksum_t *checksum,
apr_pool_t *pool)
{
+ if (checksum == NULL)
+ return NULL;
+
switch (checksum->kind)
{
case svn_checksum_md5:
@@ -159,7 +162,7 @@ svn_checksum_serialize(const svn_checksu
return apr_pstrcat(result_pool,
ckind_str,
svn_checksum_to_cstring(checksum, scratch_pool),
- NULL);
+ (char *)NULL);
}
@@ -190,9 +193,28 @@ svn_checksum_parse_hex(svn_checksum_t **
const char *hex,
apr_pool_t *pool)
{
- int len;
- int i;
- unsigned char is_zeros = '\0';
+ int i, len;
+ char is_nonzero = '\0';
+ char *digest;
+ static const char xdigitval[256] =
+ {
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, /* 0-9 */
+ -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A-F */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* a-f */
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+ };
if (hex == NULL)
{
@@ -203,23 +225,21 @@ svn_checksum_parse_hex(svn_checksum_t **
SVN_ERR(validate_kind(kind));
*checksum = svn_checksum_create(kind, pool);
+ digest = (char *)(*checksum)->digest;
len = DIGESTSIZE(kind);
for (i = 0; i < len; i++)
{
- if ((! svn_ctype_isxdigit(hex[i * 2])) ||
- (! svn_ctype_isxdigit(hex[i * 2 + 1])))
+ char x1 = xdigitval[(unsigned char)hex[i * 2]];
+ char x2 = xdigitval[(unsigned char)hex[i * 2 + 1]];
+ if (x1 == (char)-1 || x2 == (char)-1)
return svn_error_create(SVN_ERR_BAD_CHECKSUM_PARSE, NULL, NULL);
- ((unsigned char *)(*checksum)->digest)[i] =
- ((svn_ctype_isalpha(hex[i*2]) ? hex[i*2] - 'a' + 10
- : hex[i*2] - '0') << 4) |
- (svn_ctype_isalpha(hex[i*2+1]) ? hex[i*2+1] - 'a' + 10
- : hex[i*2+1] - '0');
- is_zeros |= (*checksum)->digest[i];
+ digest[i] = (x1 << 4) | x2;
+ is_nonzero |= (x1 << 4) | x2;
}
- if (is_zeros == '\0')
+ if (!is_nonzero)
*checksum = NULL;
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_file.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_file.c Sat Dec 11 00:15:55 2010
@@ -38,6 +38,11 @@
#include "svn_private_config.h"
+#ifdef __HAIKU__
+# include <FindDirectory.h>
+# include <StorageDefs.h>
+#endif
+
/* Used to terminate lines in large multi-line string literals. */
#define NL APR_EOL_STR
@@ -331,7 +336,19 @@ svn_config__sys_config_path(const char *
SVN_CONFIG__SUBDIRECTORY, fname, NULL);
}
-#else /* ! WIN32 */
+#elif defined(__HAIKU__)
+ {
+ char folder[B_PATH_NAME_LENGTH];
+
+ status_t error = find_directory(B_COMMON_SETTINGS_DIRECTORY, -1, false,
+ folder, sizeof(folder));
+ if (error)
+ return SVN_NO_ERROR;
+
+ *path_p = svn_dirent_join_many(pool, folder,
+ SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
+ }
+#else /* ! WIN32 && !__HAIKU__ */
*path_p = svn_dirent_join_many(pool, SVN_CONFIG__SYS_DIRECTORY, fname, NULL);
@@ -1117,7 +1134,20 @@ svn_config_get_user_config_path(const ch
SVN_CONFIG__SUBDIRECTORY, fname, NULL);
}
-#else /* ! WIN32 */
+#elif defined(__HAIKU__)
+ {
+ char folder[B_PATH_NAME_LENGTH];
+
+ status_t error = find_directory(B_USER_SETTINGS_DIRECTORY, -1, false,
+ folder, sizeof(folder));
+ if (error)
+ return SVN_NO_ERROR;
+
+ *path = svn_dirent_join_many(pool, folder,
+ SVN_CONFIG__USR_DIRECTORY, fname, NULL);
+ }
+#else /* ! WIN32 && !__HAIKU__ */
+
{
const char *homedir = svn_user_get_homedir(pool);
if (! homedir)
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_impl.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_impl.h?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_impl.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/config_impl.h Sat Dec 11 00:15:55 2010
@@ -114,7 +114,10 @@ svn_error_t *svn_config__parse_registry(
or svn_config_get_user_config_path() instead. */
#ifdef WIN32
# define SVN_CONFIG__SUBDIRECTORY "Subversion"
-#else /* ! WIN32 */
+#elif defined __HAIKU__ /* HAIKU */
+# define SVN_CONFIG__SYS_DIRECTORY "subversion"
+# define SVN_CONFIG__USR_DIRECTORY "subversion"
+#else /* ! WIN32 && ! __HAIKU__ */
# define SVN_CONFIG__SYS_DIRECTORY "/etc/subversion"
# define SVN_CONFIG__USR_DIRECTORY ".subversion"
#endif /* WIN32 */
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/constructors.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/constructors.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/constructors.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/constructors.c Sat Dec 11 00:15:55 2010
@@ -45,7 +45,8 @@ svn_commit_info_t *
svn_commit_info_dup(const svn_commit_info_t *src_commit_info,
apr_pool_t *pool)
{
- svn_commit_info_t *dst_commit_info = svn_create_commit_info(pool);
+ svn_commit_info_t *dst_commit_info
+ = apr_palloc(pool, sizeof(*dst_commit_info));
dst_commit_info->date = src_commit_info->date
? apr_pstrdup(pool, src_commit_info->date) : NULL;
@@ -66,6 +67,9 @@ svn_log_changed_path2_create(apr_pool_t
svn_log_changed_path2_t *new_changed_path
= apr_pcalloc(pool, sizeof(*new_changed_path));
+ new_changed_path->text_modified = svn_tristate_unknown;
+ new_changed_path->props_modified = svn_tristate_unknown;
+
return new_changed_path;
}
@@ -74,7 +78,7 @@ svn_log_changed_path2_dup(const svn_log_
apr_pool_t *pool)
{
svn_log_changed_path2_t *new_changed_path
- = svn_log_changed_path2_create(pool);
+ = apr_palloc(pool, sizeof(*new_changed_path));
*new_changed_path = *changed_path;
@@ -190,7 +194,7 @@ svn_log_entry_t *
svn_log_entry_dup(const svn_log_entry_t *log_entry, apr_pool_t *pool)
{
apr_hash_index_t *hi;
- svn_log_entry_t *new_entry = svn_log_entry_create(pool);
+ svn_log_entry_t *new_entry = apr_palloc(pool, sizeof(*new_entry));
*new_entry = *log_entry;
@@ -228,7 +232,8 @@ svn_location_segment_dup(const svn_locat
apr_pool_t *pool)
{
svn_location_segment_t *new_segment =
- apr_pcalloc(pool, sizeof(*new_segment));
+ apr_palloc(pool, sizeof(*new_segment));
+
*new_segment = *segment;
if (segment->path)
new_segment->path = apr_pstrdup(pool, segment->path);
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/deprecated.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/deprecated.c Sat Dec 11 00:15:55 2010
@@ -549,17 +549,20 @@ svn_opt_print_help(apr_getopt_t *os,
apr_pool_t *pool)
{
apr_array_header_t *targets = NULL;
- int i;
if (os)
SVN_ERR(svn_opt_parse_all_args(&targets, os, pool));
if (os && targets->nelts) /* help on subcommand(s) requested */
- for (i = 0; i < targets->nelts; i++)
- {
- svn_opt_subcommand_help(APR_ARRAY_IDX(targets, i, const char *),
- cmd_table, option_table, pool);
- }
+ {
+ int i;
+
+ for (i = 0; i < targets->nelts; i++)
+ {
+ svn_opt_subcommand_help(APR_ARRAY_IDX(targets, i, const char *),
+ cmd_table, option_table, pool);
+ }
+ }
else if (print_version) /* just --version */
SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer, quiet,
pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/dirent_uri.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/dirent_uri.c Sat Dec 11 00:15:55 2010
@@ -63,7 +63,13 @@ typedef enum {
type_relpath
} path_type_t;
-
+
+/**** Forward declarations *****/
+
+static svn_boolean_t
+relpath_is_canonical(const char *relpath);
+
+
/**** Internal implementation functions *****/
/* Return an internal-style new path based on PATH, allocated in POOL.
@@ -1189,8 +1195,8 @@ svn_relpath_join(const char *base,
apr_size_t clen = strlen(component);
char *path;
- assert(svn_relpath_is_canonical(base, pool));
- assert(svn_relpath_is_canonical(component, pool));
+ assert(relpath_is_canonical(base));
+ assert(relpath_is_canonical(component));
/* If either is empty return the other */
if (blen == 0)
@@ -1316,7 +1322,7 @@ svn_relpath_dirname(const char *relpath,
{
apr_size_t len = strlen(relpath);
- assert(svn_relpath_is_canonical(relpath, pool));
+ assert(relpath_is_canonical(relpath));
return apr_pstrmemdup(pool, relpath,
relpath_previous_segment(relpath, len));
@@ -1329,7 +1335,7 @@ svn_relpath_basename(const char *relpath
apr_size_t len = strlen(relpath);
apr_size_t start;
- assert(!pool || svn_relpath_is_canonical(relpath, pool));
+ assert(relpath_is_canonical(relpath));
start = len;
while (start > 0 && relpath[start - 1] != '/')
@@ -1422,6 +1428,9 @@ svn_relpath_get_longest_ancestor(const c
const char *relpath2,
apr_pool_t *pool)
{
+ assert(relpath_is_canonical(relpath1));
+ assert(relpath_is_canonical(relpath2));
+
return apr_pstrndup(pool, relpath1,
get_longest_ancestor_length(type_relpath, relpath1,
relpath2, pool));
@@ -1497,6 +1506,9 @@ svn_relpath_is_child(const char *parent_
const char *child_relpath,
apr_pool_t *pool)
{
+ /* assert(relpath_is_canonical(parent_relpath)); */
+ /* assert(relpath_is_canonical(child_relpath)); */
+
return is_child(type_relpath, parent_relpath, child_relpath, pool);
}
@@ -1517,6 +1529,9 @@ svn_dirent_is_ancestor(const char *paren
svn_boolean_t
svn_relpath_is_ancestor(const char *parent_relpath, const char *child_relpath)
{
+ assert(relpath_is_canonical(parent_relpath));
+ assert(relpath_is_canonical(child_relpath));
+
return is_ancestor(type_relpath, parent_relpath, child_relpath);
}
@@ -1563,15 +1578,15 @@ svn_relpath_skip_ancestor(const char *pa
{
apr_size_t len = strlen(parent_relpath);
+ assert(relpath_is_canonical(parent_relpath));
+ assert(relpath_is_canonical(child_relpath));
+
if (0 != memcmp(parent_relpath, child_relpath, len))
return child_relpath; /* parent_relpath is no ancestor of child_relpath */
if (child_relpath[len] == 0)
return ""; /* parent_relpath == child_relpath */
- if (len == 1 && child_relpath[0] == '/')
- return child_relpath + 1;
-
if (child_relpath[len] == '/')
return child_relpath + len + 1;
@@ -1737,12 +1752,11 @@ svn_dirent_is_canonical(const char *dire
}
#endif /* SVN_USE_DOS_PATHS */
- return svn_relpath_is_canonical(ptr, pool);
+ return relpath_is_canonical(ptr);
}
-svn_boolean_t
-svn_relpath_is_canonical(const char *relpath,
- apr_pool_t *pool)
+static svn_boolean_t
+relpath_is_canonical(const char *relpath)
{
const char *ptr = relpath, *seg = relpath;
@@ -1787,6 +1801,13 @@ svn_relpath_is_canonical(const char *rel
}
svn_boolean_t
+svn_relpath_is_canonical(const char *relpath,
+ apr_pool_t *pool)
+{
+ return relpath_is_canonical(relpath);
+}
+
+svn_boolean_t
svn_uri_is_canonical(const char *uri, apr_pool_t *pool)
{
const char *ptr = uri, *seg = uri;
@@ -1936,10 +1957,9 @@ svn_dirent_condense_targets(const char *
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- int i, j, num_condensed = targets->nelts;
+ int i, num_condensed = targets->nelts;
svn_boolean_t *removed;
apr_array_header_t *abs_targets;
- size_t basedir_len;
/* Early exit when there's no data to work on. */
if (targets->nelts <= 0)
@@ -1995,6 +2015,8 @@ svn_dirent_condense_targets(const char *
if (pcondensed_targets != NULL)
{
+ size_t basedir_len;
+
if (remove_redundancies)
{
/* Find the common part of each pair of targets. If
@@ -2006,6 +2028,8 @@ svn_dirent_condense_targets(const char *
another non-removed target, remove the child. */
for (i = 0; i < abs_targets->nelts; ++i)
{
+ int j;
+
if (removed[i])
continue;
@@ -2101,10 +2125,9 @@ svn_uri_condense_targets(const char **pc
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- int i, j, num_condensed = targets->nelts;
+ int i, num_condensed = targets->nelts;
apr_array_header_t *uri_targets;
svn_boolean_t *removed;
- size_t basedir_len;
/* Early exit when there's no data to work on. */
if (targets->nelts <= 0)
@@ -2156,6 +2179,8 @@ svn_uri_condense_targets(const char **pc
if (pcondensed_targets != NULL)
{
+ size_t basedir_len;
+
if (remove_redundancies)
{
/* Find the common part of each pair of targets. If
@@ -2167,6 +2192,8 @@ svn_uri_condense_targets(const char **pc
another non-removed target, remove the child. */
for (i = 0; i < uri_targets->nelts; ++i)
{
+ int j;
+
if (removed[i])
continue;
@@ -2423,7 +2450,7 @@ svn_uri_get_file_url_from_dirent(const c
dirent = svn_path_uri_encode(dirent, pool);
#ifndef SVN_USE_DOS_PATHS
- *url = apr_pstrcat(pool, "file://", dirent, NULL);
+ *url = apr_pstrcat(pool, "file://", dirent, (char *)NULL);
#else
if (dirent[0] == '/')
{
@@ -2438,3 +2465,167 @@ svn_uri_get_file_url_from_dirent(const c
return SVN_NO_ERROR;
}
+
+
+/* ------------------------ The fspath API ------------------------ */
+
+svn_boolean_t
+svn_fspath__is_canonical(const char *fspath)
+{
+ return fspath[0] == '/' && relpath_is_canonical(fspath + 1);
+}
+
+
+const char *
+svn_fspath__is_child(const char *parent_fspath,
+ const char *child_fspath,
+ apr_pool_t *pool)
+{
+ const char *result;
+ assert(svn_fspath__is_canonical(parent_fspath));
+ assert(svn_fspath__is_canonical(child_fspath));
+
+#ifdef FSPATH_USE_URI
+ result = svn_uri_is_child(parent_fspath, child_fspath, pool);
+#else
+ result = svn_relpath_is_child(parent_fspath + 1, child_fspath + 1, pool);
+#endif
+
+ assert(result == NULL || svn_relpath_is_canonical(result, pool));
+ return result;
+}
+
+const char *
+svn_fspath__skip_ancestor(const char *parent_fspath,
+ const char *child_fspath)
+{
+ const char *result;
+ assert(svn_fspath__is_canonical(parent_fspath));
+ assert(svn_fspath__is_canonical(child_fspath));
+
+#ifdef FSPATH_USE_URI
+ result = svn_uri_skip_ancestor(parent_fspath, child_fspath);
+#else
+ if (svn_relpath_is_ancestor(parent_fspath + 1, child_fspath + 1))
+ result = svn_relpath_skip_ancestor(parent_fspath + 1, child_fspath + 1);
+ else
+ result = child_fspath;
+#endif
+
+ assert(svn_relpath_is_canonical(result, NULL)
+ || strcmp(result, child_fspath) == 0);
+ return result;
+}
+
+svn_boolean_t
+svn_fspath__is_ancestor(const char *parent_fspath,
+ const char *child_fspath)
+{
+ assert(svn_fspath__is_canonical(parent_fspath));
+ assert(svn_fspath__is_canonical(child_fspath));
+
+#ifdef FSPATH_USE_URI
+ return svn_uri_is_ancestor(parent_fspath, child_fspath);
+#else
+ return svn_relpath_is_ancestor(parent_fspath + 1, child_fspath + 1);
+#endif
+}
+
+
+const char *
+svn_fspath__dirname(const char *fspath,
+ apr_pool_t *pool)
+{
+ const char *result;
+ assert(svn_fspath__is_canonical(fspath));
+
+#ifdef FSPATH_USE_URI
+ result = svn_uri_dirname(fspath, pool);
+#else
+ result = apr_pstrcat(pool, "/", svn_relpath_dirname(fspath + 1, pool),
+ (char *)NULL);
+#endif
+
+ assert(svn_fspath__is_canonical(result));
+ return result;
+}
+
+
+const char *
+svn_fspath__basename(const char *fspath,
+ apr_pool_t *pool)
+{
+ const char *result;
+ assert(svn_fspath__is_canonical(fspath));
+
+#ifdef FSPATH_USE_URI
+ result = svn_uri_basename(fspath, pool);
+#else
+ result = svn_relpath_basename(fspath + 1, pool);
+#endif
+
+ assert(strchr(result, '/') == NULL);
+ return result;
+}
+
+void
+svn_fspath__split(const char **dirpath,
+ const char **base_name,
+ const char *fspath,
+ apr_pool_t *result_pool)
+{
+ assert(dirpath != base_name);
+
+ if (dirpath)
+ *dirpath = svn_fspath__dirname(fspath, result_pool);
+
+ if (base_name)
+ *base_name = svn_fspath__basename(fspath, result_pool);
+}
+
+char *
+svn_fspath__join(const char *fspath,
+ const char *relpath,
+ apr_pool_t *result_pool)
+{
+ char *result;
+ assert(svn_fspath__is_canonical(fspath));
+ assert(svn_relpath_is_canonical(relpath, result_pool));
+
+#ifdef FSPATH_USE_URI
+ result = svn_uri_join(fspath, relpath, result_pool);
+#else
+ if (relpath[0] == '\0')
+ result = apr_pstrdup(result_pool, fspath);
+ else if (fspath[1] == '\0')
+ result = apr_pstrcat(result_pool, "/", relpath, (char *)NULL);
+ else
+ result = apr_pstrcat(result_pool, fspath, "/", relpath, (char *)NULL);
+#endif
+
+ assert(svn_fspath__is_canonical(result));
+ return result;
+}
+
+char *
+svn_fspath__get_longest_ancestor(const char *fspath1,
+ const char *fspath2,
+ apr_pool_t *result_pool)
+{
+ char *result;
+ assert(svn_fspath__is_canonical(fspath1));
+ assert(svn_fspath__is_canonical(fspath2));
+
+#ifdef FSPATH_USE_URI
+ result = svn_uri_get_longest_ancestor(fspath1, fspath2, result_pool);
+#else
+ result = apr_pstrcat(result_pool, "/",
+ svn_relpath_get_longest_ancestor(fspath1 + 1,
+ fspath2 + 1,
+ result_pool),
+ NULL);
+#endif
+
+ assert(svn_fspath__is_canonical(result));
+ return result;
+}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/eol.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/eol.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/eol.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/eol.c Sat Dec 11 00:15:55 2010
@@ -84,7 +84,7 @@ svn_eol__detect_file_eol(const char **eo
err = svn_io_file_read(file, buf, &nbytes, pool);
if (err)
{
- /* An error occured. We're going to return in any case,
+ /* An error occurred. We're going to return in any case,
* so reset the file cursor right now. */
pos = orig_pos;
SVN_ERR(svn_io_file_seek(file, APR_SET, &pos, pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/error.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/error.c Sat Dec 11 00:15:55 2010
@@ -269,6 +269,18 @@ svn_error_root_cause(svn_error_t *err)
return err;
}
+svn_boolean_t
+svn_error_has_cause(svn_error_t *err, apr_status_t apr_err)
+{
+ svn_error_t *child;
+
+ for (child = err; child; child = child->child)
+ if (child->apr_err == apr_err)
+ return TRUE;
+
+ return FALSE;
+}
+
svn_error_t *
svn_error_dup(svn_error_t *err)
{
@@ -473,11 +485,12 @@ svn_handle_error2(svn_error_t *err,
tmp_err = err;
while (tmp_err)
{
- int i;
svn_boolean_t printed_already = FALSE;
if (! tmp_err->message)
{
+ int i;
+
for (i = 0; i < empties->nelts; i++)
{
if (tmp_err->apr_err == APR_ARRAY_IDX(empties, i, apr_status_t) )
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/io.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/io.c Sat Dec 11 00:15:55 2010
@@ -334,6 +334,10 @@ svn_io_open_uniquely_named(apr_file_t **
unsigned int i;
struct temp_file_cleanup_s *baton = NULL;
+ /* At the beginning, we don't know whether unique_path will need
+ UTF8 conversion */
+ svn_boolean_t needs_utf8_conversion = TRUE;
+
SVN_ERR_ASSERT(file || unique_path);
if (dirpath == NULL)
@@ -394,7 +398,21 @@ svn_io_open_uniquely_named(apr_file_t **
before starting iteration, then convert back to UTF-8 for
return. But I suppose that would make the appending code
sensitive to i18n in a way it shouldn't be... Oh well. */
- SVN_ERR(cstring_from_utf8(&unique_name_apr, unique_name, scratch_pool));
+ if (needs_utf8_conversion)
+ {
+ SVN_ERR(cstring_from_utf8(&unique_name_apr, unique_name,
+ scratch_pool));
+ if (i == 1)
+ {
+ /* The variable parts of unique_name will not require UTF8
+ conversion. Therefore, if UTF8 conversion had no effect
+ on it in the first iteration, it won't require conversion
+ in any future interation. */
+ needs_utf8_conversion = strcmp(unique_name_apr, unique_name);
+ }
+ }
+ else
+ unique_name_apr = unique_name;
apr_err = file_open(&try_file, unique_name_apr, flag,
APR_OS_DEFAULT, FALSE, result_pool);
@@ -800,6 +818,29 @@ file_perms_set(const char *fname, apr_fi
else
return SVN_NO_ERROR;
}
+
+/* Set permissions PERMS on the FILE. This is a cheaper variant of the
+ * file_perms_set wrapper() function because no locale-dependent string
+ * conversion is required.
+ */
+static svn_error_t *
+file_perms_set2(apr_file_t* file, apr_fileperms_t perms)
+{
+ const char *fname_apr;
+ apr_status_t status;
+
+ status = apr_file_name_get(&fname_apr, file);
+ if (status)
+ return svn_error_wrap_apr(status, _("Can't get file name"));
+
+ status = apr_file_perms_set(fname_apr, perms);
+ if (status)
+ return svn_error_wrap_apr(status, _("Can't set permissions on '%s'"),
+ fname_apr);
+ else
+ return SVN_NO_ERROR;
+}
+
#endif /* !WIN32 && !__OS2__ */
svn_error_t *
@@ -1268,30 +1309,46 @@ reown_file(const char *path,
static svn_error_t *
get_default_file_perms(apr_fileperms_t *perms, apr_pool_t *scratch_pool)
{
- apr_finfo_t finfo;
- apr_file_t *fd;
+ /* the default permissions as read from the temp folder */
+ static apr_fileperms_t default_perms = 0;
- /* Get the perms for a newly created file to find out what bits
- should be set.
+ /* Technically, this "racy": Multiple threads may use enter here and
+ try to figure out the default permisission concurrently. That's fine
+ since they will end up with the same results. Even more technical,
+ apr_fileperms_t is an atomic type on 32+ bit machines.
+ */
+ if (default_perms == 0)
+ {
+ apr_finfo_t finfo;
+ apr_file_t *fd;
- NOTE: normally del_on_close can be problematic because APR might
- delete the file if we spawned any child processes. In this case,
- the lifetime of this file handle is about 3 lines of code, so
- we can safely use del_on_close here.
+ /* Get the perms for a newly created file to find out what bits
+ should be set.
- NOTE: not so fast, shorty. if some other thread forks off a child,
- then the APR cleanups run, and the file will disappear. sigh.
+ Normally del_on_close can be problematic because APR might
+ delete the file if we spawned any child processes. In this
+ case, the lifetime of this file handle is about 3 lines of
+ code, so we can safely use del_on_close here.
+
+ Not so fast! If some other thread forks off a child, then the
+ APR cleanups run, and the file will disappear. So use
+ del_on_pool_cleanup instead.
- Using svn_io_open_uniquely_named() here because other tempfile
- creation functions tweak the permission bits of files they create.
- */
- SVN_ERR(svn_io_open_uniquely_named(&fd, NULL, NULL, "svn-tempfile", ".tmp",
- svn_io_file_del_on_pool_cleanup,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_io_file_info_get(&finfo, APR_FINFO_PROT, fd, scratch_pool));
- SVN_ERR(svn_io_file_close(fd, scratch_pool));
+ Using svn_io_open_uniquely_named() here because other tempfile
+ creation functions tweak the permission bits of files they create.
+ */
+ SVN_ERR(svn_io_open_uniquely_named(&fd, NULL, NULL, "svn-tempfile", ".tmp",
+ svn_io_file_del_on_pool_cleanup,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_io_file_info_get(&finfo, APR_FINFO_PROT, fd, scratch_pool));
+ SVN_ERR(svn_io_file_close(fd, scratch_pool));
+
+ *perms = finfo.protection;
+ default_perms = finfo.protection;
+ }
+ else
+ *perms = default_perms;
- *perms = finfo.protection;
return SVN_NO_ERROR;
}
@@ -1664,7 +1721,7 @@ svn_io_file_lock2(const char *lock_file,
/* Data consistency/coherency operations. */
-static svn_error_t *
+static APR_INLINE svn_error_t *
do_io_file_wrapper_cleanup(apr_file_t *file, apr_status_t status,
const char *msg, const char *msg_no_name,
apr_pool_t *pool);
@@ -2545,7 +2602,6 @@ svn_io_parse_mimetypes_file(apr_hash_t *
{
apr_array_header_t *tokens;
const char *type;
- int i;
svn_pool_clear(subpool);
@@ -2557,6 +2613,8 @@ svn_io_parse_mimetypes_file(apr_hash_t *
/* Only pay attention to non-empty, non-comment lines. */
if (buf->len)
{
+ int i;
+
if (buf->data[0] == '#')
continue;
@@ -2724,7 +2782,7 @@ svn_io_file_open(apr_file_t **new_file,
}
-static svn_error_t *
+static APR_INLINE svn_error_t *
do_io_file_wrapper_cleanup(apr_file_t *file, apr_status_t status,
const char *msg, const char *msg_no_name,
apr_pool_t *pool)
@@ -3256,6 +3314,10 @@ svn_io_dir_walk2(const char *dirname,
SVN_ERR(cstring_from_utf8(&dirname_apr, dirname, pool));
+ /* APR doesn't like "" directories */
+ if (dirname_apr[0] == '\0')
+ dirname_apr = ".";
+
apr_err = apr_dir_open(&handle, dirname_apr, pool);
if (apr_err)
return svn_error_wrap_apr(apr_err, _("Can't open directory '%s'"),
@@ -3819,7 +3881,7 @@ svn_io_open_unique_file3(apr_file_t **fi
* ### So we tweak perms of the tempfile here, but only if the umask
* ### allows it. */
SVN_ERR(merge_default_file_perms(tempfile, &perms, scratch_pool));
- SVN_ERR(file_perms_set(tempname, perms, scratch_pool));
+ SVN_ERR(file_perms_set2(tempfile, perms));
#endif
if (file)
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/log.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/log.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/log.c Sat Dec 11 00:15:55 2010
@@ -45,7 +45,7 @@ log_depth(svn_depth_t depth, apr_pool_t
{
if (depth == svn_depth_unknown)
return "";
- return apr_pstrcat(pool, " depth=", svn_depth_to_word(depth), NULL);
+ return apr_pstrcat(pool, " depth=", svn_depth_to_word(depth), (char *)NULL);
}
static const char *
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/mergeinfo.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/mergeinfo.c Sat Dec 11 00:15:55 2010
@@ -668,7 +668,7 @@ parse_revision_line(const char **input,
absolute path key. */
existing_rangelist = apr_hash_get(hash, pathname->data, APR_HASH_KEY_STRING);
if (existing_rangelist)
- svn_rangelist_merge(&rangelist, existing_rangelist, pool);
+ SVN_ERR(svn_rangelist_merge(&rangelist, existing_rangelist, pool));
apr_hash_set(hash, pathname->data, APR_HASH_KEY_STRING, rangelist);
@@ -1188,9 +1188,9 @@ mergeinfo_hash_diff_cb(const void *key,
apr_array_header_t *deleted_rangelist, *added_rangelist;
from_rangelist = apr_hash_get(cb->from, path, APR_HASH_KEY_STRING);
to_rangelist = apr_hash_get(cb->to, path, APR_HASH_KEY_STRING);
- svn_rangelist_diff(&deleted_rangelist, &added_rangelist,
- from_rangelist, to_rangelist,
- cb->consider_inheritance, cb->pool);
+ SVN_ERR(svn_rangelist_diff(&deleted_rangelist, &added_rangelist,
+ from_rangelist, to_rangelist,
+ cb->consider_inheritance, cb->pool));
if (cb->deleted && deleted_rangelist->nelts > 0)
apr_hash_set(cb->deleted, apr_pstrdup(cb->pool, path),
APR_HASH_KEY_STRING, deleted_rangelist);
@@ -1367,7 +1367,7 @@ svn_mergeinfo_catalog_merge(svn_mergeinf
change_elt = APR_ARRAY_IDX(sorted_changes, j, svn_sort__item_t);
res = svn_sort_compare_items_as_paths(&cat_elt, &change_elt);
- if (res == 0) /* Both catalogs have mergeinfo for a give path. */
+ if (res == 0) /* Both catalogs have mergeinfo for a given path. */
{
svn_mergeinfo_t mergeinfo = cat_elt.value;
svn_mergeinfo_t changes_mergeinfo = change_elt.value;
@@ -1760,7 +1760,7 @@ svn_mergeinfo__remove_prefix_from_catalo
apr_ssize_t padding = 0;
SVN_ERR_ASSERT(klen >= prefix_len);
- SVN_ERR_ASSERT(svn_uri_is_ancestor(prefix_path, original_path));
+ SVN_ERR_ASSERT(svn_fspath__is_ancestor(prefix_path, original_path));
/* If the ORIGINAL_PATH doesn't match the PREFIX_PATH exactly
and we're not simply removing a single leading slash (such as
@@ -1809,33 +1809,28 @@ svn_mergeinfo__add_prefix_to_catalog(svn
svn_error_t *
svn_mergeinfo__add_suffix_to_mergeinfo(svn_mergeinfo_t *out_mergeinfo,
svn_mergeinfo_t mergeinfo,
- const char *suffix,
+ const char *suffix_relpath,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- if (!suffix || svn_dirent_is_absolute(suffix))
- {
- *out_mergeinfo = svn_mergeinfo_dup(mergeinfo, result_pool);
- }
- else
- {
- apr_hash_index_t *hi;
- const char *canonical_suffix = svn_uri_canonicalize(suffix,
- scratch_pool);
- *out_mergeinfo = apr_hash_make(result_pool);
+ apr_hash_index_t *hi;
- for (hi = apr_hash_first(scratch_pool, mergeinfo);
- hi;
- hi = apr_hash_next(hi))
- {
- const char *path = svn__apr_hash_index_key(hi);
- apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
+ SVN_ERR_ASSERT(suffix_relpath && svn_relpath_is_canonical(suffix_relpath,
+ scratch_pool));
- apr_hash_set(*out_mergeinfo,
- svn_dirent_join(path, canonical_suffix, result_pool),
- APR_HASH_KEY_STRING,
- svn_rangelist_dup(rangelist, result_pool));
- }
+ *out_mergeinfo = apr_hash_make(result_pool);
+
+ for (hi = apr_hash_first(scratch_pool, mergeinfo);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ const char *path = svn__apr_hash_index_key(hi);
+ apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
+
+ apr_hash_set(*out_mergeinfo,
+ svn_dirent_join(path, suffix_relpath, result_pool),
+ APR_HASH_KEY_STRING,
+ svn_rangelist_dup(rangelist, result_pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/opt.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/opt.c Sat Dec 11 00:15:55 2010
@@ -88,18 +88,21 @@ svn_opt_get_option_from_code2(int code,
for (i = 0; option_table[i].optch; i++)
if (option_table[i].optch == code)
{
- int j;
if (command)
- for (j = 0; ((j < SVN_OPT_MAX_OPTIONS) &&
- command->desc_overrides[j].optch); j++)
- if (command->desc_overrides[j].optch == code)
- {
- apr_getopt_option_t *tmpopt =
- apr_palloc(pool, sizeof(*tmpopt));
- *tmpopt = option_table[i];
- tmpopt->description = command->desc_overrides[j].desc;
- return tmpopt;
- }
+ {
+ int j;
+
+ for (j = 0; ((j < SVN_OPT_MAX_OPTIONS) &&
+ command->desc_overrides[j].optch); j++)
+ if (command->desc_overrides[j].optch == code)
+ {
+ apr_getopt_option_t *tmpopt =
+ apr_palloc(pool, sizeof(*tmpopt));
+ *tmpopt = option_table[i];
+ tmpopt->description = command->desc_overrides[j].desc;
+ return tmpopt;
+ }
+ }
return &(option_table[i]);
}
@@ -121,6 +124,84 @@ svn_opt_get_option_from_code(int code,
}
+/* Like svn_opt_get_option_from_code2(), but also, if CODE appears a second
+ * time in OPTION_TABLE with a different name, then set *LONG_ALIAS to that
+ * second name, else set it to NULL. */
+static const apr_getopt_option_t *
+get_option_from_code(const char **long_alias,
+ int code,
+ const apr_getopt_option_t *option_table,
+ const svn_opt_subcommand_desc2_t *command,
+ apr_pool_t *pool)
+{
+ const apr_getopt_option_t *i;
+ const apr_getopt_option_t *opt
+ = svn_opt_get_option_from_code2(code, option_table, command, pool);
+
+ /* Find a long alias in the table, if there is one. */
+ *long_alias = NULL;
+ for (i = option_table; i->optch; i++)
+ {
+ if (i->optch == code && i->name != opt->name)
+ {
+ *long_alias = i->name;
+ break;
+ }
+ }
+
+ return opt;
+}
+
+
+/* Print an option OPT nicely into a STRING allocated in POOL.
+ * If OPT has a single-character short form, then print OPT->name (if not
+ * NULL) as an alias, else print LONG_ALIAS (if not NULL) as an alias.
+ * If DOC is set, include the generic documentation string of OPT,
+ * localized to the current locale if a translation is available.
+ */
+static void
+format_option(const char **string,
+ const apr_getopt_option_t *opt,
+ const char *long_alias,
+ svn_boolean_t doc,
+ apr_pool_t *pool)
+{
+ char *opts;
+
+ if (opt == NULL)
+ {
+ *string = "?";
+ return;
+ }
+
+ /* We have a valid option which may or may not have a "short
+ name" (a single-character alias for the long option). */
+ if (opt->optch <= 255)
+ opts = apr_psprintf(pool, "-%c [--%s]", opt->optch, opt->name);
+ else if (long_alias)
+ opts = apr_psprintf(pool, "--%s [--%s]", opt->name, long_alias);
+ else
+ opts = apr_psprintf(pool, "--%s", opt->name);
+
+ if (opt->has_arg)
+ opts = apr_pstrcat(pool, opts, _(" ARG"), (char *)NULL);
+
+ if (doc)
+ opts = apr_psprintf(pool, "%-24s : %s", opts, _(opt->description));
+
+ *string = opts;
+}
+
+void
+svn_opt_format_option(const char **string,
+ const apr_getopt_option_t *opt,
+ svn_boolean_t doc,
+ apr_pool_t *pool)
+{
+ format_option(string, opt, NULL, doc, pool);
+}
+
+
svn_boolean_t
svn_opt_subcommand_takes_option3(const svn_opt_subcommand_desc2_t *command,
int option_code,
@@ -204,6 +285,7 @@ print_command_info2(const svn_opt_subcom
if (help)
{
const apr_getopt_option_t *option;
+ const char *long_alias;
svn_boolean_t have_options = FALSE;
SVN_ERR(svn_cmdline_fprintf(stream, pool, ": %s", _(cmd->help)));
@@ -221,16 +303,14 @@ print_command_info2(const svn_opt_subcom
}
/* convert each option code into an option */
- option =
- svn_opt_get_option_from_code2(cmd->valid_options[i],
- options_table,
- cmd, pool);
+ option = get_option_from_code(&long_alias, cmd->valid_options[i],
+ options_table, cmd, pool);
/* print the option's docstring */
if (option && option->description)
{
const char *optstr;
- svn_opt_format_option(&optstr, option, TRUE, pool);
+ format_option(&optstr, option, long_alias, TRUE, pool);
SVN_ERR(svn_cmdline_fprintf(stream, pool, " %s\n",
optstr));
}
@@ -247,16 +327,14 @@ print_command_info2(const svn_opt_subcom
{
/* convert each option code into an option */
- option =
- svn_opt_get_option_from_code2(global_options[i],
- options_table,
- cmd, pool);
+ option = get_option_from_code(&long_alias, global_options[i],
+ options_table, cmd, pool);
/* print the option's docstring */
if (option && option->description)
{
const char *optstr;
- svn_opt_format_option(&optstr, option, TRUE, pool);
+ format_option(&optstr, option, long_alias, TRUE, pool);
SVN_ERR(svn_cmdline_fprintf(stream, pool, " %s\n",
optstr));
}
@@ -309,36 +387,6 @@ svn_opt_print_generic_help2(const char *
svn_error_clear(err);
}
-void
-svn_opt_format_option(const char **string,
- const apr_getopt_option_t *opt,
- svn_boolean_t doc,
- apr_pool_t *pool)
-{
- char *opts;
-
- if (opt == NULL)
- {
- *string = "?";
- return;
- }
-
- /* We have a valid option which may or may not have a "short
- name" (a single-character alias for the long option). */
- if (opt->optch <= 255)
- opts = apr_psprintf(pool, "-%c [--%s]", opt->optch, opt->name);
- else
- opts = apr_psprintf(pool, "--%s", opt->name);
-
- if (opt->has_arg)
- opts = apr_pstrcat(pool, opts, _(" ARG"), NULL);
-
- if (doc)
- opts = apr_psprintf(pool, "%-24s : %s", opts, _(opt->description));
-
- *string = opts;
-}
-
void
svn_opt_subcommand_help3(const char *subcommand,
@@ -614,7 +662,7 @@ svn_opt_push_implicit_dot_target(apr_arr
apr_pool_t *pool)
{
if (targets->nelts == 0)
- array_push_str(targets, "", pool); /* Ha! "", not ".", is the canonical */
+ APR_ARRAY_PUSH(targets, const char *) = ""; /* Ha! "", not ".", is the canonical */
assert(targets->nelts);
}
@@ -833,7 +881,7 @@ svn_opt__args_to_target_array(apr_array_
}
}
- target = apr_pstrcat(pool, true_target, peg_rev, NULL);
+ target = apr_pstrcat(pool, true_target, peg_rev, (char *)NULL);
APR_ARRAY_PUSH(output_targets, const char *) = target;
}
@@ -1031,18 +1079,21 @@ svn_opt_print_help3(apr_getopt_t *os,
apr_pool_t *pool)
{
apr_array_header_t *targets = NULL;
- int i;
if (os)
SVN_ERR(svn_opt_parse_all_args(&targets, os, pool));
if (os && targets->nelts) /* help on subcommand(s) requested */
- for (i = 0; i < targets->nelts; i++)
- {
- svn_opt_subcommand_help3(APR_ARRAY_IDX(targets, i, const char *),
- cmd_table, option_table,
- global_options, pool);
- }
+ {
+ int i;
+
+ for (i = 0; i < targets->nelts; i++)
+ {
+ svn_opt_subcommand_help3(APR_ARRAY_IDX(targets, i, const char *),
+ cmd_table, option_table,
+ global_options, pool);
+ }
+ }
else if (print_version) /* just --version */
SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer, quiet,
pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/sqlite.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/sqlite.c Sat Dec 11 00:15:55 2010
@@ -789,7 +789,7 @@ internal_open(sqlite3 **db3, const char
error than the close error at this point. */
sqlite3_close(*db3);
- msg = apr_pstrcat(scratch_pool, msg, ": '", path, "'", NULL);
+ msg = apr_pstrcat(scratch_pool, msg, ": '", path, "'", (char *)NULL);
return svn_error_create(SQLITE_ERROR_CODE(err_code), NULL, msg);
}
}
@@ -941,6 +941,11 @@ svn_sqlite__open(svn_sqlite__db_t **db,
SVN_ERR(exec_sql(*db, "PRAGMA foreign_keys=ON;"));
#endif
+ /* Store temporary tables in RAM instead of in temporary files, but don't
+ fail on this if this option is disabled in the sqlite compilation by
+ setting SQLITE_TEMP_STORE to 0 (always to disk) */
+ svn_error_clear(exec_sql(*db, "PRAGMA temp_store = MEMORY;"));
+
/* Validate the schema, upgrading if necessary. */
if (upgrade_sql != NULL)
SVN_ERR(check_format(*db, latest_schema, upgrade_sql, scratch_pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/subst.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/subst.c Sat Dec 11 00:15:55 2010
@@ -371,16 +371,14 @@ svn_subst_build_keywords2(apr_hash_t **k
/* Write out LEN bytes of BUF into STREAM. */
+/* ### TODO: 'stream_write()' would be a better name for this. */
static svn_error_t *
translate_write(svn_stream_t *stream,
const void *buf,
apr_size_t len)
{
- apr_size_t wrote = len;
- svn_error_t *write_err = svn_stream_write(stream, buf, &wrote);
- if ((write_err) || (len != wrote))
- return write_err;
-
+ SVN_ERR(svn_stream_write(stream, buf, &len));
+ /* (No need to check LEN, as a short write always produces an error.) */
return SVN_NO_ERROR;
}
@@ -609,30 +607,36 @@ translate_keyword(char *buf,
}
-/* Translate NEWLINE_BUF (length of NEWLINE_LEN) to the newline format
- specified in EOL_STR (length of EOL_STR_LEN), and write the
- translated thing to FILE (whose path is DST_PATH).
-
- SRC_FORMAT (length *SRC_FORMAT_LEN) is a cache of the first newline
- found while processing SRC_PATH. If the current newline is not the
- same style as that of SRC_FORMAT, look to the REPAIR parameter. If
- REPAIR is TRUE, ignore the inconsistency, else return an
- SVN_ERR_IO_INCONSISTENT_EOL error. If we are examining the first
- newline in the file, copy it to {SRC_FORMAT, *SRC_FORMAT_LEN} to
- use for later consistency checks. */
+/* Translate the newline string NEWLINE_BUF (of length NEWLINE_LEN) to
+ the newline string EOL_STR (of length EOL_STR_LEN), writing the
+ result (which is always EOL_STR) to the stream DST.
+
+ Also check for consistency of the source newline strings across
+ multiple calls, using SRC_FORMAT (length *SRC_FORMAT_LEN) as a cache
+ of the first newline found. If the current newline is not the same
+ as SRC_FORMAT, look to the REPAIR parameter. If REPAIR is TRUE,
+ ignore the inconsistency, else return an SVN_ERR_IO_INCONSISTENT_EOL
+ error. If *SRC_FORMAT_LEN is 0, assume we are examining the first
+ newline in the file, and copy it to {SRC_FORMAT, *SRC_FORMAT_LEN} to
+ use for later consistency checks.
+
+ Note: all parameters are required even if REPAIR is TRUE.
+ ### We could require that REPAIR must not change across a sequence of
+ calls, and could then optimize by not using SRC_FORMAT at all if
+ REPAIR is TRUE.
+*/
static svn_error_t *
translate_newline(const char *eol_str,
apr_size_t eol_str_len,
char *src_format,
apr_size_t *src_format_len,
- char *newline_buf,
+ const char *newline_buf,
apr_size_t newline_len,
svn_stream_t *dst,
svn_boolean_t repair)
{
- /* If this is the first newline we've seen, cache it
- future comparisons, else compare it with our cache to
- check for consistency. */
+ /* If we've seen a newline before, compare it with our cache to
+ check for consistency, else cache it for future comparisons. */
if (*src_format_len)
{
/* Comparing with cache. If we are inconsistent and
@@ -649,7 +653,7 @@ translate_newline(const char *eol_str,
strncpy(src_format, newline_buf, newline_len);
*src_format_len = newline_len;
}
- /* Translate the newline */
+ /* Write the desired newline */
return translate_write(dst, eol_str, eol_str_len);
}
@@ -794,6 +798,10 @@ struct translation_baton
/* Length of the EOL style string found in the chunk-source,
or zero if none encountered yet */
apr_size_t src_format_len;
+
+ /* If this is svn_tristate_false, translate_newline() will be called
+ for every newline in the file */
+ svn_tristate_t nl_translation_skippable;
};
@@ -824,6 +832,7 @@ create_translation_baton(const char *eol
b->newline_off = 0;
b->keyword_off = 0;
b->src_format_len = 0;
+ b->nl_translation_skippable = svn_tristate_unknown;
/* Most characters don't start translation actions.
* Mark those that do depending on the parameters we got. */
@@ -839,6 +848,38 @@ create_translation_baton(const char *eol
return b;
}
+/* Return TRUE if the EOL starting at BUF matches the eol_str member of B.
+ * Be aware of special cases like "\n\r\n" and "\n\n\r". For sequences like
+ * "\n$" (an EOL followed by a keyword), the result will be FALSE since it is
+ * more efficient to handle that special case implicitly in the calling code
+ * by exiting the quick scan loop.
+ * The caller must ensure that buf[0] and buf[1] refer to valid memory
+ * locations.
+ */
+static APR_INLINE svn_boolean_t
+eol_unchanged(struct translation_baton *b,
+ const char *buf)
+{
+ /* If the first byte doesn't match, the whole EOL won't.
+ * This does also handle the (certainly invalid) case that
+ * eol_str would be an empty string.
+ */
+ if (buf[0] != b->eol_str[0])
+ return FALSE;
+
+ /* two-char EOLs must be a full match */
+ if (b->eol_str_len == 2)
+ return buf[1] == b->eol_str[1];
+
+ /* The first char matches the required 1-byte EOL.
+ * But maybe, buf[] contains a 2-byte EOL?
+ * In that case, the second byte will be interesting
+ * and not be another EOL of its own.
+ */
+ return !b->interesting[(unsigned char)buf[1]] || buf[0] == buf[1];
+}
+
+
/* Translate eols and keywords of a 'chunk' of characters BUF of size BUFLEN
* according to the settings and state stored in baton B.
*
@@ -944,19 +985,72 @@ translate_chunk(svn_stream_t *dst,
continue;
}
- /* We're in the boring state; look for interest characters. */
- len = 0;
+ /* translate_newline will modify the baton for src_format_len==0
+ or may return an error if b->repair is FALSE. In all other
+ cases, we can skip the newline translation as long as source
+ EOL format and actual EOL format match. If there is a
+ mismatch, translate_newline will be called regardless of
+ nl_translation_skippable.
+ */
+ if (b->nl_translation_skippable == svn_tristate_unknown &&
+ b->src_format_len > 0)
+ {
+ /* test whether translate_newline may return an error */
+ if (b->eol_str_len == b->src_format_len &&
+ strncmp(b->eol_str, b->src_format, b->eol_str_len) == 0)
+ b->nl_translation_skippable = svn_tristate_true;
+ else if (b->repair)
+ b->nl_translation_skippable = svn_tristate_true;
+ else
+ b->nl_translation_skippable = svn_tristate_false;
+ }
+
+ /* We're in the boring state; look for interesting characters.
+ Offset len such that it will become 0 in the first iteration.
+ */
+ len = 0 - b->eol_str_len;
+
+ /* Look for the next EOL (or $) that actually needs translation.
+ Stop there or at EOF, whichever is encountered first.
+ */
+ do
+ {
+ /* skip current EOL */
+ len += b->eol_str_len;
+
+ /* Check 4 bytes at once to allow for efficient pipelining
+ and to reduce loop condition overhead. */
+ while ((p + len + 4) <= end)
+ {
+ char sum = interesting[(unsigned char)p[len]]
+ | interesting[(unsigned char)p[len+1]]
+ | interesting[(unsigned char)p[len+2]]
+ | interesting[(unsigned char)p[len+3]];
+
+ if (sum != 0)
+ break;
+
+ len += 4;
+ }
+
+ /* Found an interesting char or EOF in the next 4 bytes.
+ Find its exact position. */
+ while ((p + len) < end && !interesting[(unsigned char)p[len]])
+ ++len;
+ }
+ while (b->nl_translation_skippable ==
+ svn_tristate_true && /* can potentially skip EOLs */
+ p + len + 2 < end && /* not too close to EOF */
+ eol_unchanged (b, p + len)); /* EOL format already ok */
- /* We wanted memcspn(), but lacking that, the loop below has
- the same effect. Also, skip NUL characters.
- */
while ((p + len) < end && !interesting[(unsigned char)p[len]])
len++;
if (len)
- SVN_ERR(translate_write(dst, p, len));
-
- p += len;
+ {
+ SVN_ERR(translate_write(dst, p, len));
+ p += len;
+ }
/* Set up state according to the interesting character, if any. */
if (p < end)
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/svn_string.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/svn_string.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/svn_string.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/svn_string.c Sat Dec 11 00:15:55 2010
@@ -114,6 +114,10 @@ find_char_backward(const char *str, apr_
/* svn_string functions */
+/* Return a new svn_string_t object, allocated in POOL, initialized with
+ * DATA and SIZE. Do not copy the contents of DATA, just store the pointer.
+ * SIZE is the length in bytes of DATA, excluding the required NUL
+ * terminator. */
static svn_string_t *
create_string(const char *data, apr_size_t size,
apr_pool_t *pool)
@@ -246,7 +250,15 @@ create_stringbuf(char *data, apr_size_t
svn_stringbuf_t *
svn_stringbuf_create_ensure(apr_size_t blocksize, apr_pool_t *pool)
{
- char *data = apr_palloc(pool, ++blocksize); /* + space for '\0' */
+ char *data;
+
+ /* apr_palloc will allocate multiples of 8.
+ * Thus, we would waste some of that memory if we stuck to the
+ * smaller size. Note that this is safe even if apr_palloc would
+ * use some other aligment or none at all. */
+
+ ++blocksize; /* + space for '\0' */
+ data = apr_palloc(pool, APR_ALIGN_DEFAULT(blocksize));
data[0] = '\0';
@@ -257,9 +269,7 @@ svn_stringbuf_create_ensure(apr_size_t b
svn_stringbuf_t *
svn_stringbuf_ncreate(const char *bytes, apr_size_t size, apr_pool_t *pool)
{
- /* Ensure string buffer of size + 1 */
svn_stringbuf_t *strbuf = svn_stringbuf_create_ensure(size, pool);
-
memcpy(strbuf->data, bytes, size);
/* Null termination is the convention -- even if we suspect the data
@@ -364,12 +374,18 @@ svn_stringbuf_ensure(svn_stringbuf_t *st
if (str->blocksize < minimum_size)
{
if (str->blocksize == 0)
- str->blocksize = minimum_size;
+ /* APR will increase odd allocation sizes to the next
+ * multiple for 8, for instance. Take advantage of that
+ * knowledge and allow for the extra size to be used. */
+ str->blocksize = APR_ALIGN_DEFAULT(minimum_size);
else
while (str->blocksize < minimum_size)
{
+ /* str->blocksize is aligned;
+ * doubling it should keep it aligned */
apr_size_t prev_size = str->blocksize;
str->blocksize *= 2;
+
/* check for apr_size_t overflow */
if (prev_size > str->blocksize)
{
@@ -388,28 +404,60 @@ svn_stringbuf_ensure(svn_stringbuf_t *st
}
+/* WARNING - Optimized code ahead!
+ * This function has been hand-tuned for performance. Please read
+ * the comments below before modifying the code.
+ */
void
svn_stringbuf_appendbyte(svn_stringbuf_t *str, char byte)
{
+ char *dest;
+ apr_size_t old_len = str->len;
+
/* In most cases, there will be pre-allocated memory left
* to just write the new byte at the end of the used section
* and terminate the string properly.
*/
- apr_size_t old_len = str->len;
if (str->blocksize > old_len + 1)
{
- char *dest = str->data;
+ /* The following read does not depend this write, so we
+ * can issue the write first to minimize register pressure:
+ * The value of old_len+1 is no longer needed; on most processors,
+ * dest[old_len+1] will be calculated implicitly as part of
+ * the addressing scheme.
+ */
+ str->len = old_len+1;
+
+ /* Since the compiler cannot be sure that *src->data and *src
+ * don't overlap, we read src->data *once* before writing
+ * to *src->data. Replacing dest with str->data would force
+ * the compiler to read it again after the first byte.
+ */
+ dest = str->data;
+ /* If not already available in a register as per ABI, load
+ * "byte" into the register (e.g. the one freed from old_len+1),
+ * then write it to the string buffer and terminate it properly.
+ *
+ * Including the "byte" fetch, all operations so far could be
+ * issued at once and be scheduled at the CPU's descression.
+ * Most likely, no-one will soon depend on the data that will be
+ * written in this function. So, no stalls there, either.
+ */
dest[old_len] = byte;
dest[old_len+1] = '\0';
-
- str->len = old_len+1;
}
else
{
/* we need to re-allocate the string buffer
* -> let the more generic implementation take care of that part
*/
+
+ /* Depending on the ABI, "byte" is a register value. If we were
+ * to take its address directly, the compiler might decide to
+ * put in on the stack *unconditionally*, even if that would
+ * only be necessary for this block.
+ */
char b = byte;
svn_stringbuf_appendbytes(str, &b, 1);
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/utf.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_subr/utf.c Sat Dec 11 00:15:55 2010
@@ -155,7 +155,7 @@ get_xlate_key(const char *topage,
topage = "APR_DEFAULT_CHARSET";
return apr_pstrcat(pool, "svn-utf-", frompage, "to", topage,
- "-xlate-handle", NULL);
+ "-xlate-handle", (char *)NULL);
}
/* Set *RET to a handle node for converting from FROMPAGE to TOPAGE,
@@ -588,7 +588,8 @@ invalid_utf8(const char *data, apr_size_
for (i = 0; i < valid; ++i)
valid_txt = apr_pstrcat(pool, valid_txt,
apr_psprintf(pool, " %02x",
- (unsigned char)last[i-valid]), NULL);
+ (unsigned char)last[i-valid]),
+ (char *)NULL);
/* 4 invalid octets will guarantee that the faulty octet is displayed */
invalid = data + len - last;
@@ -597,7 +598,8 @@ invalid_utf8(const char *data, apr_size_
for (i = 0; i < invalid; ++i)
invalid_txt = apr_pstrcat(pool, invalid_txt,
apr_psprintf(pool, " %02x",
- (unsigned char)last[i]), NULL);
+ (unsigned char)last[i]),
+ (char *)NULL);
return svn_error_createf(APR_EINVAL, NULL,
_("Valid UTF-8 data\n(hex:%s)\n"
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_crawler.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_crawler.c Sat Dec 11 00:15:55 2010
@@ -347,7 +347,8 @@ report_revisions_and_depths(svn_wc__db_t
svn_revnum_t this_rev;
svn_depth_t this_depth;
svn_wc__db_lock_t *this_lock;
- svn_boolean_t this_switched;
+ svn_boolean_t this_switched = FALSE;
+ svn_boolean_t this_file_external = FALSE;
/* Clear the iteration subpool here because the loop has a bunch
of 'continue' jump statements. */
@@ -461,7 +462,6 @@ report_revisions_and_depths(svn_wc__db_t
/* And finally prepare for reporting */
if (!this_repos_relpath)
{
- this_switched = FALSE;
this_repos_relpath = svn_relpath_join(dir_repos_relpath, child,
iterpool);
}
@@ -472,9 +472,20 @@ report_revisions_and_depths(svn_wc__db_t
NULL);
if (childname == NULL || strcmp(childname, child) != 0)
- this_switched = TRUE;
- else
- this_switched = FALSE;
+ {
+ const char *file_ext_str;
+
+ this_switched = TRUE;
+
+ /* This could be a file external! We need to know
+ that. */
+ SVN_ERR(svn_wc__db_temp_get_file_external(&file_ext_str, db,
+ this_abspath,
+ scratch_pool,
+ scratch_pool));
+ if (file_ext_str)
+ this_file_external = TRUE;
+ }
}
/* Tweak THIS_DEPTH to a useful value. */
@@ -489,9 +500,15 @@ report_revisions_and_depths(svn_wc__db_t
if (!SVN_IS_VALID_REVNUM(this_rev))
this_rev = dir_rev;
+ /*** File Externals **/
+ if (this_file_external)
+ {
+ /* File externals are ... special. We ignore them. */;
+ }
+
/*** Files ***/
- if (this_kind == svn_wc__db_kind_file ||
- this_kind == svn_wc__db_kind_symlink)
+ else if (this_kind == svn_wc__db_kind_file ||
+ this_kind == svn_wc__db_kind_symlink)
{
if (report_everything)
{
@@ -563,7 +580,7 @@ report_revisions_and_depths(svn_wc__db_t
if (report_everything)
{
- /* Report the dir unconditionally, one way or another. */
+ /* Report the dir unconditionally, one way or another... */
if (this_switched)
SVN_ERR(reporter->link_path(report_baton,
this_path,
@@ -585,24 +602,20 @@ report_revisions_and_depths(svn_wc__db_t
this_lock ? this_lock->token : NULL,
iterpool));
}
-
- /* Possibly report a disjoint URL ... */
else if (this_switched)
- SVN_ERR(reporter->link_path(report_baton,
- this_path,
- svn_path_url_add_component2(
- dir_repos_root,
- this_repos_relpath, iterpool),
- this_rev,
- this_depth,
- start_empty,
- this_lock ? this_lock->token : NULL,
- iterpool));
- /* ... or perhaps just a differing revision, lock token, incomplete
- subdir, the mere presence of the directory in a depth-empty or
- depth-files dir, or if the parent dir is at depth-immediates but
- the child is not at depth-empty. Also describe shallow subdirs
- if we are trying to set depth to infinity. */
+ {
+ /* ...or possibly report a disjoint URL ... */
+ SVN_ERR(reporter->link_path(report_baton,
+ this_path,
+ svn_path_url_add_component2(
+ dir_repos_root,
+ this_repos_relpath, iterpool),
+ this_rev,
+ this_depth,
+ start_empty,
+ this_lock ? this_lock->token : NULL,
+ iterpool));
+ }
else if (this_rev != dir_rev
|| this_lock
|| is_incomplete
@@ -612,16 +625,25 @@ report_revisions_and_depths(svn_wc__db_t
&& this_depth != svn_depth_empty)
|| (this_depth < svn_depth_infinity
&& depth == svn_depth_infinity))
- SVN_ERR(reporter->set_path(report_baton,
- this_path,
- this_rev,
- this_depth,
- start_empty,
- this_lock ? this_lock->token : NULL,
- iterpool));
+ {
+ /* ... or perhaps just a differing revision, lock token,
+ incomplete subdir, the mere presence of the directory
+ in a depth-empty or depth-files dir, or if the parent
+ dir is at depth-immediates but the child is not at
+ depth-empty. Also describe shallow subdirs if we are
+ trying to set depth to infinity. */
+ SVN_ERR(reporter->set_path(report_baton,
+ this_path,
+ this_rev,
+ this_depth,
+ start_empty,
+ this_lock ? this_lock->token : NULL,
+ iterpool));
+ }
+ /* Finally, recurse if necessary and appropriate. */
if (SVN_DEPTH_IS_RECURSIVE(depth))
- SVN_ERR(report_revisions_and_depths(db,
+ SVN_ERR(report_revisions_and_depths(db,
anchor_abspath,
this_path,
this_rev,
@@ -687,7 +709,7 @@ find_base_rev(svn_revnum_t *base_rev,
else if (status == svn_wc__db_status_deleted)
{
const char *work_del_abspath;
- SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL, NULL, &work_del_abspath,
+ SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL, &work_del_abspath,
db, local_abspath, pool, pool));
if (work_del_abspath != NULL)
@@ -792,22 +814,12 @@ svn_wc_crawl_revisions5(svn_wc_context_t
if (!repos_root || !repos_relpath)
{
- err = svn_wc__db_scan_base_repos(&repos_relpath, &repos_root, NULL,
- db, local_abspath,
- scratch_pool, scratch_pool);
-
- if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
- svn_error_clear(err);
- else
- SVN_ERR(err);
-
/* Ok, that leaves a local addition. Deleted and not existing nodes
are already handled. */
- if (!repos_root || !repos_relpath)
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
- &repos_root, NULL, NULL, NULL, NULL,
- NULL, db, local_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
+ &repos_root, NULL, NULL, NULL, NULL,
+ NULL, db, local_abspath,
+ scratch_pool, scratch_pool));
}
if (!SVN_IS_VALID_REVNUM(target_rev))
@@ -925,15 +937,6 @@ svn_wc_crawl_revisions5(svn_wc_context_t
if (err)
goto abort_report;
- if (!parent_repos_relpath)
- err = svn_wc__db_scan_base_repos(&parent_repos_relpath, NULL,
- NULL,
- db, parent_abspath,
- scratch_pool, scratch_pool);
-
- if (err)
- goto abort_report;
-
if (strcmp(repos_relpath,
svn_relpath_join(parent_repos_relpath, base,
scratch_pool)) != 0)
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_files.c?rev=1044548&r1=1044547&r2=1044548&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/adm_files.c Sat Dec 11 00:15:55 2010
@@ -119,7 +119,7 @@ simple_extend(const char *adm_path, /*
if (subdir)
child = svn_dirent_join(subdir, child, result_pool);
if (extension)
- child = apr_pstrcat(result_pool, child, extension, NULL);
+ child = apr_pstrcat(result_pool, child, extension, (char *)NULL);
if (use_tmp)
return svn_dirent_join_many(result_pool,
@@ -774,7 +774,6 @@ svn_wc_create_tmp_file2(apr_file_t **fp,
svn_wc__db_t *db;
const char *local_abspath;
const char *temp_dir;
- apr_file_t *file;
svn_error_t *err;
SVN_ERR_ASSERT(fp || new_name);
@@ -792,14 +791,9 @@ svn_wc_create_tmp_file2(apr_file_t **fp,
if (err)
return svn_error_return(err);
- SVN_ERR(svn_io_open_unique_file3(&file, new_name, temp_dir,
+ SVN_ERR(svn_io_open_unique_file3(fp, new_name, temp_dir,
delete_when, pool, pool));
- if (fp)
- *fp = file;
- else
- SVN_ERR(svn_io_file_close(file, pool));
-
return SVN_NO_ERROR;
}