Checkout Tools
  • last updated 5 hours ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 1064436 is being indexed.

Reintegrate the 'uris-as-urls' branch into trunk.

(Merged /subversion/branches/uris-as-urls:r1060426-1064427.)

This should wrap up issue #2028.

  1. … 73 more files in changeset.
Extend svn_subst_translate_string2() with another parameter, REPAIR, to allow

the caller to customize whether line ending repairs are performed.

As discussed at:

* subversion/include/svn_subst.h

(svn_subst_translate_string2): Add a REPAIR parameter. Update the

documentation of the function.

* subversion/libsvn_subr/subst.c

(svn_subst_translate_string2): Add a REPAIR parameter. Pass the value through

to translate_cstring().

* subversion/libsvn_subr/deprecated.c

(svn_subst_translate_string): Call svn_subst_translate_string2() with REPAIR

set to FALSE.

* subversion/svn/util.c

(svn_cl__edit_string_externally, svn_cl__get_log_message): Call

svn_subst_translate_string2() with REPAIR set to FALSE.

* subversion/svn/propset-cmd.c

(svn_cl__propset): Call svn_subst_translate_string2() with REPAIR set to


* subversion/svn/lock-cmd.c

(get_comment): Call svn_subst_translate_string2() with REPAIR set to FALSE.

* subversion/svnadmin/main.c

(set_revprop): Call svn_subst_translate_string2() with REPAIR set to FALSE.

* subversion/tests/libsvn_subr/subst_translate-test.c

(test_svn_subst_translate_string2): Call svn_subst_translate_string2() with

REPAIR set to FALSE. Also test that inconsistent line endings result in


(test_repairing_svn_subst_translate_string2): New test case that tests a

repairing translation.

(test_funcs): Add test_repairing_svn_subst_translate_string2.

Patch by: Danny Trebbien <dtrebbien{_AT_}>

  1. … 7 more files in changeset.
Just padding my stats.

(Actually, doing my regular trailing whitespace removal, similar to r875968.)

* everywhere:

for extsn in c h cpp java py pl rb; do

sed -i -e 's/[ \t]*$//' `find . -name "*.$extsn" | xargs grep '[ \t]$' -l`


  1. … 166 more files in changeset.
Once and for all, name all our anonymous struct/enum typedefs.

Follows up on r1040058, and with thanks to Danny Trebbien.

* everywhere:

Change 'typedef struct {} foo_t;' to 'typedef struct foo_t {} foo_t;'.

* subversion/libsvn_ra_serf/fake_sspi.h

(PSecurityFunctionTable, SecurityFunctionTable):

Manually effect the same change in the single pointer-to-struct typedef.

  1. … 95 more files in changeset.
Add a public API function, svn_subst_translate_string2(), an extension of

svn_subst_translate_string(), that has two additional output parameters for

determining whether re-encoding and/or line ending translation were performed.

As discussed at:



The essential changes are to the translate_newline() function, which now takes

an svn_boolean_t pointer, the value at which is set to TRUE if the pointer is

non-NULL and a different newline is written out. Most other changes are to pass

the svn_boolean_t pointer through to translate_newline().

* build.conf

Configure subversion/tests/libsvn_subr/subst_translate-test

* subversion/include/svn_subst.h

(svn_subst_translate_string2): New function.

(svn_subst_translate_string): Deprecate in favor of


* subversion/libsvn_subr/subst.c

(STRING_IS_EOL): New macro that tests whether a string is an end-of-line

string ("\n", "\r", "\r\n").

(DIFFERENT_EOL_STRINGS): New macro that tests whether two end-of-line strings

are different.

(translate_newline): Add the TRANSLATED_EOL parameter. If the function

writes out a different newline, then it sets TRANSLATED_EOL to TRUE.

(translation_baton): Add the TRANSLATED_EOL field.

(create_translation_baton): Add a new parameter TRANSLATED_EOL that is

passed to the resulting translation_baton.

(translate_chunk): When calling translate_newline(), pass TRANSLATED_EOL from

the translation_baton.

(stream_translated): New static function. Its implementation is the old

implementation of svn_subst_stream_translated(), but accepting another

