Checkout
 

gbg in subversion

On the diff-cmd branch:

Addressing issue 2044, extending the invocation capabilities of the

svn diff --diff-cmd.

See http://subversion.tigris.org/issues/show_bug.cgi?id=2044

This is an intermediate attempt for discussion and contains 2 bugs:

1) /subversion/tests/cmdline/diff_tests.py 52 is an XFAIL. Input

appears to be correct, but the test script with a space in the name

"diff script" is not called, this may be an apr_proc_create()

issue.

2) Emtpy single quotes are rendered as '''' by apr_proc_create().

* subversion/BRANCH-README

Decription of this Branch.

* subversion/include/private/svn_io_private.h

(svn_io__create_custom_diff_cmd): Declare new function and

document it. This function is an intermediate version and will

be refactored once the behaviour is settled.

* subversion/libsvn_subr/io.c

(svn_io__create_custom_diff_cmd): New Function. This function

translates user input to diff input.

(svn_io_run_diff): Refactor function to preserve old behaviour of

--diff-cmd whilst facilitiating the new extended syntax.

* subversion/tests/cmdline/diff_tests.py

(test_list): Add new tests diff_external_diffcmd_1,

diff_external_diffcmd_2, diff_external_diffcmd_3 and

diff_external_diffcmd_4.

(diff_external_diffcmd): Change test description, rename the test

script 'diff' to the more descriptive 'diff_script.

(diff_external_diffcmd_1): New function. Test that the

--extensions option works as before when the --diff-cmd is used

with the classic syntax.

(diff_external_diffcmd_2): New function. Check that the new syntax

produces a correct, simple diff program call.

(diff_external_diffcmd_3): New function. This case handles the

cases of -filename or filename+ where + and - are placeholders

for any chosen character. Check that strings containing spaces

enclosed in double quotes are correct parsed as one entry into

the execv compatible shell command array.

(diff_external_diffcmd_4): New function with XFAIL result. Check

that escaped spaces are correctly handled, in case the user has

a program name with a space in it. This currently fails at shell

level, so this may be the wrong approach alltogether.

    • ?
    /branches/diff-cmd-feature/BRANCH-README
On the diff-cmd-feature branch: Creating a branch of /trunk.
* COMMITTERS

(gbg): Add myself as a partial committer for gtest.

Change all occurrences of 'diff_cmd_baton' to 'dwi'.

* subversion/libsvn_client/diff.c

(just_paths_for_diff_labels),

(diff_props_changed),

(svn_client_diff6),

(svn_client_diff_peg6): changed local variable diff_cmd_baton to

dwi throughout.

Approved by: rhuijben

On the invoke-diff-cmd-feature branch: trunk revision 1548823 merged into branch revision 1542741.

  1. … 354 more files in changeset.
On the invoke-diff-cmd-feature branch: Update BRANCH-README file.

Repair accidental white space changes to assorted files.

* BRANCH-README:

(Index): New section.

(Log Messages) Rework all log messages.

(Diff file): Replace with uptodate version.

* subversion/include/svn_io.h

(svn_io_run_cmd): Remove accidentally introduded whitespace at the

end of "@since New in 1.6.0".

* subversion/libsvn_client/diff.c

(diff_baton): Remove accidentally introduded newline before closing

brace.

* subversion/svn/svn.c

(sub_main): Remove accidentally introduded whitespace at the end of

"if (opt_state.diff.diff_cmd)".

* subversion/svnlook/svnlook.c

(main): Replace accidentally removed newline before "case 't'".

On the invoke-diff-cmd-feature branch: trunk revision 1542632 merged into branch revision 1541728.

  1. … 84 more files in changeset.
On the invoke-diff3-feature branch: Add new invoke-diff3-cmd to

Subversion.

* BRANCH-README

(*) Description of Branch.

* subversion/include/private/svn_wc_private.h

(svn_wc__get_file_external_editor,

(svn_wc__get_update_editor,

(svn_wc__get_switch_editor): New parameter:

const char *invoke_diff3_cmd.

* subversion/include/svn_config.h

(): New definition: SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD.

* subversion/include/svn_error_codes.h

(command-line client errors): New definition:

SVN_ERR_CL_NO_EXTERNAL_DIFF3_TOOL.

(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS): Adjust numbering in order

to retain a logical grouping.

* subversion/include/svn_io.h

(svn_io_run_invoke_diff3): New function.

* subversion/include/svn_wc.h

(svn_wc_merge6): New function.

(svn_wc_merge5): Deprecate.

* subversion/libsvn_client/externals.c

(switch_file_external): New variable: const char *invoke_diff3_cmd.

Initialize diff3_cmd to NULL. Add precedence logic and read the

config file to populate invoke_diff3_cmd. Add invoke_diff3_cmd in

call to svn_wc__get_file_external_editor().

* subversion/libsvn_client/merge.c

(merge_cmd_baton_t): New member *invoke_diff3_cmd. Adjust comment.

(merge_file_changed): Replace call to svn_wc_merge5 with call to

svn_wc_merge6.

(do_merge): New variable: const char *invoke_diff3_cmd. Initialize

diff3_cmd to NULL. Adjust comment. Add precedence logic and read

the config file to populate invoke_diff3_cmd. Add invoke_diff3_cmd

to merge_baton.

* subversion/libsvn_client/switch.c

(switch_internal): New variable: const char *invoke_diff3_cmd. Add

precedence logic and read the config file to populate

invoke_diff3_cmd. Add invoke_diff3_cmd in call to

svn_wc__get_switch_editor().

* subversion/libsvn_client/update.c

(update_internal): Initialize diff3_cmd to NULL. New variable:

*invoke_diff3_cmd. Adjust comment, add precedence logic and read

the config file to populate invoke_diff3_cmd. Add

invoke_diff3_cmd in call to svn_wc__get_update_editor().

* subversion/libsvn_subr/config_file.c

(svn_config_ensure): Add entry for invoke-diff3-cmd.

* subversion/libsvn_subr/io.c

(svn_io_run_invoke_diff3): New function.

* subversion/libsvn_wc/deprecated.c

(svn_wc_get_update_editor4): Add invoke-diff3-cmd as NULL to call to

svn_wc__get_update_editor().

(svn_wc_get_switch_editor4): Add invoke-diff3-cmd as NULL to call to

svn_wc__get_switch_editor().

(svn_wc_merge5): New function.

* subversion/libsvn_wc/externals.c

(struct edit_baton): Rename diff3cmd to diff3_cmd. New member

variable: const char *invoke_diff3_cmd.

(close_file): Rename diff3cmd to diff3_cmd and add invoke_diff3_cmd

in call to svn_wc__perform_file_merge().

(svn_wc__get_file_external_editor): New parameter: const char

*invoke_diff3_cmd. Rename diff3cmd to diff3_cmd in eb

assignment and assign invoke_diff3_cmd to struct edit_baton eb.

* subversion/libsvn_wc/merge.c

(merge_target_t): Adjust comment for old_actual_props. New member

variable: invoke_diff3_cmd.

(do_text_merge_external): New parameter: const char

invoke_diff3_cmd. Add if condition to route call to newly added

svn_io_run_invoke_diff3(). Add clarifying braces around

A = (B == C) type assignment.

(merge_text_file): Adjust if condition to route call to

do_text_merge_external() and add invoke_diff3_cmd to call to

do_text_merge_external().

(svn_wc__internal_merge): New parameter: const char

*invoke_diff3_cmd. Assign invoke_diff3_cmd to mt. Add

invoke_diff3_cmd as a conditional variable in to call to

detranslate_wc_file().

(svn_wc_merge6): Declare new API.

* subversion/libsvn_wc/update_editor.c

(struct edit_baton): New member const char *invoke_diff3_cmd.

(svn_wc__perform_file_merge): New parameter: const char

*invoke_diff3_cmd. Add invoke_diff3_cmd to

svn_wc__internal_merge().

(merge_file): Add invoke_diff3_cmd to svn_wc__internal_merge().

(make_editor): New parameter: const char *invoke_diff3_cmd. Assign

invoke_diff3_cmd to eb.

(svn_wc__get_update_editor, svn_wc__get_switch_editor): New

parameter: const char *invoke_diff3_cmd. Add invoke_diff3_cmd to

call to make_editor().

* subversion/libsvn_wc/wc.h

(svn_wc__internal_merge): Adjust function comment. New parameter:

const char *invoke_diff3_cmd. Add newline to conform to general

formatting in this file.

(svn_wc__perform_file_merge): New parameter: const char

*invoke_diff3_cmd.

* subversion/libsvn_wc/wc_db_update_move.c

(update_working_file): Add invoke_diff3_cmd in call to

svn_wc__perform_file_merge() as NULL. Adjust other comments for

neatness.

* subversion/svn/cl.h

(svn_cl__accept_t): New commented member:

svn_cl__accept_invoke_diff3_config.

(): New definition: SVN_CL__ACCEPT_INVOKE_DIFF3_CONFIG.

(svn_cl__opt_state_t): New member const char* invoke_diff3_cmd.

(svn_cl__invoke_diff3_cmd_externally): New function.

* subversion/svn/conflict-callbacks.c

(svn_cl__accept_from_word): Add SVN_CL__ACCEPT_INVOKE_DIFF3_CONFIG

to if condition returns svn_cl__accept_launch.

(invoke_diff3_resolver): New routing function that calls

svn_cl__invoke_diff3_cmd_externally().

(text_conflict_options): Add "3f" option for invoke-diff3-cmd tool

selection and add 'i' option for interactive invoke-diff3-cmd

input.

(handle_text_conflict): Add interactive selection code for

invoke-diff3-cmd input ("i" section) and invoke-diff3-cmd tool

("3f" section) to if condition. Add '3f' and 'i' to next_option.

Adjust general indentation(2 entries).

(conflict_func_interactive): Add cases for "i" and "3f" selection.

Adjust general indentation. Add case

'svn_cl__accept_invoke_diff3_config'.

* subversion/svn/svn.c

(svn_cl__longopt_t): New member 'opt_diff3_cmd'.

(svn_cl__options): Add 'invoke-diff3-cmd' entry plus help text.

(svn_cl__cmd_table,"cleanup","merge","switch","update"): Add

opt_invoke_diff3_cmd.

(sub_main): Add case opt_invoke_diff3_cmd. Ensure murutal

exclusiveness of diff3-cmd and invoke-diff3-cmd. Add call to

svn_config_set(). Add error check for

svn_cl__accept_invoke_diff3_config.

* subversion/svn/util.c

(): Include svn_io_private.h

(svn_cl__invoke_diff3_cmd_externally): New function.

* subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout

(): Update help output.

    • ?
    /branches/invoke-diff3-feature/subversion/libsvn_wc/wc.h
    • ?
    /branches/invoke-diff3-feature/BRANCH-README
  1. … 8 more files in changeset.
On the invoke-diff3-cmd-feature: Create a new branch from the r1538071

invoke-diff-cmd-feature branch.

Removing broken branch, see invoke-diff3-cmd branch replacement.
On the invoke-diff-merge-feature branch: Update BRANCH-README.

On the invoke-diff-cmd-feature branch: Update BRANCH-README file.

* BRANCH-README:

(Log messages): Update entries.

(Diff file for this Branch): New entry.

On the invoke-diff-cmd-feature branch: Checkpoint commit (ignore, trivial).

On the invoke-diff-cmd-feature branch: Checkpoint commit (ignore, trivial).

On the invoke-diff-cmd-feature branch: Update BRANCH-README file.

* BRANCH-README:

(Log messages of salient code changes): Update entries.

On the invoke-diff-cmd-feature branch: Checkpoint commit (ignore, trivial).

    • ?
    /branches/invoke-diff-merge-feature/subversion/svn/util.c
    • ?
    /branches/invoke-diff-merge-feature/subversion/svn/svn.c
On the invoke-diff-cmd-feature branch: Update BRANCH-README file.

* BRANCH-README:

(Changes to the existing code structure): Update.

On the invoke-diff-cmd-feature branch: Fixed all omissions, errors and

typos found in review: http://mail-archives.apache.org/mod_mbox/subversion-dev/201311.mbox/%3C1383750720.1526.YahooMailNeo@web186106.mail.ir2.yahoo.com%3E

* subversion/include/private/svn_io_private.h

(svn_io__create_custom_diff_cmd): New function declaration.

* subversion/include/svn_client.h

(svn_client_diff6): Fix doc string.

(svn_client_diff_peg6): Fix doc string.

(svn_client_diff_peg5): Fix doc string.

* subversion/include/svn_io.h

(__create_custom_diff_cmd): Remove function.

* subversion/libsvn_client/diff.c

(diff_cmd_baton): Move declaration of invoke_diff_cmd to group with

diff_cmd.

* subversion/libsvn_subr/io.c

(diff_content_changed): Add missing space to help string.

(svn_io__create_custom_diff_cmd): Rename function from

__create_custom_diff_cmd. Change internal logic to ensure that

every present reserved keyword is expanded, including multiple

occurences thereof in the same word.

(svn_io_run_external_diff): Restore original function contents from

/trunk. Add location of matching test.

* subversion/svn/svn.c

(svn_cl__options "invoke-diff-cmd"): Update and format help

information.

* subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout

(--invoke-diff-cmd): Add new entry to help output data.

On the invoke-diff-cmd-feature branch: Resend correct BRANCH-README

file.

* BRANCH-README: Revert to 1538088 version.

On the invoke-diff-merge-feature branch: trunk revision 1538962 merged

into branch revision 1538927.

  1. … 16 more files in changeset.
On the invoke-merge-feature branch: Update BRANCH-README to describe

the new branch.

* BRANCH-README: Initial creation.

On the invoke-diff-cmd-feature branch: Resend correct BRANCH-README

file which got erroneously replace in the previous commit. Delete the

trunk which was added by mistake in commit r1538929.

On the invoke-merge-feature branch: Update BRANCH-README to describe

the new branch.

* BRANCH-README: Initial creation.

On the invoke-merge-feature branch: trunk revision 1538925 merged into branch revision 1535411.

  1. … 15 more files in changeset.
On the invoke-merge-cmd-feature: Create a new branch from 1538071

invoke-diff-cmd-feature branch.

On the invoke-diff-cmd-feature branch: Fix variable declaration and

initialization. Update help info.

* subversion/libsvn_client/diff.c

(set_up_diff_cmd_and_options): Fix variable declaration and

intialization.

* subversion/libsvn_subr/config_file.c

(invoke-diff-cmd): Update help info.

On the invoke-diff-cmd-feature branch: trunk revision 1538068 merged

into branch revision 1538050. Correct errors trying to revert and

re-applied all the changes from r1537987: Continuation from r1535411:

Adjust substitution syntax to %svn_(label)_[old|new|mine|yours|base].

Update string assigment to use apr_pstrdup. Update tests. Update help

info.

* subversion/libsvn_subr/io.c

(__create_custom_diff_cmd): Update substitution syntax. Update

string assigment to use apr_pstrdup.

(svn_io_run_diff2): Update default user args syntax to reflect new

substitution syntax.

* subversion/svn/svn.c

(svn_cl__options[], "invoke-diff-cmd"): Update help info.

* BRANCH-README: Update.

* /subversion/tests/cmdline/diff_tests.py: Update tests.

On the invoke-diff-cmd-feature branch: trunk revision 1538048 merged into branch revision 1537987.

  1. … 124 more files in changeset.
On the invoke-diff-cmd branch: Continuation from r1535411: Adjust

substitution syntax to %svn_(label)_[old|new|mine|yours|base]. Update

string assigment to use apr_pstrdup.

* subversion/libsvn_subr/io.c

(__create_custom_diff_cmd): Update substitution syntax. Update

string assigment to use apr_pstrdup.

* subversion/svn/svn.c

(svn_cl__options[], "invoke-diff-cmd"): Update help info.

* BRANCH-README: Update.

On the invoke-diff-cmd-feature branch: Update BRANCH-README file.

* BRANCH-README: Update.