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

Changeset 1478826 is being indexed.

Implement a new 'diff-ignore-content-type' runtime configuration

variable which saves folks from having to include --force when trying

to see differences of binary files. This is handy when Subversion is

configured via 'diff-cmd' to use an external diff tool that can handle

binary diffs.

NOTE: This option is parsed in 'svn' (not down in the client layer)

and used to control an existing boolean function parameter.

* subversion/include/svn_config.h


token #define.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Check the runtime configuration area to see if diff

operations should ignore the content-type of files.

* subversion/libsvn_subr/config_file.c

(svn_config_ensure): Add runtime configuration file template matter

for the new 'diff-ignore-content-type' option.

* subversion/tests/cmdline/

(diff_force): Tweak this test to try the new runtime config option

as well as '--force', verifying that both allow the display of

binary diffs.


Note this change.

  1. … 4 more files in changeset.
Make 'svn diff --old=FOO --new=BAR' default to WORKING revision rather than

BASE for the old target if the new target is explicitly specified, so that

it is the reverse of the diff from 'svn diff --old=BAR --new=FOO'.

Patch by: Alexey Neyman <stilor{_AT_}>

* subversion/svn/diff-cmd.c

(svn_cl__diff): Change defaults as described and simplify the logic.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Simplify a tiny bit more, following r1442659.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Simplify logic introduced in r1442640.

Tell people who pass mixed target types to 'svn diff' synopsis 1 that they

are probably looking for one of the '--old X --new Y' invocations.

Suggested by: Alexey Neyman

* subversion/svn/diff-cmd.c

(svn_cl__diff): Wrap the error from svn_cl__assert_homogeneous_target_type()

with a somewhat verbose but informative message.

Make 'svn diff PATH URL' and 'svn diff URL PATH', where exactly two targets

are given and one target is a URL, a new shorthand invocation syntax for

'svn diff --old PATH --new URL' and 'svn diff --old URL --new PATH',


These invocations used to error out with a "cannot mix repository and working

copy targets" before. User may intuitively try to diff a working copy to a URL

in the manner allowed by these new shorthands, so this is a usability

enhancement (principle of least surprise).

Suggested by: Alexey Neyman

* subversion/svn/diff-cmd.c

(svn_cl__diff): Map a 2-target diff invocation where one target is a URL and

the other target is a path to 'svn diff --old TARGET1 --new TARGET2'.

* subversion/svn/svn.c

(svn_cl__cmd_table): Update 'svn help diff' output accordingly.

  1. … 1 more file in changeset.
To finally close issue #3009, and for similarity with 'svnlook diff', add a

--no-diff-added output filtering argument to 'svn diff'.

* subversion/include/svn_client.h


svn_client_diff_peg6): Update arguments.

* subversion/libsvn_client/deprecated.c


svn_client_diff_peg5): Update caller.

* subversion/libsvn_client/diff.c

(diff_cmd_baton): Add variable.

(diff_file_added): Filter diff if requested.


svn_client_diff_peg6): Set value in baton.

* subversion/svn/cl.h

(svn_cl__opt_state_t.diff): Add variable.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Update caller.

* subversion/svn/log-cmd.c

(svn_cl__log): Update caller.

* subversion/svn/svn.c

(svn_cl__longopt_t): Add value.

(svn_cl__options): Add argument.

(svn_cl__cmd_table): Declare --no-diff-added for diff.

(sub_main): Parse argument.

  1. … 6 more files in changeset.
Use the --old path in the diffs produced by the arbitrary diff handler,

just like when using --old with the other diff implementations.

This resolves a crash when running

$ svn diff --old dev/README --new dev/build.conf --summarize

* subversion/libsvn_client/diff.c

(do_diff_summarize): Provide the right target to the summarize handler.

* subversion/libsvn_client/diff_local.c

(arbitrary_diff_walker): Use api to detect administrative dir correctly.

(svn_client__arbitrary_nodes_diff): Use path1 as target.

* subversion/svn/diff-cmd.c

(summarize_baton_t): New baton type.


summarize_regular): Use baton type.

(svn_cl__diff): Update caller.