parameter, TRANSLATED_EOL, that is passed to the in/out translation batons

that it creates.

(svn_subst_stream_translated): Now a wrapper for stream_translated().

(translate_cstring): New static function. Its implementation is the old

implementation of svn_subst_translate_cstring2(), but modified to accept

another parameter, TRANSLATED_EOL, that is passed to stream_translated().

(svn_subst_translate_cstring2): Now a wrapper for translate_cstring().

(svn_subst_translate_string): Move to deprecated.c.

(svn_subst_translate_string2): New function. It takes three additional

parameters: TRANSLATED_TO_UTF8, TRANSLATED_LINE_ENDINGS, and another pool

parameter. The task of recording whether it translates a line ending is

delegated to translate_cstring().

* subversion/libsvn_subr/deprecated.c

(svn_subst_translate_string): Now a wrapper for svn_subst_translate_string2().

* subversion/tests/libsvn_subr/subst_translate-test.c

New test suite for the svn_subst_translate_* functions.

Patch by: Danny Trebbien <dtrebbien{_AT_}>

  1. … 4 more files in changeset.
* subversion/libsvn_subr/subst.c

(translation_baton, translate_chunk): Typo, and minor formatting and

wording tweaks.

Merge the r986453 group from the performance branch.

See the branch for original log messages.

The STATUS entry for this group was:

* r986453, r1029092, r1029335, r1030763

An even larger change: Speed up file translation by further optimizing

the search for "interesting chars" and replacing EOLs only if they

have actually changed (allowing for larger chunks of data per write

output operation). The third patch fixes a svn_tristate_t comparison



r1029092 and r1030763 are docstring changes.


Apart from the physical I/O and the MD5 translation, this is the

most CPU-demanding part of an svn export. This patch more than

doubles its performance. It should also speed up svn checkout by

the same amount (not factor) of time.

  1. … 1 more file in changeset.
* subversion/libsvn_subr/subst.c

(translate_write): Simplify, removing an ineffective check. No functional


(translate_newline): Re-write the doc string to fix errors and omissions.

Tweak comments.

Merge r985037, r985046, r995507 and r995603 from the performance branch.

These changes introduce the svn_stringbuf_appendbyte() function, which has

significantly less overhead than svn_stringbuf_appendbytes(), and can be

used in a number of places within our codebase.

r995507 is the removal of an extra function on the branch. This function

conflicted with previous revisions in the merge, and is itself no longer on


  1. … 20 more files in changeset.
Make seeking to the start of an svn_stream_t an operation handled by the

seek callbacks, instead of using a separate callback. We can do this

by handling NULL as a generic marker for the start of the stream.

Resetting and seeking were both added during 1.7 development to help

with building diff/patch support over streams, so we can still change

this now.

* subversion/include/svn_error_codes.h



* subversion/include/svn_io.h

(svn_io_reset_fn_t): Remove typedef.

(svn_stream_set_reset): Remove function.

(svn_stream_seek): Update documentation.

* subversion/libsvn_subr/stream.c

(svn_stream_t): Remove reset_fn.

(svn_stream_create): Don't initialize reset_fn.

(svn_stream_set_reset): Remove function.

(svn_stream_reset): Just call svn_stream_seek().

(reset_handler_empty): Remove function.

(mark_handler_empty): Set output argument.

(svn_stream_empty): Don't set reset handler.

(reset_handler_disown): Remove function.

(svn_stream_disown): Don't set reset handler.

(reset_handler_apr): Remove function. Move seek to start support into ...

(seek_handler_apr): ... this function.

(svn_stream_from_aprfile2): Don't set reset function.

(svn_stream_from_aprfile_range_readonly): Don't set reset function.

(reset_handler_stringbuf): Remove function. Move support into ...

(seek_handler_stringbuf): ... this function.

(svn_stream_from_stringbuf): Don't set reset function.

(string_stream_mark): New struct.

(mark_handler_string): New function.

(seek_handler_string): New function.

(svn_stream_from_string): Set mark and seek handlers.

* subversion/libsvn_subr/subst.c

(translated_stream_reset): Remove function. Move code into ...

