arfrever_at_tigris.org wrote:
> Author: arfrever
> Date: Sat Aug 30 06:54:54 2008
> New Revision: 32829
>
> Log:
> Use svn_stringbuf_from_file2() instead of deprecated svn_stringbuf_from_file().
>
> * subversion/libsvn_subr/subst.c:
> * subversion/libsvn_wc/adm_files.c:
> * subversion/svnadmin/main.c:
> * subversion/svn/conflict-callbacks.c:
> * subversion/svndumpfilter/main.c:
> * subversion/svn/main.c:
> * subversion/svn/util.c:
> * subversion/tests/libsvn_diff/diff-diff3-test.c:
> * subversion/tests/libsvn_subr/string-test.c:
> * subversion/tests/libsvn_subr/translate-test.c:
> Use svn_stringbuf_from_file2() instead of deprecated svn_stringbuf_from_file().
I'm concerned about modifying the tests to remove the use of deprecated
functionality. The tests exist, in part, to test that functionality, and make
sure that any reimplementation continue to maintain the prior functionality.
Please revert the changes to the tests in this revision, and in r32830. Perhaps
we can define SVN_DEPRECATED at the beginning of the test files so that they
don't compile with the warning?
-Hyrum
> Modified:
> trunk/subversion/libsvn_subr/subst.c
> trunk/subversion/libsvn_wc/adm_files.c
> trunk/subversion/svn/conflict-callbacks.c
> trunk/subversion/svn/main.c
> trunk/subversion/svn/util.c
> trunk/subversion/svnadmin/main.c
> trunk/subversion/svndumpfilter/main.c
> trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
> trunk/subversion/tests/libsvn_subr/string-test.c
> trunk/subversion/tests/libsvn_subr/translate-test.c
>
> Modified: trunk/subversion/libsvn_subr/subst.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_subr/subst.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/libsvn_subr/subst.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/libsvn_subr/subst.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -2,7 +2,7 @@
> * subst.c : generic eol/keyword substitution routines
> *
> * ====================================================================
> - * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -1661,7 +1661,7 @@ create_special_file(const char *src, con
> }
> else
> /* Read in the detranslated file. */
> - SVN_ERR(svn_stringbuf_from_file(&contents, src, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&contents, src, pool));
>
> return create_special_file_from_stringbuf(contents, dst, pool);
> }
>
> Modified: trunk/subversion/libsvn_wc/adm_files.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/adm_files.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/libsvn_wc/adm_files.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/libsvn_wc/adm_files.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -6,7 +6,7 @@
> * information is kept.
> *
> * ====================================================================
> - * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -291,7 +291,7 @@ svn_wc__check_killme(svn_wc_adm_access_t
> path = extend_with_adm_name(svn_wc_adm_access_path(adm_access),
> NULL, FALSE, pool, SVN_WC__ADM_KILLME, NULL);
>
> - err = svn_stringbuf_from_file(&contents, path, pool);
> + err = svn_stringbuf_from_file2(&contents, path, pool);
>
> if (err)
> {
>
> Modified: trunk/subversion/svn/conflict-callbacks.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svn/conflict-callbacks.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/svn/conflict-callbacks.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/svn/conflict-callbacks.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -3,7 +3,7 @@
> * commandline client.
> *
> * ====================================================================
> - * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -414,8 +414,8 @@ svn_cl__conflict_handler(svn_wc_conflict
>
> if (desc->my_file)
> {
> - SVN_ERR(svn_stringbuf_from_file(&myval, desc->my_file,
> - subpool));
> + SVN_ERR(svn_stringbuf_from_file2(&myval, desc->my_file,
> + subpool));
> SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
> _("They want to delete the property, "
> "you want to change the value to '%s'.\n"),
> @@ -423,8 +423,8 @@ svn_cl__conflict_handler(svn_wc_conflict
> }
> else
> {
> - SVN_ERR(svn_stringbuf_from_file(&theirval, desc->their_file,
> - subpool));
> + SVN_ERR(svn_stringbuf_from_file2(&theirval, desc->their_file,
> + subpool));
> SVN_ERR(svn_cmdline_fprintf(stderr, subpool,
> _("They want to change the property value to '%s', "
> "you want to delete the property.\n"),
>
> Modified: trunk/subversion/svn/main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svn/main.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/svn/main.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/svn/main.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -2,7 +2,7 @@
> * main.c: Subversion command line client.
> *
> * ====================================================================
> - * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -1239,8 +1239,8 @@ main(int argc, const char *argv[])
> case 'F':
> err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
> if (! err)
> - err = svn_stringbuf_from_file(&(opt_state.filedata),
> - utf8_opt_arg, pool);
> + err = svn_stringbuf_from_file2(&(opt_state.filedata),
> + utf8_opt_arg, pool);
> if (err)
> return svn_cmdline_handle_exit_error(err, pool, "svn: ");
> dash_F_arg = opt_arg;
> @@ -1256,7 +1256,7 @@ main(int argc, const char *argv[])
> err = svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool);
>
> if (! err)
> - err = svn_stringbuf_from_file(&buffer, utf8_opt_arg, pool);
> + err = svn_stringbuf_from_file2(&buffer, utf8_opt_arg, pool);
> if (! err)
> err = svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool);
> if (err)
>
> Modified: trunk/subversion/svn/util.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svn/util.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/svn/util.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/svn/util.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -4,7 +4,7 @@
> * in here.
> *
> * ====================================================================
> - * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -432,7 +432,7 @@ svn_cl__edit_string_externally(svn_strin
> (finfo_before.size != finfo_after.size))
> {
> svn_stringbuf_t *edited_contents_s;
> - err = svn_stringbuf_from_file(&edited_contents_s, tmpfile_name, pool);
> + err = svn_stringbuf_from_file2(&edited_contents_s, tmpfile_name, pool);
> if (err)
> goto cleanup;
>
>
> Modified: trunk/subversion/svnadmin/main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svnadmin/main.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/svnadmin/main.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/svnadmin/main.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -2,7 +2,7 @@
> * main.c: Subversion server administration tool.
> *
> * ====================================================================
> - * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -983,7 +983,7 @@ set_revprop(const char *prop_name, const
> SVN_ERR(svn_utf_cstring_to_utf8(&filename_utf8, filename, pool));
> filename_utf8 = svn_path_internal_style(filename_utf8, pool);
>
> - SVN_ERR(svn_stringbuf_from_file(&file_contents, filename_utf8, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&file_contents, filename_utf8, pool));
>
> prop_value->data = file_contents->data;
> prop_value->len = file_contents->len;
>
> Modified: trunk/subversion/svndumpfilter/main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svndumpfilter/main.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/svndumpfilter/main.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/svndumpfilter/main.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -2,7 +2,7 @@
> * main.c: Subversion dump stream filtering tool.
> *
> * ====================================================================
> - * Copyright (c) 2000-2006 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2006, 2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -1380,8 +1380,8 @@ main(int argc, const char *argv[])
> SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_targets_file,
> opt_state.targets_file, pool));
>
> - SVN_INT_ERR(svn_stringbuf_from_file(&buffer, utf8_targets_file,
> - pool));
> + SVN_INT_ERR(svn_stringbuf_from_file2(&buffer, utf8_targets_file,
> + pool));
> SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool));
>
> opt_state.prefixes = apr_array_append(pool,
>
> Modified: trunk/subversion/tests/libsvn_diff/diff-diff3-test.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/libsvn_diff/diff-diff3-test.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/tests/libsvn_diff/diff-diff3-test.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -2,7 +2,7 @@
> * Incomplete regression tests for the diff/diff3 library.
> *
> * ====================================================================
> - * Copyright (c) 2003-2006 CollabNet. All rights reserved.
> + * Copyright (c) 2003-2006, 2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -210,7 +210,7 @@ three_way_merge(const char *filename1,
> status = apr_file_close(output);
> if (status)
> return svn_error_createf(status, NULL, "failed to close '%s'", merge_name);
> - SVN_ERR(svn_stringbuf_from_file(&actual, merge_name, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&actual, merge_name, pool));
> if (strcmp(actual->data, expected))
> return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
> "failed merging diff '%s' to '%s' into '%s'",
> @@ -296,7 +296,7 @@ two_way_diff(const char *filename1,
> if (status)
> return svn_error_createf(status, NULL, "failed to close '%s'", diff_name);
>
> - SVN_ERR(svn_stringbuf_from_file(&actual, diff_name, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&actual, diff_name, pool));
> if (strcmp(actual->data, expected))
> return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
> "failed comparing '%s' and '%s'",
> @@ -2122,8 +2122,8 @@ random_trivial_merge(const char **msg,
> min_lines, max_lines, var_lines, block_lines,
> i % 2, subpool));
>
> - SVN_ERR(svn_stringbuf_from_file(&contents1, filename1, subpool));
> - SVN_ERR(svn_stringbuf_from_file(&contents2, filename2, subpool));
> + SVN_ERR(svn_stringbuf_from_file2(&contents1, filename1, subpool));
> + SVN_ERR(svn_stringbuf_from_file2(&contents2, filename2, subpool));
>
> SVN_ERR(three_way_merge(filename1, filename2, filename1,
> contents1->data, contents2->data,
> @@ -2192,10 +2192,10 @@ random_three_way_merge(const char **msg,
> SVN_ERR(make_random_merge_file(filename4, num_lines, mrg_lines,
> num_src + num_dst, pool));
>
> - SVN_ERR(svn_stringbuf_from_file(&original, filename1, pool));
> - SVN_ERR(svn_stringbuf_from_file(&modified1, filename2, pool));
> - SVN_ERR(svn_stringbuf_from_file(&modified2, filename3, pool));
> - SVN_ERR(svn_stringbuf_from_file(&combined, filename4, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&original, filename1, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&modified1, filename2, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&modified2, filename3, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&combined, filename4, pool));
>
> SVN_ERR(three_way_merge(filename1, filename2, filename3,
> original->data, modified1->data,
> @@ -2271,10 +2271,10 @@ merge_with_part_already_present(const ch
> SVN_ERR(make_random_merge_file(filename4, num_lines, mrg_lines,
> num_src + num_dst / 2, pool));
>
> - SVN_ERR(svn_stringbuf_from_file(&original, filename1, pool));
> - SVN_ERR(svn_stringbuf_from_file(&modified1, filename2, pool));
> - SVN_ERR(svn_stringbuf_from_file(&modified2, filename3, pool));
> - SVN_ERR(svn_stringbuf_from_file(&combined, filename4, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&original, filename1, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&modified1, filename2, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&modified2, filename3, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&combined, filename4, pool));
>
> SVN_ERR(three_way_merge(filename1, filename2, filename3,
> original->data, modified1->data,
>
> Modified: trunk/subversion/tests/libsvn_subr/string-test.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/libsvn_subr/string-test.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/tests/libsvn_subr/string-test.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/tests/libsvn_subr/string-test.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -1,8 +1,8 @@
> /*
> - * string-test.c: a collection of libsvn_string tests
> + * string-test.c: a collection of string tests
> *
> * ====================================================================
> - * Copyright (c) 2000-2004 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -438,7 +438,7 @@ test12(const char **msg,
> if (status)
> return fail(pool, "closing file");
>
> - SVN_ERR(svn_stringbuf_from_file(&s, fname, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&s, fname, pool));
> SVN_ERR(check_string_contents(s, ftext, sizeof(ftext) - 1, repeat, pool));
>
> /* Reset to avoid false positives */
>
> Modified: trunk/subversion/tests/libsvn_subr/translate-test.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/libsvn_subr/translate-test.c?pathrev=32829&r1=32828&r2=32829
> ==============================================================================
> --- trunk/subversion/tests/libsvn_subr/translate-test.c Sat Aug 30 06:29:39 2008 (r32828)
> +++ trunk/subversion/tests/libsvn_subr/translate-test.c Sat Aug 30 06:54:54 2008 (r32829)
> @@ -2,7 +2,7 @@
> * translate-test.c -- test the eol and keyword translation subroutine
> *
> * ====================================================================
> - * Copyright (c) 2000-2004 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2004, 2008 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -722,7 +722,7 @@ substitute_and_verify(const char *test_n
>
> /** Ready to verify. **/
>
> - SVN_ERR(svn_stringbuf_from_file(&contents, dst_fname, pool));
> + SVN_ERR(svn_stringbuf_from_file2(&contents, dst_fname, pool));
>
> for (i = 0; i < (sizeof(expect) / sizeof(*expect)); i++)
> {
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: svn-help_at_subversion.tigris.org
>
>
Received on 2008-08-30 16:15:09 CEST