* subversion/tests/cmdline/

(diff_url_against_local_mods): Extend test to show that in this mode we

see this as a no change.

(diff_arbitrary_files_and_dirs): Update expected result.

  1. … 3 more files in changeset.
Make the new in 1.8 arbritary node diff just another driver of the diff

callback api instead of using internal diff apis to produce some nice output.

This allows reusing this walker for features like the --summarize support.

* subversion/include/private/svn_client_private.h

(svn_client__arbitrary_nodes_diff): New function.

* subversion/libsvn_client/diff.c







do_arbitrary_nodes_diff): Move to diff_local.c

(diff_wc_wc): Remove the arbritrary diff detection from here to ...

(do_diff): ... its caller, here. Trigger behavior from working-working

revision instead of overloading base-working diff in diff_wc_wc.

Reinstate the check for unsupported specific revisions from <= 1.7

in diff_wc_wc, instead of always running the arbritrary diff.

* subversion/libsvn_client/diff_local.c

New file, based on diff.c

(do_arbitrary_files_diff): Remove ignore properties and force binary code.

This is handled by the diff callbacks.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Request working working diff.

  1. … 3 more files in changeset.
Group all the command-line options that are specific to 'diff' together in

the 'svn' command-line client code, for clarity. No functional change.

* subversion/svn/cl.h

(svn_cl__opt_state_t): Move all diff-specific options into a sub-struct.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Adjust references to refer to the sub-struct.

* subversion/svn/log-cmd.c

(svn_cl__log): Same.

* subversion/svn/main.c

(svn_cl__longopt_t, svn_cl__options): Group diff options together.

(main): Adjust references to refer to the sub-struct.

  1. … 3 more files in changeset.
Add a new --properties-only option to 'svn diff' to show only property changes.

This is the inverse of --ignore-properties. The two options are mutually


* subversion/svn/diff-cmd.c

(svn_cl__diff): Pass the properties_only option to the client layer.

* subversion/svn/main.c

(svn_cl__longopt_t, svn_cl__options, svn_cl__cmd_table): Add a new

--properties-only option. The internal flag is called opt_properties_only".

* subversion/svn/log-cmd.c

(log_entry_receiver): When showing diffs, set properties_only to FALSE.

* subversion/svn/cl.h

(svn_cl__opt_state_t): New properties_only option.

* subversion/libsvn_client/diff.c

(diff_cmd_baton): Add properties_only flag.

(diff_content_changed): Do nothing if properties_only is set.

(svn_client_diff6, svn_client_diff_peg6): New properties_only parameter.

Raise an error if both ignore_properties and properties_only are set.

* subversion/libsvn_client/deprecated.c

(svn_client_diff5, svn_client_diff_peg5): Pass FALSE for properties_only.

* subversion/include/svn_client.h

(svn_client_diff6, svn_client_diff_peg6): Update declarations and docstring.

  1. … 6 more files in changeset.
Rename the use_patch_diff_format variable in the 'svn' client code to

patch_compatible. The new name matches the corresponding command line option.

No functional change.

* subversion/svn/main.c

(svn_cl__longopt_t, svn_cl__options, svn_cl__cmd_table, main): Rename

use_patch_diff_format to patch_compatible.

* subversion/svn/cl.h

(svn_cl__opt_state_t): Rename use_patch_diff_format to patch_compatible.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Track above rename.

  1. … 2 more files in changeset.
Rename ignore_prop_diff and ignore_props variables in the 'svn' client

code to ignore_properties. The new name matches the corresponding command

line option.

No functional change.

* subversion/svn/main.c

(svn_cl__longopt_t, svn_cl__options, svn_cl__cmd_table, main): Rename

opt_ignore_props to opt_ignore_properties.

* subversion/svn/cl.h

(svn_cl__opt_state_t): Rename ignore_props to ignore_properties.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Track above rename, and rename the local variable

ignore_prop_diff to ignore_properties.

  1. … 2 more files in changeset.
Prevent out-of-bounds array access during 'svn diff' arguments processing.

* subversion/svn/diff-cmd.c