(translated_stream_seek): ... this function.

(svn_subst_stream_translated): Don't set reset function.

  1. … 3 more files in changeset.
Revert additional pool lifetime requirements introduced in r937275.

* subversion/include/svn_subst.h,


(svn_subst_stream_translated): Copy EOL_STR and KEYWORDS into

RESULT_POOL to make sure they have sufficient lifetime, and remove

pool lifetime restrictions for EOL_STR and KEYWORDS from docstring.

Suggested by: julianfoad


  1. … 1 more file in changeset.
A little simplification.

* subversion/libsvn_subr/subst.c

(translated_stream_mark): Use apr_pmemdup() instead of alloc and copy.

Deprecate svn_subst_copy_and_translate3() in favor of a version that has a

cancellation function.

* subversion/include/svn_subst.h:

(svn_subst_copy_and_translate4): new function, like the translate3

version, but with CANCEL_FUNC/BATON.

(svn_subst_copy_and_translate3): mark as deprecated

* subversion/libsvn_subr/subst.c:

(detranslate_special_file): take a CANCEL_FUNC/BATON param pair and pass

it along to svn_stream_copy3(). add an svn_error_return

(svn_subst_copy_and_translate3): renamed to ...

(svn_subst_copy_and_translate4): ... this, and take a CANCEL_FUNC/BATON

pair. pass CANCEL_FUNC/BATON to detranslate_special_file and


* subversion/libsvn_subr/deprecated.c:

(svn_subst_copy_and_translate3): new. call svn_subst_copy_and_translate4


(...): add some svn_error_return love

  1. … 2 more files in changeset.
* subversion/libsvn_subr/subst.c:

(translated_stream_close): get rid of the baton's iterpool

Pool usage fixes in the translation stream.

Do not maintain a private pool for each translation stream,

because the user cannot control unbound growth of this "secret" pool.

Instead, rely on callers to provide pools with sufficient lifetime

when the stream is created. "make check" agrees.

Suggested by: gstein

* subversion/include/svn_subst.h

(svn_subst_stream_translated): Rename POOL argument to RESULT_POOL.

Document pool lifetime requirements for EOL_STR and KEYWORDS parameters.

* subversion/libsvn_subr/subst.c

(dup_translation_baton): Remove. This was short enough not to be worth

a separate function.

(translated_stream_baton): Define macro SVN__TRANSLATION_BUF_SIZE for

size of BUF member. Remove POOL member.

(translated_stream_read): Remove local variable ITERPOOL, which was just

an alias for B->iterpool, which use directly.

(translated_stream_close): Stream-private pool was removed so stop

destroying it.

(translated_stream_mark): Track removal of dup_translation_baton() and

re-implement it inline where needed. Use SVN__TRANSLATION_BUF_SIZE.

(translated_stream_seek): Avoid re-allocations while restoring translation


(svn_subst_stream_translated): Rename POOL to RESULT_POOL. Stop copying

things into the stream-private pool, rely on the caller to provide items

with sufficient lifetime instead. Use SVN__TRANSLATION_BUF_SIZE.

  1. … 1 more file in changeset.
Digest feedback by gstein for r936844.

* subversion/libsvn_subr/subst.c

(keywords_hash_deep_copy): Remove. No longer needed as per change below.

(dup_translation_baton): Don't make a deep copy of keywords, since they

have at last the same lifetime as the translated stream.

(mark_translated_t): Rather than storing a pointer to the saved baton,

use a nested struct. Saves an allocation and some dereferencing.

(translated_stream_mark, translated_stream_seek): Rename MARK_TRANSLATED

to just MT for readability. Track above change in mark_translated_t.

(svn_subst_stream_translated): Restore the body of keywords_hash_deep_copy()

here. It's not used elsewhere anymore so there is no point in having a

separate function.

* subversion/libsvn_subr/subst.c

(keywords_hash_deep_copy): Un-constify the KEYWORDS parameter again.

As the compiler noted, we need to pass this on in non-const form.

Hopefully fix issue #3616, "Mark/seek in svn_subst_stream_translated() -

needs to restore translation state"

