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

Changeset 1467236 is being indexed.

Followup to r1467230.

* subversion/libsvn_subr/subst.c

(translate_keyword_subst): Adjust test as well as assignment.

Found by: rhuijben

Fix issue 4349, truncated keyword re-expansion.

* subversion/libsvn_subr/subst.c

(translate_keyword_subst): Take account of keyword length.

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

(test_funcs): Mark test_svn_subst_truncated_keywords PASS.

  1. … 1 more file in changeset.
* **/**

Run tools/dev/ to remove all trailing whitespace

before we branch 1.8, like we did before creating previous branches.

No functional changes.

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

(svn_subst_build_keywords): Move deprecated function ...

* subversion/libsvn_subr/deprecated.c

(svn_subst_build_keywords): ... here.

  1. … 1 more file in changeset.
Add two additional custom keyword format codes which are used by FreeBSD.

%H - Equivalent to %P%_%r%_%d%_%a.

%I - Equivalent to %b%_%r%_%d%_%a.

With this, keyword expansion works as expected with using

a stock Subversion client, rather than requiring a patched client.

These two codes are already in use at and were part of the

originally submitted patch. I'd rather add support for these format codes

to Subversion than require FreeBSD to change its svn:keywords properties

throughout their repository history.

But I'm not sure whether adding additional alias format codes is a good

idea in general, so please don't regard this as a carte blanche for

everyone else to get their favorite format code aliases into the

Subversion code base.

* subversion/include/svn_subst.h

(svn_subst_build_keywords3): Document support for %H and %I format codes.

* subversion/libsvn_subr/subst.c

(keyword_printf): Implement support for %H and %I format codes.

* subversion/svn/svn.c

(svn_cl__cmd_table): Document support for %H and %I in 'svn help propset'.

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

(test_svn_subst_build_keywords3): Expand test to cover %H and %I.

  1. … 3 more files in changeset.
Following up on r1466570, avoid doing unneeded work in a few common code paths.

* subversion/libsvn_client/cat.c

(svn_client__get_normalized_stream): Use svn_wc__node_get_repos_info to

obtain the url and the repository root.

* subversion/libsvn_subr/subst.c

(keyword_printf): Just check against the empty string (=normalized form)

instead of complete url check.

* subversion/libsvn_wc/translate.c

(svn_wc__expand_keywords): Don't fetch the repository root url when just

normalizing to the repository normal form.

  1. … 2 more files in changeset.
Add support for custom keyword definitions, fixing issue #890.

Custom keywords can be defined using a format string which controls

the way keyword information is expanded. For instance, a keyword set

the command 'svn propset svn:keywords MyKeyword=%a%_%b%_%d myfile'

can be referenced in 'myfile' as $MyKeyword$, and expands to the author,

a space, the file's name ('myfile'), another space, and the short

representation of the date of the last-changed revision.

The following format codes are currently available:

%a - The author.

%b - The basename of the URL.

%d - Short format of the date.

%D - Long format of the date.

%P - The file's path, relative to the repository root URL.

%r - The revision.

%R - The URL to the root of the repository.

%u - The URL of the file.

%_ - A space (keyword definitions cannot contain a literal space).

%% - A literal '%'.

Most of these were already defined internally in libsvn_subr.

This patch adds the %P, %R, and %_ format codes.

More format codes could be added in the future but might require API changes.

Based on a patch submitted several times by various FreeBSD developers

who have added this feature to their port of Subversion.

I'm crediting those who I know were involved in this patch in one way

or another. But I don't know for sure who wrote the initial implementation.

Patch by: Peter Wemm <peter{_AT_}>

David O'Brien <obrien{_AT_}>

Lev A. Serebryakov <lev{_AT_}>

Alfred Perlstein <alfred{_AT_}>


* subversion/include/svn_subst.h

(svn_subst_build_keywords3): Declare.

(svn_subst_build_keywords2): Deprecate.

* subversion/libsvn_client/cat.c

(svn_client__get_normalized_stream): Call svn_subst_build_keywords3().

* subversion/libsvn_client/export.c

(export_node, close_file): Call svn_subst_build_keywords3().

* subversion/libsvn_client/import.c

(send_file_contents): Call svn_subst_build_keywords3().

* subversion/libsvn_subr/subst.c

(keyword_printf): Add support for %P, %R, and %_. Add repos_root_url

parameter which is required to implement these new format codes.

(build_keywords): New helper function which implements the guts of

svn_subst_build_keywords2() and svn_subst_build_keywords3().

(svn_subst_build_keywords2): Reimplement as wrapper around build_keywords().

Turn off support for custom keywords to ensure backwards compatibility.

(svn_subst_build_keywords3): New, implemented as wrapper around the

build_keywords() helper. Enable support for custom keywords.

* subversion/libsvn_wc/translate.c

(svn_wc__expand_keywords): Call svn_subst_build_keywords3().

* subversion/svn/svn.c

(svn_cl__cmd_table): Document the custom keywords feature, including the

support format codes, in the output of 'svn help propset'.

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

(test_svn_subst_build_keywords3): New test.

(test_funcs): Add new test.

  1. … 7 more files in changeset.
Use svn_hash_gets and svn_hash_sets.

* subversion/libsvn_subr/auth.c

* subversion/libsvn_subr/cmdline.c

* subversion/libsvn_subr/compat.c

* subversion/libsvn_subr/config.c

* subversion/libsvn_subr/config_auth.c

* subversion/libsvn_subr/deprecated.c

* subversion/libsvn_subr/dso.c

* subversion/libsvn_subr/hash.c

* subversion/libsvn_subr/io.c

* subversion/libsvn_subr/mergeinfo.c

* subversion/libsvn_subr/opt.c

* subversion/libsvn_subr/properties.c

* subversion/libsvn_subr/simple_providers.c

* subversion/libsvn_subr/ssl_client_cert_providers.c

* subversion/libsvn_subr/ssl_client_cert_pw_providers.c

* subversion/libsvn_subr/ssl_server_trust_providers.c

* subversion/libsvn_subr/subst.c

* subversion/libsvn_subr/types.c

* subversion/libsvn_subr/username_providers.c

* subversion/libsvn_subr/utf.c

* subversion/libsvn_subr/win32_crypto.c

* subversion/libsvn_subr/xml.c

  1. … 21 more files in changeset.
Address issue #4331, "working copy permissions change on commit for files

with keywords" by preventing the accidental removal of existing permission

bits set on files which undergo translation.

This is not a perfect answer to the proposition given in the issue that

"Committing a file should not change its permissions in the WC."

Committed files may still get a new owner/group/other write bit set if

the umask allows this and the file's properties indicate that the file must

be set read-write (see svn_wc__sync_flags_with_props() which might tweak

permission bits of the translated file). But I think this is acceptable.

I'm not sure if never changing the permission bits of committed files is

a realistic requirement. Changing this would require additional effort

and might break other scenarios.

* subversion/libsvn_subr/subst.c

(svn_subst_copy_and_translate4): Copy file permissions from the source file

to the temporary file which stores the translated result. The temporary

file might have stricter permissions than the source, due to the way

our APIs for creating temporary files work. Removing permission bits from

files during translation is an unwanted side effect and should be avoided.

Coding style patch: in logical expressions, instead of comparing

with arithmetic constants use boolean operations. I.e. replace

<expr> == TRUE with <expr> and

<expr> == FALSE with !<expr>

* subversion/libsvn_delta/svndiff.c


window_handler): change condition style

* subversion/libsvn_fs_base/fs.c

(svn_fs_base__clean_logs): ditto

* subversion/libsvn_fs_fs/fs_fs.c



build_rep_list): ditto

* subversion/libsvn_ra_serf/locks.c

(handle_lock): ditto

* subversion/libsvn_ra_serf/property.c

(create_propfind_body): same here,

* subversion/libsvn_ra_serf/update.c




finish_report): here,

* subversion/libsvn_ra_serf/util.c

(svn_ra_serf__handle_xml_parser): here,

* subversion/libsvn_ra_svn/client.c

(optbool_to_tristate): here,

* subversion/libsvn_repos/authz.c

(authz_parse_section): and here.

* subversion/libsvn_repos/fs-wrap.c

(svn_repos__validate_prop): here as well

* subversion/libsvn_subr/cmdline.c

(svn_cmdline_create_auth_baton): and here

* subversion/libsvn_subr/deprecated.c

(print_command_info): here

* subversion/libsvn_subr/opt.c

(print_command_info2): more of the same

* subversion/libsvn_subr/subst.c

(translate_chunk): ditto

* subversion/libsvn_subr/win32_crashrpt.c


svn__unhandled_exception_filter): ditto

* subversion/svn/svn.c

(sub_main): ditto

* subversion/svnsync/svnsync.c

(filter_props): and more of the

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

(test_readonly): same thing

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

(test21): ditto

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

(test_svn_subst_translate_string2_null_encode): here

* subversion/tests/libsvn_wc/db-test.c


test_working_info): and here

* tools/client-side/svn-bench/svn-bench.c

(sub_main): and finally here

  1. … 21 more files in changeset.
Minor optimisation.

* subversion/libsvn_subr/subst.c


* subversion/libsvn_repos/fs-wrap.c



  1. … 1 more file in changeset.
Reintegrate integrate-string-improvements branch into /trunk.
  1. … 83 more files in changeset.
And resolve another open file handle problem: Translated streams are not closed

when an error occurs in the final translate. This makes us delete an open file

in svn_subst_copy_and_translate4.

* subversion/libsvn_subr/subst.c

(translated_stream_close): Close inner stream and destroy subpool on errors.

Followup to r1140505. Fix indentation.

* [everywhere]: Fix indentation fallout from the

svn_error_return() -> svn_error_trace() rename.

Patch by: Noorul Islam K M <noorul{_AT_}>

  1. … 37 more files in changeset.
Rename the 'svn_error_return' macro to 'svn_error_trace'.

See email thread "[RFC] Rename 'svn_error_return' to 'svn_error_trace'?" on

2011-06-23, <>.

* subversion/include/svn_error.h

(svn_error_return): Rename to svn_error_trace.

(SVN_ERR, svn_error_purge_tracing): Track the rename.

* [everywhere]: Track the rename.

  1. … 120 more files in changeset.
After some discussion on IRC, rename svn_string_from_stringbuf to

svn_stringbuf__morph_into_string and move it to a private header.

* include/private/svn_string_private.h

new header

(svn_stringbuf__morph_into_string): renamed from svn_string_from_stringbuf

* include/svn_string.h

(svn_string_from_stringbuf): remove from public header

* subversion/libsvn_subr/svn_string.c

(svn_stringbuf__morph_into_string): rename implementation

* subversion/libsvn_client/patch.c

(install_patched_prop_targets): use the renamed function

* subversion/libsvn_ra_svn/marshal.c

(read_string): dito

* subversion/libsvn_repos/hooks.c

(run_hook_cmd, lock_token_content): dito

* subversion/libsvn_subr/mergeinfo.c

(svn_rangelist_to_string, svn_mergeinfo_to_string,


svn_mergeinfo__to_formatted_string): dito

* subversion/libsvn_subr/subst.c

(keyword_printf): dito

* subversion/libsvn_subr/utf.c

(svn_utf_string_to_utf8, svn_utf_string_from_utf8): and here

* subversion/libsvn_wc/props.c

(maybe_generate_propconflict, svn_wc_canonicalize_svn_prop): here

* subversion/svn/util.c:

(svn_cl__edit_string_externally): and finally here

  1. … 10 more files in changeset.
Make svn_stream_is_buffered() and related symbols private, renaming to

svn_stream__* and moving to svn_io_private.h.

* subversion/include/svn_io.h

(svn_stream_is_buffered_fn_t, svn_stream_set_is_buffered,

svn_stream_is_buffered): Move and rename from here ...

* subversion/include/private/svn_io_private.h

(svn_stream__is_buffered_fn_t, svn_stream__set_is_buffered,

svn_stream__is_buffered): ... to here.

* subversion/libsvn_subr/stream.c

(svn_stream_set_is_buffered, svn_stream_is_buffered): Rename as above.

(svn_stream_t, stream_readline, svn_stream_empty,

is_buffered_handler_disown, svn_stream_disown, svn_stream_from_aprfile2,

svn_stream_from_stringbuf, svn_stream_from_string): Adjust accordingly.

* subversion/libsvn_subr/subst.c

(translated_stream_is_buffered, stream_translated): Adjust accordingly.

  1. … 3 more files in changeset.
Replace calls to svn_string_create_from_buf with the much cheaper

svn_string_from_stringbuf. This is possible in all places where

source and target objects are expected to reside in the same pool

and the source will not be used after the conversion call.

* subversion/libsvn_client/patch.c

(install_patched_prop_targets): replace here

* subversion/libsvn_repos/hooks.c

(run_hook_cmd, lock_token_content): dito

* subversion/libsvn_subr/mergeinfo.c

(svn_rangelist_to_string, svn_mergeinfo_to_string,


svn_mergeinfo__to_formatted_string): dito

* subversion/libsvn_subr/subst.c

(keyword_printf): dito

* subversion/libsvn_subr/utf.c

(svn_utf_string_to_utf8, svn_utf_string_from_utf8): and here

* subversion/libsvn_wc/props.c

(maybe_generate_propconflict, svn_wc_canonicalize_svn_prop): here

* subversion/svn/util.c:

(svn_cl__edit_string_externally): and finally here

  1. … 6 more files in changeset.
Rename all new public stream symbols to start with 'svn_stream_' so that all

of the stream symbols are in the same name space except for some old ones

such as 'svn_read_fn_t'. Some or all of these might soon be renamed again

to make them private, but that is a separate issue.

* subversion/include/svn_io.h,


(svn_skip_fn_t): Rename to svn_stream_skip_fn_t.

(svn_io_mark_fn_t): Rename to svn_stream_mark_fn_t.

(svn_io_seek_fn_t): Rename to svn_stream_seek_fn_t.

(svn_io_is_buffered_fn_t): Rename to svn_stream_is_buffered_fn_t.

(svn_stream_t, svn_stream_set_skip, svn_stream_set_mark,

svn_stream_set_seek, svn_stream_set_is_buffered): Adjust uses of the same.

* subversion/libsvn_subr/subst.c

(translated_stream_mark, translated_stream_seek,

translated_stream_is_buffered): Adjust doc strings.

  1. … 2 more files in changeset.
Let the 'translated stream' implementation use the default skip handler instead

of providing its own copy of that handler. A follow-up to r1130490.

* subversion/libsvn_subr/subst.c

(translated_stream_skip): Remove.

(stream_translated): Don't install a skip handler.

Rename svn_stream_buffered() and related symbols to ...is_buffered... for


* subversion/include/svn_io.h

(svn_io_buffered_fn_t): Rename to svn_io_is_buffered_fn_t.

(svn_stream_set_buffered): Rename to svn_stream_set_is_buffered.

(svn_stream_buffered): Rename to svn_stream_is_buffered.

* subversion/libsvn_subr/stream.c

(svn_stream_t): Rename 'buffered_fn' to 'is_buffered_fn'.

(svn_stream_set_buffered): Rename to svn_stream_set_is_buffered.

(svn_stream_buffered): Rename to svn_stream_is_buffered.

(svn_stream_create, stream_readline, svn_stream_empty,

buffered_handler_disown, svn_stream_disown, svn_stream_from_aprfile2,

svn_stream_from_stringbuf, svn_stream_from_string): Update calls.

* subversion/libsvn_subr/subst.c

(translated_stream_buffered): Rename to translated_stream_is_buffered.

(stream_translated): Update calls.

  1. … 2 more files in changeset.
This minor change to translate_chunk() reduces the checkout time of

^/subversion/trunk/subversion in my profiler by about 1% for me. If this

has the same result on production code then this patch will probably safe

quite a few trees.

This part of the code was imported from stefan2's performance branch. More

profiling results (especially from stefan2) welcome.

* subversion/libsvn_subr/subst.c

(translate_chunk): Lose temporary variable and use boolean operators

instead of bitwise.

Merge all changes (r1068695 - r1072516) from the


These patches add svn_stream_skip(), svn_stream_buffered()

and svn_stream_supports_mark().

  1. … 4 more files in changeset.
Constify svn_io_seek_fn_t and svn_stream_seek().

* subversion/include/svn_io.h



Constify the input svn_stream_mark_t * argument.

* subversion/libsvn_subr/stream.c





Constify the input svn_stream_mark_t * argument.

* subversion/libsvn_subr/subst.c


Constify the input svn_stream_mark_t * argument.

  1. … 2 more files in changeset.
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.