(svn_cl__diff): In the 'svn diff --old X --new Y' case, the parsed target

array might contain less than 2 targets if X and/or Y were skipped by

svn_cl__args_to_target_array_print_reserved(), e.g. because either or

both X and Y were .svn directories. Add a check that ensures we got

at least two targets -- any additional arguments are interpreted as

relative to X and Y (as explained by 'svn help diff').

Rename the new --no-diff-properties option to --ignore-properties.

This allows the option to be re-used by other subcommands in the future.

Suggested by: hwright

* subversion/svn/cl.h

(svn_cl__opt_state_t): Rename no_diff_props to ignore_props.

* subversion/svn/main.c

(svn_cl__longopt_t, svn_cl__cmd_table): Rename opt_no_diff_props to


(svn_cl__options): Rename --no-diff-properties to --ignore-properties

and update a reference to the old name in the help text of 'svn diff'.

(main): Track renamed fields.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Track renamed fields.

  1. … 2 more files in changeset.
Add --no-diff-properties and --patch options to 'svn diff'.

The --patch option implies --no-diff-properties and --show-copies-as-adds.

These options are useful when creating patches for consumers that

do not understand or do not care about Subversion properties.

Patch by: Alexey Neyman <>

* subversion/svn/cl.h

* subversion/svn/main.c

New options, --no-diff-properties and --patch for svn diff.

* subversion/include/svn_client.h

(svn_client_diff6,svn_client_diff_peg6): New argument, ignore_prop_diff.

(svn_client_diff5,svn_client_diff_peg5): Update comments.

* subversion/libsvn_client/deprecated.c

(svn_client_diff5,svn_client_diff_peg5): Pass FALSE as ignore_prop_diff.

* subversion/libsvn_client/diff.c

(diff_cmd_baton): New field, ignore_prop_diff.

(diff_props_changed): Do nothing if diff_cmd_baton->ignore_prop_diff is set.

(svn_client_diff6,svn_client_diff_peg6): Pass ignore_prop_diff downstream

via diff_cmd_baton.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Handle --patch and --no-diff-properties.

* subversion/svn/log-cmd.c

(log_entry_receiver): Request property changes from svn_client_diff6.

  1. … 6 more files in changeset.
Reintegrate integrate-string-improvements branch into /trunk.
  1. … 83 more files in changeset.
* subversion/svn/diff-cmd.c

(svn_cl__diff): Remove an unused variable and update a comment, following


Make the client diff output streamy, rather than requiring an APR file.

(Our own consumer of this API just uses stdout, so this doesn't have much

effect there.)

* subversion/include/svn_client.h

(svn_client_diff6): New.

(svn_client_diff5): Deprecate.

(svn_client_diff_peg6): New.

(svn_client_diff_peg5): Deprecate.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Update callers.

* subversion/libsvn_client/deprecated.c

(svn_client_diff5, svn_client_diff_peg5): New deprecation wrappers.

* subversion/libsvn_client/diff.c

(file_printf_from_utf8): Remove.

(display_mergeinfo_diff, display_prop_diffs): Accept and use a stream

instead of a file.

(diff_cmd_baton): Change file handles to streams.

(diff_content_changed): Use streams, and create a temp file for interfacing

with an external diff tool.

(diff_file_deleted): Update params.

(svn_client_diff6): Renamed and updated from svn_client_diff5().

(svn_client_diff_peg6): Renamed and updated from svn_client_diff_peg5().

  1. … 3 more files in changeset.
The semi-annual trailing whitespace cleansing ritual.

* 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. … 144 more files in changeset.
Fix issue #3702 'Unable to perform case-only rename on windows' by adding a

new flag to svn_client_args_to_target_array (revving it in the process), so

it can perform specialized case-canonicalization behavior for supporting

case-only renames.

* subversion/tests/cmdline/

(case_only_rename): Remove XFail marker. Fix issue description according

to the changed summary of issue #3702.

* subversion/include/svn_client.h

(svn_client_args_to_target_array): Deprecate, succeeded by ...

(svn_client_args_to_target_array2): ... new function, carrying a new


* subversion/libsvn_client/cmdline.c