"Hopefully" because an apparent bug in the translation stream prevents

a new test which attempts to verify the fix from passing.

* subversion/libsvn_subr/subst.c

(keywords_hash_deep_copy, dup_translation_baton): New helper functions.

(mark_translated_t): New type.

(translated_stream_mark, translated_stream_seek): Save translation state

upon mark, and restore it upon seek.

(svn_subst_stream_translated): Drive-by comment fix, and call the new

keywords_hash_deep_copy() helper which is based on code which used to

live here.

* subversion/tests/libsvn_subr/stream-test.c

(): Include svn_subst.h.

(test_funcs): Add new test.

(test_stream_seek_translated): New test. Currently XFail because of

aforementioned bug, which was discussed on IRC as follows:

<stsp> svn_subst_stream_translated() does not expand keywords if

they're not read in their entirety by the caller

<stsp> is that a bug?

<stsp> i would expect that, if I have the input containing a keyword

such as One$MyKeyword$Two, which expands to "my keyword expanded",

and I read up to the position of the character K, the result would

be "Onemy"

<stsp> but what is actually returned from svn_stream_read is One$My

<stsp> that makes setting a mark within a keyword rather pointless

<julianf> stsp: ew, that's an ugly bug in stream_translated.

<julianf> That's just waiting to blow up.

<stsp> julianf, yeah I think it should read ahead, expand the keyword,

and return part of the expansion

<julianf> +1

Review by: julianfoad


  1. … 1 more file in changeset.
Optimize the search for 'interesting' characters that control the

keyword substitution.

* subversion/libsvn_subr/subst.c

(translation_baton): The 'interesting' member is now a boolean array.

(create_translation_baton): Adapt initialization code.

(translate_chunk): Eliminate call to strchr.

Patch by: stefanfuhrmann < at >

Speed up input stream processing in config parser and others that read

single bytes from a stream.

* subversion/libsvn_subr/subst.c

(translated_stream_read): Add an optimized code path for single byte read


Patch by: Stefan Fuhrmann <stefanfuhrmann{_AT_}>

* subversion/libsvn_subr/subst.c

(translated_stream_read, translated_stream_write, translated_stream_close,

translated_stream_reset, translated_stream_mark, translated_stream_seek):

Add simple doc strings.

Make svn patch contract keywords on input and expand them on output.

Keywords do not interfere with the patching process anymore, and are

expanded in the patched result. Also, write the correct EOL-style

to the patched result if an svn:eol-style property is set on the target.

* subversion/include/svn_subst.h

(svn_subst_stream_translated): Document support for mark/seek feature.

* subversion/libsvn_client/patch.c

(): Include svn_props.h.

(patch_target_t): Fix error in comment. New fields KEYWORDS and EOL_STYLE.

(init_patch_target): Evaluate svn:keywords and svn:eol-style. Correctly

create the translation streams for patched result and reject file.

Move everything which needs to be done if the target already exists

into the same if-block.

(read_line): Return a plain const char * rather than a stringbuf.

Contract keywords after reading the line (wrapping a translation stream

around a stream reading from a range of a file interferes with

EOF-detection in svn_stream_readline(), so we need to contract keywords

manually -- I know this sounds really wrong but it's not trivial for me

to fix).

(seek_to_line, copy_lines_to_target): Track read_line() parameter change.

(match_hunk): As previous, but also contract keywords after reading

a line from the patch file in case the patch contains expanded keywords.

(scan_for_match): Constify a pointer. Don't allow rejected hunks to

block another hunk from matching (not that they did, but it's nice to

be explicit about it).

(get_hunk_info): Improve a comment.

* subversion/libsvn_subr/subst.c

(translated_stream_mark, translated_stream_seek): New.

(svn_subst_stream_translated): Set mark and seek handlers.

* subversion/tests/cmdline/

(patch_unidiff_keywords): New test. Tests patch application where the

target contains expanded keywords but the patch does not ('svn diff'

contracts keywords so this should be the common case).

(test_list): Add new test.

  1. … 3 more files in changeset.
Test out my new and fancy ASF commit priviledges by changing the copyright

wording in our license headers to reflect ownership by the ASF.


Change terminology to ASF, and update a link.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the ASF, and update the project website.

* everywhere:

Change license text to reflect ASF ownership.

  1. … 891 more files in changeset.
* subversion/libsvn_subr/subst.c

(svn_subst_copy_and_translate3): Wrap a few errors.

Scrub trailing whitespace throughout (see r35894).

  1. … 146 more files in changeset.
Typo fixes.

* notes/object-model.txt

(Guidelines): Subverion → Subversion

* subversion/libsvn_fs_base/bdb/txn-table.h

Suversion → Subversion

* subversion/libsvn_subr/subst.c

substition → substitution

* subversion/tests/libsvn_subr/error-test.c

(test_error_root_cause): teh → the

* www/links.html

(Suafe): Subverion → Subversion

* www/svn_1.6_releasenotes.html

(sparse-directory-exclusion): Subvesion → Subversion

* www/testimonials.html

TortiseSVN → TortoiseSVN

  1. … 6 more files in changeset.
Make our eol and keyword translation stream resetable if the inner

stream also supports resetting.

* subversion/include/svn_subst.h

(svn_subst_stream_translated): Update documentation.

* subversion/libsvn_subr/subst.c

(translated_stream_reset): New function.

(svn_subst_stream_translated): Register reset handler.

  1. … 1 more file in changeset.
Fix more "implicit conversion shortens 64-bit value into a 32-bit value"

warnings via casts changing variable types. Also remove a couple of pointless


* subversion/libsvn_subr/subst.c


* subversion/libsvn_subr/utf.c


* subversion/libsvn_subr/opt.c

(svn_opt_parse_path, svn_opt__split_arg_at_peg_revision),

* subversion/libsvn_subr/dirent_uri.c


* subversion/libsvn_subr/io.c

(svn_io_read_link, svn_io_detect_mimetype2),

* subversion/libsvn_subr/mergeinfo.c


* subversion/libsvn_subr/path.c


* subversion/libsvn_delta/svndiff.c


Update variable types.

* subversion/libsvn_subr/sqlite.c


* subversion/libsvn_subr/macos_keychain.c

(keychain_password_set, keychain_password_get)

Add an explicit cast.

* subversion/libsvn_subr/io.c

(cstring_to_utf8, cstring_from_utf8): Remove unused statements.

  1. … 9 more files in changeset.
Move functions concerned with EOL parsing from libsvn_subr/subst.c

to libsvn_subr/eol.c. This allows further consolidation of code

concerned with EOL-parsing instead of being all over the place.

Note that functions concerned with the svn:eol-style property are not

affected by this change.

[ Note from the future: The change to build.conf was accidentally not

committed, and was instead committed in r38984. ]

* build.conf:

(subst-test): Rename to ...

(eol-test): ... this.

(__ALL_TESTS__): Track renamed test.

(msvc-export): Add private\svn_eol_private.h.

* subversion/include/private/svn_eol_private.h: New.

* subversion/libsvn_subr/subst.c,


(svn_subst_find_eol_start, svn_subst_detect_eol,

svn_subst_detect_file_eol): Move these functions from here ...

* subversion/libsvn_subr/eol.c,


(svn_eol_find_eol_start, svn_eol_detect_eol,

svn_eol_detect_file_eol): ... to these new files and rename them.

* subversion/libsvn_client/patch.c,

subversion/libsvn_diff/diff-file.c: Track renamed functions.

* subversion/tests/libsvn_subr/subst-test.c: Rename to ...

* subversion/tests/libsvn_subr/eol-test.c: ... this, and track renamed


Patch by: Edmund Wong <ed{_AT_}>

Suggested by: stsp

  1. … 7 more files in changeset.
Relicense Subversion under the Apache License, Version 2.0.

* NOTICE: New.



subversion/LICENSE: Remove.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the SVN Corp, and that it contains contributions from

many people, as referenced in NOTICE.

* subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS:

Relicense the SVN parts under Apache 2.0.

* everywhere:

Change copyright notices in file headers to reflect the Apache 2.0 license.

  1. … 882 more files in changeset.