(svn_client_args_to_target_array2): Make use of new flag

KEEP_LAST_ORIGPATH_ON_TRUEPATH_COLLISION to undo truepath-conversion of

the last of 2 targets if they both have the same 'truepath'.

* subversion/libsvn_client/deprecated.c

(svn_client_args_to_target_array): Implement deprecated wrapper.

* subversion/tests/libsvn_client/client-test.c

(test_args_to_target_array): Adjust caller, passing FALSE for


[in subversion/svn]

* add-cmd.c, blame-cmd.c, cat-cmd.c, changelist-cmd.c, checkout-cmd.c,

cleanup-cmd.c, commit-cmd.c, copy-cmd.c, delete-cmd.c, diff-cmd.c,

export-cmd.c, import-cmd.c, info-cmd.c, list-cmd.c, lock-cmd.c, log-cmd.c,

merge-cmd.c, mergeinfo-cmd.c, mkdir-cmd.c, patch-cmd.c, propdel-cmd.c,

propedit-cmd.c, propget-cmd.c, proplist-cmd.c, propset-cmd.c,

relocate-cmd.c, resolve-cmd.c, resolved-cmd.c, revert-cmd.c, status-cmd.c,

switch-cmd.c, unlock-cmd.c, update-cmd.c, upgrade-cmd.c:


* move-cmd.c: Adjust caller, passing TRUE for


* cl.h

(svn_cl__args_to_target_array_print_reserved): Add new parameter


* util.c

(svn_cl__args_to_target_array_print_reserved): Add new parameter



  1. … 41 more files in changeset.
Fix issue #3826 ("`svn diff local_absolutepath` from inside a local

working copy is broken").

* subversion/svn/diff-cmd.c

(svn_cl__diff): Only convert a user-provided target path to a

relpath when we're about to tack it onto a base URL; absolute

paths make fine local targets.

* subversion/tests/cmdline/

(diff_abs_localpath_from_wc_folder): Remove XFail() decorator.

  1. … 1 more file in changeset.
Follow-up to r1064436:

Fix a copy-pasto that caused an assertion failure with

"svn diff --old=. --new=^/subversion/trunk":

assertion "svn_dirent_is_canonical(base, pool)" failed: file \

"subversion/libsvn_subr/dirent_uri.c", line 1010, function "svn_dirent_join"

* subversion/svn/diff-cmd.c

(svn_cl__diff): We want to check if the new target is a URL. We've already

checked the old one.

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.
Make use of a new function for checking whether all targets are the same

type. A follow-up to r1044028.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Make use of new function

svn_cl__assert_homogeneous_target_type(). Tweak existing logic which

checks to see whether working copy path is present in targets.

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

(tweaked by me)

* subversion/tests/cmdline/

(invalid_diff_targets): New test, verifying that svn diff copes well

with invalid target combinations.

* subversion/svn/diff-cmd.c

(svn_cl__diff): For consistency with other sub-commands, raise the

SVN_ERR_CL_ARG_PARSING_ERROR if both working copy paths and URLs are

passed, and use the same error message also used elsewhere.

  1. … 1 more file in changeset.
Introduce a new flag --git-diff for svn diff, specifying that we want to use

git's extended diff format.

With the diff format, a delete, copy or move may be described with only a

header. Non-git-aware patch applications can not process such a patch, thus

the need for a flag to stay backward compatible with our old diff format.

With the flag there is no need for the SVN_EXPERIMENTAL_PATCH ifdefs.

Note: We don't yet create diff headers for copied or moved paths.

* subversion/svn/cl.h

(svn_cl__opt_state_t): Add USE_GIT_DIFF_FORMAT member.

* subversion/svn/main.c

(svn_cl__longopt_t): Add OPT_USE_GIT_DIFF_FORMAT.

(svn_cl__options): Add and document the new --git-diff option.

(svn_cl__cmd_table): Make svn diff accept the --git-diff option.

(main): Handle --git-diff options.

* subversion/include/svn_client.h


svn_client_diff_peg5): Add USE_GIT_DIFF_FORMAT parameter.


svn_client_diff_peg4): Mention in the doc string that


* subversion/libsvn_client/diff.c

(diff_parameters): Add USE_GIT_DIFF_FORMAT member.





print_git_diff_header_moved): Remove SVN_EXPERIMENTAL_PATCH ifdefs

(diff_content_changed): Check for USE_GIT_DIFF_FORMAT instead of

having the parts dealing with git diffs inside SVN_EXPERIMENTAL



svn_client_diff_peg5): TODO

* subversion/libsvn_client/deprecated.c


svn_client_diff_peg4): Call the new functions with USE_GIT_DIFF_FORMAT

set to FALSE.

* subversion/svn/diff-cmd.c

(svn_cl__diff): Adjust calls to include USE_GIT_DIFF_FORMAT.

* subversion/svn/log-cmd.c

(log_entry_reciever): Adjust callers of svn_client_diff5() and


  1. … 6 more files in changeset.
Allow overriding the default value of the --extensions option from the

client configuration file.

* subversion/include/svn_client.h

(svn_client_diff5): Document that the diff_options argument is now

allowed to be NULL. This allows clients to say "I have no default

arguments for diff" in an unambiguous way (before this commit,

the CLI client passed an array with zero elements, and other

clients probably do the same).

* subversion/include/svn_config.h


* subversion/libsvn_subr/config_file.c

(svn_config_ensure): Document the new diff-extensions option.

* subversion/libsvn_client/diff.c

(set_up_diff_cmd_and_options): If no diff options are provided, check the

configuration for diff options. If that fails, initialise the options

to an empty array (the client used to initialise this array but is no

longer required to do so).

* subversion/svn/log-cmd.c,


(log_entry_receiver, svn_cl__diff): Pass NULL diff_options if none were

provided on the command line.

  1. … 5 more files in changeset.
Follow up r948785.

Solve issue #3071 with simple and cleaner approach without revving the

diff APIs.

* subversion/include/svn_client.h

(svn_client_diff5, svn_client_diff_peg5): Remove the parameter added

for --force-internal-diff

* subversion/svn/diff-cmd.c

(svn_cl__diff): Adjust for above change.

* subversion/svn/log-cmd.c

(log_entry_receiver): Adjust for above change.

* subversion/svn/main.c

(main): Set config option of diff command to NULL if the user wants

to force internal diff.

* subversion/libsvn_client/deprecated.c

(svn_client_diff4, svn_client_diff_peg4): Do not pass the extra

argument for diff APIs.

* subversion/libsvn_client/diff.c

(set_up_diff_cmd_and_options): Remove the extra argument and related


(svn_client_diff5, svn_client_diff_peg5): Remove the extra argument.

Suggested by: rhuijben

  1. … 5 more files in changeset.
Fix issue #3071.

Request enhancement to svn diff to indicate that an external diff-cmd

should NOT be used

* subversion/svn/cl.h

(svn_cl__opt_state_t): Add force internal diff boolean.

* subversion/include/svn_client.h

(svn_client_diff5, svn_client_diff_peg5): Add new parameter to the

function prototype in order to support the new option


* subversion/svn/diff-cmd.c

(svn_cl__diff): Pass new parameter to the diff APIs in order to force

internal diff command.

* subversion/svn/log-cmd.c

(log_entry_receiver): Pass FALSE for force internal diff parameter

to the diff APIs in order preserve old behavior.

* subversion/svn/main.c

(svn_cl__longopt_t): Add new option force internal diff.

(svn_cl__options): Add description for the new diff option.

(svn_cl__cmd_table): Add new option force internal diff to the diff


(main): Enable force internal diff option based on user input and

check for mutually exclusive options '--diff-cmd' and


* subversion/libsvn_client/deprecated.c

(svn_client_diff4, svn_client_diff_peg4): Pass FALSE for force

internal diff paramater to get the old behavior.

* subversion/libsvn_client/diff.c

(set_up_diff_cmd_and_options): Check for force internal diff option

and get rid of external diff command if required.

(svn_client_diff5, svn_client_diff_peg5): Add support for the new

option --force-internal-diff

  1. … 6 more files in changeset.