subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1541082 - in /subversion/branches/invoke-diff-merge-feature: ./ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_wc/ subversion/svn/
Date Tue, 12 Nov 2013 14:31:11 GMT
Author: gbg
Date: Tue Nov 12 14:31:11 2013
New Revision: 1541082

URL: http://svn.apache.org/r1541082
Log:
On the invoke-diff-cmd-feature branch: Checkpoint commit (ignore, trivial).


Modified:
    subversion/branches/invoke-diff-merge-feature/BRANCH-README
    subversion/branches/invoke-diff-merge-feature/subversion/include/private/svn_wc_private.h
    subversion/branches/invoke-diff-merge-feature/subversion/include/svn_config.h
    subversion/branches/invoke-diff-merge-feature/subversion/include/svn_error_codes.h
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/externals.c
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/merge.c
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/switch.c
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/update.c
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/deprecated.c
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/externals.c
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/update_editor.c
    subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/wc.h
    subversion/branches/invoke-diff-merge-feature/subversion/svn/cl.h
    subversion/branches/invoke-diff-merge-feature/subversion/svn/conflict-callbacks.c
    subversion/branches/invoke-diff-merge-feature/subversion/svn/svn.c
    subversion/branches/invoke-diff-merge-feature/subversion/svn/util.c

Modified: subversion/branches/invoke-diff-merge-feature/BRANCH-README
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/BRANCH-README?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/BRANCH-README (original)
+++ subversion/branches/invoke-diff-merge-feature/BRANCH-README Tue Nov 12 14:31:11 2013
@@ -57,6 +57,17 @@ UI components
   which in turn is overridden when one of --invoke-merge-cmd,
   --diff-cmd are invoked.
 
+=> Note: the current mess is messy.  Once it's all working I will be
+looking to simplify this stuff.
+
+* see if the check with the notice can be generally moved to where the
+  options are determined.
+
+* see if the launch resolver /invoke-diff-revolved thingy should be
+  sausagemachined. (probably not. the code is a snake nest as is
+  without adding yet another knot to it)
+
+* 
 
 Changes to the existing code structure:
 =======================================
@@ -73,13 +84,47 @@ different; --diff-3 is tailored for GNU 
 user's input of switches, whereas --invoke-diff3-cmd is a
 free-style-anything-goes-including-shooting-your-foot creation.
 
+Known Problems
+==============
+
+The error trace back in subversion/svn/conflict-callbacks.c is broken
+in general.  I've kept the current shape to match the 'l' option, but
+I think that is a seperate bug.
+
+see line 902 ('l' option)
+and line 940 ('i' option)
+
+Merge of 'subversion/libsvn_client/diff.c' aborted.
+Select: (p) postpone, (df) show diff, (e) edit file, (m) merge,
+        (i) interactive invoke-diff3-cmd selection,
+        (mc) my side of conflict, (tc) their side of conflict,
+        (s) show all options: l
+l
+traced call
+Select: (p) postpone, (df) show diff, (e) edit file, (m) merge,
+        (i) interactive invoke-diff3-cmd selection,
+        (mc) my side of conflict, (tc) their side of conflict,
+        (s) show all options: i
+i
+Enter the invoke-diff3-cmd: flobble
+flobble
+traced call
+Select: (p) postpone, (df) show diff, (e) edit file, (m) merge,
+        (i) interactive invoke-diff3-cmd selection,
+        (mc) my side of conflict, (tc) their side of conflict,
+        (s) show all options: 
 
 Tests
 =====
 
 Correct functionality
 ---------------------
-TBD
+
+I could not find a pre-existing test for the --diff3-cmd option and so
+I omitted a test for now.  See below for test suite failures.
+
+TODO:  fix the get-opt data test.
+
 
 Working copy functionality
 --------------------------
@@ -105,22 +150,217 @@ kdiff3: 0.9.97 (32 bit)
 TODO:
 ====
 
-  * write help info
-
-  * Create the UI for the interactive dialogue in
-    subversion/svn/conflict-callbacks.
+ * extract the patch.
 
-    Proposed interactive dialoge entry:
+ * make new branch from invoke-diff-cmd-feature.
 
-    (3f) - use diff3 tool defined in the config file to resolve conflict 
-    (3c) - use diff3 tool defined in the commandline to resolve conflict 
-    (3i) - interactively select diff3 tool now to resolve conflict  
+ * apply patch, make changes to match invoke-diff-cmd-feature since
+   then.
 
-  * make list of where else in svn to add the invoke-merge-cmd.
-   - svn cleanup
+ * write log messages
 
-  * config file service:
-    plug in config file service into io.c
-    add new entry in config file
+ * fix the get-opt test.  
+
+
+FAILED TESTS
+============
+
+Tha tests below are failing, but I have no idea as to why:
+
+$ ./externals_tests.py 
+PASS:  externals_tests.py 1: test checkouts with externals
+PASS:  externals_tests.py 2: update to receive a new external module
+PASS:  externals_tests.py 3: update to lose an external module
+PASS:  externals_tests.py 4: update change to an unmodified external module
+PASS:  externals_tests.py 5: update changes to a modified external module
+PASS:  externals_tests.py 6: update changes under an external module
+PASS:  externals_tests.py 7: commit and update additional externals
+PASS:  externals_tests.py 8: error if external target dir involves '.' or '..'
+PASS:  externals_tests.py 9: test exports with externals
+PASS:  externals_tests.py 10: test exports from working copies with externals
+PASS:  externals_tests.py 11: use a peg revision to specify an external module
+PASS:  externals_tests.py 12: check the new '-rN URL PATH' syntax
+PASS:  externals_tests.py 13: error if propset'ing external with invalid format
+PASS:  externals_tests.py 14: old 'PATH URL' format should ignore peg revisions
+PASS:  externals_tests.py 15: should not be able to mv or rm a file external
+W: EXPECTED STDERR (regexp):
+W: | svn: E205011: Failure occurred.*definitions
+W: ACTUAL STDERR:
+W: | svn: warning: apr_err=SVN_ERR_WC_BAD_PATH
+W: | svn: warning: W155022: Cannot insert a file external defined on '/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svn-test-work/working_copies/externals_tests-16' into the working copy '/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svn-test-work/working_copies/externals_tests-16/A/D-copy'.
+W: | subversion/svn/update-cmd.c:175: (apr_err=SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS)
+W: | svn: E205012: Failure occurred processing one or more externals definitions
+W: CWD: /home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline
+W: EXCEPTION: SVNUnmatchedError
+Traceback (most recent call last):
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 1584, in run
+    rc = self.pred.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 176, in run
+    return self.func(sandbox)
+  File "./externals_tests.py", line 1143, in cant_place_file_external_into_dir_external
+    'up', wc_dir)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 282, in run_and_verify_svn
+    expected_exit, *varargs)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 321, in run_and_verify_svn2
+    verify.verify_outputs(message, out, err, expected_stdout, expected_stderr)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/verify.py", line 445, in verify_outputs
+    compare_and_display_lines(message, label, expected, actual, raisable)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/verify.py", line 418, in compare_and_display_lines
+    raise raisable
+SVNUnmatchedError
+FAIL:  externals_tests.py 16: place a file external into a directory external
+PASS:  externals_tests.py 17: allow spaces in external local paths
+PASS:  externals_tests.py 18: binary file externals
+PASS:  externals_tests.py 19: delete a file external
+PASS:  externals_tests.py 20: switch a relative external
+PASS:  externals_tests.py 21: export from a sparse working copy with externals
+PASS:  externals_tests.py 22: relegate external from one repo to another
+PASS:  externals_tests.py 23: tag directory with file externals from wc to url
+PASS:  externals_tests.py 24: merge target with externals
+PASS:  externals_tests.py 25: update that modifies a file external
+PASS:  externals_tests.py 26: update an external on a locally added dir
+PASS:  externals_tests.py 27: switch an external on a locally added dir
+PASS:  externals_tests.py 28: update a file external in sibling dir
+PASS:  externals_tests.py 29: update a file external without committing target
+PASS:  externals_tests.py 30: bring in a new file over a file external
+PASS:  externals_tests.py 31: bring in a new file external over a file
+PASS:  externals_tests.py 32: try to exclude externals
+PASS:  externals_tests.py 33: update file externals via different url
+PASS:  externals_tests.py 34: file external in unversioned dir
+PASS:  externals_tests.py 35: a WC->WC copy should exclude file externals
+PASS:  externals_tests.py 36: commit --include-externals
+PASS:  externals_tests.py 37: commit --include-externals --depth=immediates
+W: CWD: /home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline
+W: EXCEPTION: Failure: Creating conflicting child 'C' of 'A' didn't error
+Traceback (most recent call last):
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 1584, in run
+    rc = self.pred.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 114, in run
+    return self._delegate.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 176, in run
+    return self.func(sandbox)
+  File "./externals_tests.py", line 2813, in shadowing
+    raise svntest.Failure("Creating conflicting child 'C' of 'A' didn't error")
+Failure: Creating conflicting child 'C' of 'A' didn't error
+XFAIL: externals_tests.py 38: external shadows an existing dir
+PASS:  externals_tests.py 39: file external remap segfaults due to deleted props
+PASS:  externals_tests.py 40: whether '-r1 ^/A B' updates properly
+PASS:  externals_tests.py 41: url-to-wc copy of externals
+PASS:  externals_tests.py 42: local path appears twice in one svn:external prop
+PASS:  externals_tests.py 43: list with --include-externals
+PASS:  externals_tests.py 44: move with file externals
+W: CWD: /home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline
+W: EXCEPTION: SVNUnmatchedError
+Traceback (most recent call last):
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 1584, in run
+    rc = self.pred.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 176, in run
+    return self.func(sandbox)
+  File "./externals_tests.py", line 3187, in pinned_externals
+    expected_error)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 879, in run_and_verify_update
+    raise main.SVNUnmatchedError
+SVNUnmatchedError
+FAIL:  externals_tests.py 45: pinned external
+PASS:  externals_tests.py 46: shallow update should remove externals
+W: svn: warning: apr_err=SVN_ERR_FS_NOT_FOUND
+W: svn: warning: W160013: Working copy path 'gamma-ext' does not exist in repository
+W: subversion/svn/update-cmd.c:175: (apr_err=SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS)
+W: svn: E205012: Failure occurred processing one or more externals definitions
+W: CWD: /home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline
+W: EXCEPTION: Failure: Command failed: "/home/g/branches/invoke-diff-merge-feature/subversion/svn/svn update svn-test-work/working_copies/externals_tests-47.branch --config-dir ..."; exit code 1
+Traceback (most recent call last):
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 1584, in run
+    rc = self.pred.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 114, in run
+    return self._delegate.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 176, in run
+    return self.func(sandbox)
+  File "./externals_tests.py", line 3265, in switch_parent_relative_file_external
+    'update', branch_wc)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 282, in run_and_verify_svn
+    expected_exit, *varargs)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 320, in run_and_verify_svn2
+    exit_code, out, err = main.run_svn(want_err, *varargs)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 699, in run_svn
+    *(_with_auth(_with_config_dir(varargs))))
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 365, in run_command
+    None, *varargs)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 557, in run_command_stdin
+    '"; exit code ' + str(exit_code))
+Failure: Command failed: "/home/g/branches/invoke-diff-merge-feature/subversion/svn/svn update svn-test-work/working_copies/externals_tests-47.branch --config-dir ..."; exit code 1
+XFAIL: externals_tests.py 47: switch parent-relative file external
+PASS:  externals_tests.py 48: file externals unversioned obstruction
+W: Couldn't find node 'mu-ext' in actual disk tree
+W:  * Node name:   mu-ext
+    Path:       __SVN_ROOT_NODE/A/mu-ext
+    Contents:   This is the file 'mu'.
+
+    Properties: {}
+    Attributes: {}
+    Children:  None (node is probably a file)
+
+W: Unequal at node A
+W: EXPECTED DISK TREE:
+svntest.wc.State(wc_dir, {
+  'A/B/E/beta'        : Item(contents="This is the file 'beta'.\n"),
+  'A/B/E/alpha'       : Item(contents="This is the file 'alpha'.\n"),
+  'A/B/F'             : Item(),
+  'A/B/lambda'        : Item(contents="This is the file 'lambda'.\n"),
+  'A/D/G/rho'         : Item(contents="This is the file 'rho'.\n"),
+  'A/D/G/pi'          : Item(contents="This is the file 'pi'.\n"),
+  'A/D/G/tau'         : Item(contents="This is the file 'tau'.\n"),
+  'A/D/H/psi'         : Item(contents="This is the file 'psi'.\n"),
+  'A/D/H/omega'       : Item(contents="This is the file 'omega'.\n"),
+  'A/D/H/chi'         : Item(contents="This is the file 'chi'.\n"),
+  'A/D/gamma'         : Item(contents="This is the file 'gamma'.\n"),
+  'A/mu'              : Item(contents="This is the file 'mu'.\n"),
+  'A/mu-ext'          : Item(contents="This is the file 'mu'.\n"),
+  'A/C'               : Item(),
+  'iota'              : Item(contents="This is the file 'iota'.\n"),
+})
+W: ACTUAL DISK TREE:
+svntest.wc.State(wc_dir, {
+  'A/D/H/psi'         : Item(contents="This is the file 'psi'.\n"),
+  'A/D/H/omega'       : Item(contents="This is the file 'omega'.\n"),
+  'A/D/H/chi'         : Item(contents="This is the file 'chi'.\n"),
+  'A/D/G/rho'         : Item(contents="This is the file 'rho'.\n"),
+  'A/D/G/pi'          : Item(contents="This is the file 'pi'.\n"),
+  'A/D/G/tau'         : Item(contents="This is the file 'tau'.\n"),
+  'A/D/gamma'         : Item(contents="This is the file 'gamma'.\n"),
+  'A/B/E/beta'        : Item(contents="This is the file 'beta'.\n"),
+  'A/B/E/alpha'       : Item(contents="This is the file 'alpha'.\n"),
+  'A/B/F'             : Item(),
+  'A/B/lambda'        : Item(contents="This is the file 'lambda'.\n"),
+  'A/C'               : Item(),
+  'A/mu'              : Item(contents="This is the file 'mu'.\n"),
+  'iota'              : Item(contents="This is the file 'iota'.\n"),
+})
+W: CWD: /home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline
+W: EXCEPTION: SVNTreeUnequal
+Traceback (most recent call last):
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/main.py", line 1584, in run
+    rc = self.pred.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 114, in run
+    return self._delegate.run(sandbox)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/testcase.py", line 176, in run
+    return self.func(sandbox)
+  File "./externals_tests.py", line 3347, in file_external_versioned_obstruction
+    expected_status)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 886, in run_and_verify_update
+    check_props)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 799, in verify_update
+    singleton_handler_b, b_baton)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/actions.py", line 820, in verify_disk
+    singleton_handler_b, b_baton)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/tree.py", line 696, in compare_trees
+    singleton_handler_b, b_baton)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/tree.py", line 701, in compare_trees
+    singleton_handler_b(b_child, b_baton)
+  File "/home/g/branches/invoke-diff-merge-feature/subversion/tests/cmdline/svntest/tree.py", line 593, in default_singleton_handler
+    raise SVNTreeUnequal
+SVNTreeUnequal
+XFAIL: externals_tests.py 49: file externals versioned obstruction
+~/branches/invoke-diff-merge-feature/subversion/tests/cmdline>
+$ 
 
-  * ask on svn-dev how to create a suitable python test.

Modified: subversion/branches/invoke-diff-merge-feature/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/include/private/svn_wc_private.h?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/include/private/svn_wc_private.h Tue Nov 12 14:31:11 2013
@@ -77,6 +77,7 @@ svn_wc__get_file_external_editor(const s
                                  apr_array_header_t *iprops,
                                  svn_boolean_t use_commit_times,
                                  const char *diff3_cmd,
+                                 const char *invoke_diff3_cmd,
                                  const apr_array_header_t *preserved_exts,
                                  const char *record_ancestor_abspath,
                                  const char *recorded_url,
@@ -1507,6 +1508,7 @@ svn_wc__get_update_editor(const svn_delt
                           svn_boolean_t server_performs_filtering,
                           svn_boolean_t clean_checkout,
                           const char *diff3_cmd,
+                          const char *invoke_diff3_cmd,
                           const apr_array_header_t *preserved_exts,
                           svn_wc_dirents_func_t fetch_dirents_func,
                           void *fetch_dirents_baton,
@@ -1549,6 +1551,7 @@ svn_wc__get_switch_editor(const svn_delt
                           svn_boolean_t allow_unver_obstructions,
                           svn_boolean_t server_performs_filtering,
                           const char *diff3_cmd,
+                          const char *invoke_diff3_cmd,
                           const apr_array_header_t *preserved_exts,
                           svn_wc_dirents_func_t fetch_dirents_func,
                           void *fetch_dirents_baton,

Modified: subversion/branches/invoke-diff-merge-feature/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/include/svn_config.h?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/include/svn_config.h (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/include/svn_config.h Tue Nov 12 14:31:11 2013
@@ -117,7 +117,7 @@ typedef struct svn_config_t svn_config_t
 /** @since New in 1.9. */
 #define SVN_CONFIG_OPTION_INVOKE_DIFF_CMD           "invoke-diff-cmd"
 /** @since New in 1.9. */
-#define SVN_CONFIG_OPTION_INVOKE_MERGE_CMD           "invoke-merge-cmd"
+#define SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD          "invoke-diff3-cmd"
 #define SVN_CONFIG_OPTION_MERGE_TOOL_CMD            "merge-tool-cmd"
 #define SVN_CONFIG_SECTION_MISCELLANY           "miscellany"
 #define SVN_CONFIG_OPTION_GLOBAL_IGNORES            "global-ignores"

Modified: subversion/branches/invoke-diff-merge-feature/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/include/svn_error_codes.h?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/include/svn_error_codes.h Tue Nov 12 14:31:11 2013
@@ -1451,8 +1451,13 @@ SVN_ERROR_START
              SVN_ERR_CL_CATEGORY_START + 10,
              "No external merge tool available")
 
-  SVN_ERRDEF(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+  /** @since New in 1.9. */
+  SVN_ERRDEF(SVN_ERR_CL_NO_EXTERNAL_DIFF3_TOOL,
              SVN_ERR_CL_CATEGORY_START + 11,
+             "No external diff3 tool available")
+
+  SVN_ERRDEF(SVN_ERR_CL_ERROR_PROCESSING_EXTERNALS,
+             SVN_ERR_CL_CATEGORY_START + 12,
              "Failed processing one or more externals definitions")
 
   /* ra_svn errors */

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/externals.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/externals.c Tue Nov 12 14:31:11 2013
@@ -364,7 +364,8 @@ switch_file_external(const char *local_a
                       ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG)
                       : NULL;
   svn_boolean_t use_commit_times;
-  const char *diff3_cmd;
+  const char *diff3_cmd = NULL;
+  const char *invoke_diff3_cmd = NULL;
   const char *preserved_exts_str;
   const apr_array_header_t *preserved_exts;
   svn_node_kind_t kind, external_kind;
@@ -376,13 +377,23 @@ switch_file_external(const char *local_a
                               SVN_CONFIG_SECTION_MISCELLANY,
                               SVN_CONFIG_OPTION_USE_COMMIT_TIMES, FALSE));
 
-  /* Get the external diff3, if any. */
+  /* Get the external *_diff3_cmd, if any. 
+     Precedence: If there is no invoke_diff3_cmd on the cmd line,
+     check if there is a diff3-cmd in the config file.  If there is,
+     do not check invoke_diff3_cmd in the config file.*/
   svn_config_get(cfg, &diff3_cmd, SVN_CONFIG_SECTION_HELPERS,
                  SVN_CONFIG_OPTION_DIFF3_CMD, NULL);
 
   if (diff3_cmd != NULL)
     SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, scratch_pool));
-
+  else
+    {
+      svn_config_get(cfg, &invoke_diff3_cmd, SVN_CONFIG_SECTION_HELPERS,
+                     SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD, NULL);
+      if (invoke_diff3_cmd != NULL)
+        SVN_ERR(svn_path_cstring_to_utf8(&invoke_diff3_cmd, 
+                                         invoke_diff3_cmd, scratch_pool));
+    }
   /* See which files the user wants to preserve the extension of when
      conflict files are made. */
   svn_config_get(cfg, &preserved_exts_str, SVN_CONFIG_SECTION_MISCELLANY,
@@ -483,7 +494,8 @@ switch_file_external(const char *local_a
                                              switch_loc->repos_uuid,
                                              inherited_props,
                                              use_commit_times,
-                                             diff3_cmd, preserved_exts,
+                                             diff3_cmd, invoke_diff3_cmd,
+                                             preserved_exts,
                                              def_dir_abspath,
                                              url, peg_revision, revision,
                                              ctx->conflict_func2,

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/merge.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/merge.c Tue Nov 12 14:31:11 2013
@@ -9672,7 +9672,8 @@ do_merge(apr_hash_t **modified_subtrees,
 {
   merge_cmd_baton_t merge_cmd_baton = { 0 };
   svn_config_t *cfg;
-  const char *diff3_cmd;
+  const char *diff3_cmd = NULL;
+  const char *invoke_diff3_cmd = NULL;
   int i;
   svn_boolean_t checked_mergeinfo_capability = FALSE;
   svn_ra_session_t *ra_session1 = NULL, *ra_session2 = NULL;
@@ -9723,7 +9724,11 @@ do_merge(apr_hash_t **modified_subtrees,
   if (depth == svn_depth_unknown)
     depth = svn_depth_infinity;
 
-  /* Set up the diff3 command, so various callers don't have to. */
+ /* Get the external *_diff3_cmd, if any. 
+     Precedence: If there is no invoke_diff3_cmd on the cmd line,
+     check if there is a diff3-cmd in the config file.  If there is,
+     do not check invoke_diff3_cmd in the config file.*/
+
   cfg = ctx->config
         ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG)
         : NULL;
@@ -9732,6 +9737,14 @@ do_merge(apr_hash_t **modified_subtrees,
 
   if (diff3_cmd != NULL)
     SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, scratch_pool));
+  else
+    {
+      svn_config_get(cfg, &invoke_diff3_cmd, SVN_CONFIG_SECTION_HELPERS,
+                     SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD, NULL);
+      if (invoke_diff3_cmd != NULL)
+        SVN_ERR(svn_path_cstring_to_utf8(&invoke_diff3_cmd, 
+                                         invoke_diff3_cmd, scratch_pool));
+    }
 
   /* Build the merge context baton (or at least the parts of it that
      don't need to be reset for each merge source).  */
@@ -9748,6 +9761,7 @@ do_merge(apr_hash_t **modified_subtrees,
   merge_cmd_baton.pool = iterpool;
   merge_cmd_baton.merge_options = merge_options;
   merge_cmd_baton.diff3_cmd = diff3_cmd;
+  merge_cmd_baton.invoke_diff3_cmd = invoke_diff3_cmd;
   merge_cmd_baton.use_sleep = use_sleep;
 
   /* Do we already know the specific subtrees with mergeinfo we want
@@ -9805,7 +9819,6 @@ do_merge(apr_hash_t **modified_subtrees,
       if ((strcmp(source->loc1->url, source->loc2->url) == 0)
           && (source->loc1->rev == source->loc2->rev))
         continue;
-
       /* Establish RA sessions to our URLs, reuse where possible. */
       SVN_ERR(ensure_ra_session_url(&ra_session1, source->loc1->url,
                                     target->abspath, ctx, scratch_pool));

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/switch.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/switch.c Tue Nov 12 14:31:11 2013
@@ -106,6 +106,7 @@ switch_internal(svn_revnum_t *result_rev
   svn_ra_session_t *ra_session;
   svn_revnum_t revnum;
   const char *diff3_cmd;
+  const char *invoke_diff3_cmd;
   apr_hash_t *wcroot_iprops;
   apr_array_header_t *inherited_props;
   svn_boolean_t use_commit_times;
@@ -134,6 +135,17 @@ switch_internal(svn_revnum_t *result_rev
 
   if (diff3_cmd != NULL)
     SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, pool));
+  else
+    /* Get the external invoke_diff3_cmd, if any. */
+    svn_config_get(cfg, &invoke_diff3_cmd, SVN_CONFIG_SECTION_HELPERS,
+                   SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD, NULL);
+
+  if (diff3_cmd != NULL)
+    SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, pool));
+  else
+    if (invoke_diff3_cmd != NULL)
+      SVN_ERR(svn_path_cstring_to_utf8(&invoke_diff3_cmd, invoke_diff3_cmd, pool));
+
 
   /* See if the user wants last-commit timestamps instead of current ones. */
   SVN_ERR(svn_config_get_bool(cfg, &use_commit_times,
@@ -312,7 +324,8 @@ switch_internal(svn_revnum_t *result_rev
                                     use_commit_times, depth,
                                     depth_is_sticky, allow_unver_obstructions,
                                     server_supports_depth,
-                                    diff3_cmd, preserved_exts,
+                                    diff3_cmd, invoke_diff3_cmd,
+                                    preserved_exts,
                                     svn_client__dirent_fetcher, &dfb,
                                     conflicted_paths ? record_conflict : NULL,
                                     conflicted_paths,

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/update.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/update.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_client/update.c Tue Nov 12 14:31:11 2013
@@ -226,7 +226,8 @@ update_internal(svn_revnum_t *result_rev
   svn_revnum_t revnum;
   svn_boolean_t use_commit_times;
   svn_boolean_t clean_checkout = FALSE;
-  const char *diff3_cmd;
+  const char *diff3_cmd = NULL;
+  const char *invoke_diff3_cmd = NULL;
   apr_hash_t *wcroot_iprops;
   svn_opt_revision_t opt_rev;
   svn_ra_session_t *ra_session;
@@ -332,13 +333,24 @@ update_internal(svn_revnum_t *result_rev
   /* check whether the "clean c/o" optimization is applicable */
   SVN_ERR(is_empty_wc(&clean_checkout, local_abspath, anchor_abspath, pool));
 
-  /* Get the external diff3, if any. */
+ /* Get the external *_diff3_cmd, if any. 
+     Precedence: If there is no invoke_diff3_cmd on the cmd line,
+     check if there is a diff3-cmd in the config file.  If there is,
+     do not check invoke_diff3_cmd in the config file.*/
   svn_config_get(cfg, &diff3_cmd, SVN_CONFIG_SECTION_HELPERS,
                  SVN_CONFIG_OPTION_DIFF3_CMD, NULL);
 
   if (diff3_cmd != NULL)
     SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, pool));
-
+  else
+    {
+      svn_config_get(cfg, &invoke_diff3_cmd, SVN_CONFIG_SECTION_HELPERS,
+                     SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD, NULL);
+      if (invoke_diff3_cmd != NULL)
+        SVN_ERR(svn_path_cstring_to_utf8(&invoke_diff3_cmd, 
+                                         invoke_diff3_cmd, pool));
+    }
+ 
   /* See if the user wants last-commit timestamps instead of current ones. */
   SVN_ERR(svn_config_get_bool(cfg, &use_commit_times,
                               SVN_CONFIG_SECTION_MISCELLANY,
@@ -429,7 +441,8 @@ update_internal(svn_revnum_t *result_rev
                                     adds_as_modification,
                                     server_supports_depth,
                                     clean_checkout,
-                                    diff3_cmd, preserved_exts,
+                                    diff3_cmd, invoke_diff3_cmd,
+                                    preserved_exts,
                                     svn_client__dirent_fetcher, &dfb,
                                     conflicted_paths ? record_conflict : NULL,
                                     conflicted_paths,

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/deprecated.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/deprecated.c Tue Nov 12 14:31:11 2013
@@ -3492,6 +3492,7 @@ svn_wc_get_update_editor4(const svn_delt
                               server_performs_filtering,
                               clean_checkout,
                               diff3_cmd,
+                              NULL,
                               preserved_exts,
                               fetch_dirents_func, fetch_dirents_baton,
                               conflict_func, conflict_baton,
@@ -3676,6 +3677,7 @@ svn_wc_get_switch_editor4(const svn_delt
                               allow_unver_obstructions,
                               server_performs_filtering,
                               diff3_cmd,
+                              NULL,
                               preserved_exts,
                               fetch_dirents_func, fetch_dirents_baton,
                               conflict_func, conflict_baton,

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/externals.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/externals.c Tue Nov 12 14:31:11 2013
@@ -402,7 +402,8 @@ struct edit_baton
   /* Information from the caller */
   svn_boolean_t use_commit_times;
   const apr_array_header_t *ext_patterns;
-  const char *diff3cmd;
+  const char *diff3_cmd;
+  const char *invoke_diff3_cmd;
 
   const char *url;
   const char *repos_root_url;
@@ -813,7 +814,8 @@ close_file(void *file_baton,
                                                    eb->original_revision,
                                                    *eb->target_revision,
                                                    eb->propchanges,
-                                                   eb->diff3cmd,
+                                                   eb->diff3_cmd,
+                                                   eb->invoke_diff3_cmd,
                                                    eb->cancel_func,
                                                    eb->cancel_baton,
                                                    pool, pool));
@@ -984,6 +986,7 @@ svn_wc__get_file_external_editor(const s
                                  apr_array_header_t *iprops,
                                  svn_boolean_t use_commit_times,
                                  const char *diff3_cmd,
+                                 const char *invoke_diff3_cmd,
                                  const apr_array_header_t *preserved_exts,
                                  const char *record_ancestor_abspath,
                                  const char *recorded_url,
@@ -1021,7 +1024,8 @@ svn_wc__get_file_external_editor(const s
 
   eb->use_commit_times = use_commit_times;
   eb->ext_patterns = preserved_exts;
-  eb->diff3cmd = diff3_cmd;
+  eb->diff3_cmd = diff3_cmd;
+  eb->invoke_diff3_cmd = invoke_diff3_cmd;
 
   eb->record_ancestor_abspath = apr_pstrdup(edit_pool,record_ancestor_abspath);
   eb->recorded_repos_relpath = svn_uri_skip_ancestor(repos_root_url, recorded_url,

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/update_editor.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/update_editor.c Tue Nov 12 14:31:11 2013
@@ -223,6 +223,10 @@ struct edit_baton
      internal merge code is used). */
   const char *diff3_cmd;
 
+  /* External custom invoke diff3 to use for merges (can be null, in
+     which case internal merge code is used). */
+  const char *invoke_diff3_cmd;
+
   /* Externals handler */
   svn_wc_external_update_t external_func;
   void *external_baton;
@@ -3900,6 +3904,7 @@ svn_wc__perform_file_merge(svn_skel_t **
                            svn_revnum_t target_revision,
                            const apr_array_header_t *propchanges,
                            const char *diff3_cmd,
+                           const char *invoke_diff3_cmd,
                            svn_cancel_func_t cancel_func,
                            void *cancel_baton,
                            apr_pool_t *result_pool,
@@ -3966,20 +3971,21 @@ svn_wc__perform_file_merge(svn_skel_t **
   /* Merge the changes from the old textbase to the new
      textbase into the file we're updating.
      Remember that this function wants full paths! */
-  SVN_ERR(svn_wc__internal_merge(&work_item,
-                                 conflict_skel,
-                                 &merge_outcome,
-                                 db,
-                                 merge_left,
-                                 new_text_base_tmp_abspath,
-                                 local_abspath,
-                                 wri_abspath,
-                                 oldrev_str, newrev_str, mine_str,
-                                 old_actual_props,
-                                 FALSE /* dry_run */,
-                                 diff3_cmd, NULL, propchanges,
-                                 cancel_func, cancel_baton,
-                                 result_pool, scratch_pool));
+  SVN_ERR(svn_wc__internal_merge1(&work_item,
+                                  conflict_skel,
+                                  &merge_outcome,
+                                  db,
+                                  merge_left,
+                                  new_text_base_tmp_abspath,
+                                  local_abspath,
+                                  wri_abspath,
+                                  oldrev_str, newrev_str, mine_str,
+                                  old_actual_props,
+                                  FALSE /* dry_run */,
+                                  diff3_cmd, invoke_diff3_cmd,
+                                  NULL, propchanges,
+                                  cancel_func, cancel_baton,
+                                  result_pool, scratch_pool));
 
   *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
   *found_conflict = (merge_outcome == svn_wc_merge_conflict);
@@ -4138,6 +4144,7 @@ merge_file(svn_skel_t **work_items,
                                          *eb->target_revision,
                                          fb->propchanges,
                                          eb->diff3_cmd,
+                                         eb->invoke_diff3_cmd,
                                          eb->cancel_func, eb->cancel_baton,
                                          result_pool, scratch_pool));
     } /* end: working file exists and has mods */
@@ -4831,6 +4838,7 @@ make_editor(svn_revnum_t *target_revisio
             svn_wc_external_update_t external_func,
             void *external_baton,
             const char *diff3_cmd,
+            const char *invoke_diff3_cmd,
             const apr_array_header_t *preserved_exts,
             const svn_delta_editor_t **editor,
             void **edit_baton,
@@ -4901,6 +4909,7 @@ make_editor(svn_revnum_t *target_revisio
   eb->external_func            = external_func;
   eb->external_baton           = external_baton;
   eb->diff3_cmd                = diff3_cmd;
+  eb->invoke_diff3_cmd         = invoke_diff3_cmd;
   eb->cancel_func              = cancel_func;
   eb->cancel_baton             = cancel_baton;
   eb->conflict_func            = conflict_func;
@@ -5107,6 +5116,7 @@ svn_wc__get_update_editor(const svn_delt
                           svn_boolean_t server_performs_filtering,
                           svn_boolean_t clean_checkout,
                           const char *diff3_cmd,
+                          const char *invoke_diff3_cmd,
                           const apr_array_header_t *preserved_exts,
                           svn_wc_dirents_func_t fetch_dirents_func,
                           void *fetch_dirents_baton,
@@ -5131,7 +5141,8 @@ svn_wc__get_update_editor(const svn_delt
                      fetch_dirents_func, fetch_dirents_baton,
                      conflict_func, conflict_baton,
                      external_func, external_baton,
-                     diff3_cmd, preserved_exts, editor, edit_baton,
+                     diff3_cmd, invoke_diff3_cmd,
+                     preserved_exts, editor, edit_baton,
                      result_pool, scratch_pool);
 }
 
@@ -5150,6 +5161,7 @@ svn_wc__get_switch_editor(const svn_delt
                           svn_boolean_t allow_unver_obstructions,
                           svn_boolean_t server_performs_filtering,
                           const char *diff3_cmd,
+                          const char *invoke_diff3_cmd,
                           const apr_array_header_t *preserved_exts,
                           svn_wc_dirents_func_t fetch_dirents_func,
                           void *fetch_dirents_baton,
@@ -5178,7 +5190,8 @@ svn_wc__get_switch_editor(const svn_delt
                      fetch_dirents_func, fetch_dirents_baton,
                      conflict_func, conflict_baton,
                      external_func, external_baton,
-                     diff3_cmd, preserved_exts,
+                     diff3_cmd, invoke_diff3_cmd,
+                     preserved_exts,
                      editor, edit_baton,
                      result_pool, scratch_pool);
 }

Modified: subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/wc.h?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/libsvn_wc/wc.h Tue Nov 12 14:31:11 2013
@@ -756,6 +756,7 @@ svn_wc__perform_file_merge(svn_skel_t **
                            svn_revnum_t target_revision,
                            const apr_array_header_t *propchanges,
                            const char *diff3_cmd,
+                           const char *invoke_diff3_cmd,
                            svn_cancel_func_t cancel_func,
                            void *cancel_baton,
                            apr_pool_t *result_pool,

Modified: subversion/branches/invoke-diff-merge-feature/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/svn/cl.h?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/svn/cl.h (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/svn/cl.h Tue Nov 12 14:31:11 2013
@@ -542,14 +542,15 @@ svn_cl__merge_file_externally(const char
 /* As svn_cl__merge_file_externally, but for the invoke_diff3_cmd
    selected merge tool  */
 svn_error_t *
-svn_cl__invoke_diff3_cmd_file_externally(const char *base_path,
-                                         const char *their_path,
-                                         const char *my_path,
-                                         const char *merged_path,
-                                         const char *wc_path,
-                                         apr_hash_t *config,
-                                         svn_boolean_t *remains_in_conflict,
-                                         apr_pool_t *pool);
+svn_cl__invoke_diff3_cmd_externally(const char *base_path,
+                                    const char *their_path,
+                                    const char *my_path,
+                                    const char *merged_path,
+                                    const char *wc_path,
+                                    apr_hash_t *config,
+                                    svn_boolean_t *remains_in_conflict,
+                                    const char *opt_code,
+                                    apr_pool_t *pool);
 
 
 /* Like svn_cl__merge_file_externally, but using a built-in merge tool

Modified: subversion/branches/invoke-diff-merge-feature/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/svn/conflict-callbacks.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/svn/conflict-callbacks.c Tue Nov 12 14:31:11 2013
@@ -118,6 +118,10 @@ svn_cl__accept_from_word(const char *wor
   if (strcmp(word, SVN_CL__ACCEPT_LAUNCH) == 0
       || strcmp(word, "l") == 0 || strcmp(word, ":-l") == 0)
     return svn_cl__accept_launch;
+  if (strcmp(word, SVN_CL__ACCEPT_INVOKE_DIFF3_CONFIG) == 0
+      /* I'm stumped.  What is this smiley selection? */
+      || strcmp(word, "3f") == 0 || strcmp(word, ":-?") == 0)
+    return svn_cl__accept_launch;
   /* word is an invalid action. */
   return svn_cl__accept_invalid;
 }
@@ -409,6 +413,33 @@ launch_resolver(svn_boolean_t *performed
   return SVN_NO_ERROR;
 }
 
+/* Run an external merge tool, passing it the 'base', 'their', 'my' and
+ * 'merged' files in DESC. The tool to use is determined by B->config and
+ * environment variables; see svn_cl__merge_file_externally() for details.
+ *
+ * If the tool runs, set *PERFORMED_EDIT to true; if a tool is not
+ * configured or cannot run, do not touch *PERFORMED_EDIT, report the error
+ * on stderr, and return SVN_NO_ERROR; if any other error is encountered,
+ * return that error.  */
+static svn_error_t *
+invoke_diff3_resolver(svn_boolean_t *performed_edit,
+                      const svn_wc_conflict_description2_t *desc,
+                      svn_cl__interactive_conflict_baton_t *b,
+                      const char *opt_code,
+                      apr_pool_t *pool)
+{
+  SVN_ERR(svn_cl__invoke_diff3_cmd_externally(
+                                    desc->base_abspath, desc->their_abspath,
+                                    desc->my_abspath, desc->merged_file,
+                                    desc->local_abspath, b->config, NULL,
+                                    opt_code,
+                                    pool));
+  if (performed_edit)
+    *performed_edit = TRUE;
+
+  return SVN_NO_ERROR;
+}
+
 
 /* Maximum line length for the prompt string. */
 #define MAX_PROMPT_WIDTH 70
@@ -458,15 +489,7 @@ static const resolver_option_t text_conf
                                      -1 },
   { "l",  N_("launch tool"),      N_("launch external tool to resolve "
                                      "conflict  [launch]"), -1 },
-  { "3f", N_("invoke-diff3-cmd given in config file"), 
-                                  N_("use invoke-diff3 command defined in "
-                                     "the config file to resolve conflict "
-                                     "[invoke-diff3-config]"), -1 },
-  { "3c", N_("invoke-diff3-cmd given on command line"),      
-                                  N_("use invoke-diff3 tool defined in the "
-                                     "commandline to resolve conflict "
-                                     "[invoke-diff3-cmd]"), -1 },
-  { "3i", N_("interactive invoke-diff3-cmd selection"), 
+  { "i", N_("interactive invoke-diff3-cmd selection"), 
                                   N_("interactively select tool now to "
                                      "resolve conflict"), -1 },
 
@@ -747,9 +770,7 @@ handle_text_conflict(svn_wc_conflict_res
           *next_option++ = "e";
           *next_option++ = "m";
 
-          *next_option++ = "3f";
-          *next_option++ = "3c";
-          *next_option++ = "3i";
+          *next_option++ = "i";
 
           if (knows_something)
             *next_option++ = "r";
@@ -829,13 +850,11 @@ handle_text_conflict(svn_wc_conflict_res
             knows_something = TRUE;
         }
       else if (strcmp(opt->code, "m") == 0 || strcmp(opt->code, ":-g") == 0 ||
-               strcmp(opt->code, "=>-") == 0 || strcmp(opt->code, ":>.") == 0 ||
-               strcmp(opt->code, "3f") == 0 || strcmp(opt->code, "3c") == 0 ||
-               strcmp(opt->code, "3i") == 0)
+               strcmp(opt->code, "=>-") == 0 || strcmp(opt->code, ":>.") == 0)
         {
           svn_boolean_t remains_in_conflict;
           svn_error_t *err;
-
+          
           err = launch_resolver(&performed_edit, desc, b, iterpool);
           if (err)
             {
@@ -848,7 +867,6 @@ handle_text_conflict(svn_wc_conflict_res
               else
                 return svn_error_trace(err);
             }
-
           if (!performed_edit &&
               desc->base_abspath && desc->their_abspath &&
               desc->my_abspath && desc->merged_file)
@@ -919,6 +937,38 @@ handle_text_conflict(svn_wc_conflict_res
             SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
                                         _("Invalid option.\n\n")));
         }
+      else if (strcmp(opt->code, "i") == 0)
+        { /* interactively get the invoke-diff3-cmd */
+              
+          if (desc->base_abspath && desc->their_abspath &&
+              desc->my_abspath && desc->merged_file)
+            {
+              const char *answer;
+              svn_error_t *err;
+              
+              SVN_ERR(svn_cmdline_prompt_user2(&answer, 
+                                               "Enter the invoke-diff3-cmd: ", 
+                                               b->pb, iterpool));
+              err = invoke_diff3_resolver(&performed_edit, desc, b, answer, iterpool);
+              
+              if (err && err->apr_err == SVN_ERR_EXTERNAL_PROGRAM)
+                {
+                  SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, "%s\n",
+                                              err->message ? err->message :
+                                              _("Error executing the interactive, "
+                                                "invoke-diff3-cmd.\n")));
+                  svn_error_clear(err);
+                }
+              else if (err)
+                return svn_error_trace(err);
+              
+              if (performed_edit)
+                knows_something = TRUE;
+            }
+          else
+            SVN_ERR(svn_cmdline_fprintf(stderr, iterpool,
+                                        _("Invalid option.\n\n")));
+        }
       else if (opt->choice != -1)
         {
           if ((opt->choice == svn_wc_conflict_choose_mine_conflict
@@ -1323,15 +1373,15 @@ conflict_func_interactive(svn_wc_conflic
               (*result)->choice = svn_wc_conflict_choose_postpone;
               return SVN_NO_ERROR;
             }
-
-          err = svn_cl__invoke_diff3_cmd_file_externally(desc->base_abspath,
-                                              desc->their_abspath,
-                                              desc->my_abspath,
-                                              desc->merged_file,
-                                              desc->local_abspath,
-                                              b->config,
-                                              &remains_in_conflict,
-                                              scratch_pool);
+          err = svn_cl__invoke_diff3_cmd_externally(desc->base_abspath,
+                                                    desc->their_abspath,
+                                                    desc->my_abspath,
+                                                    desc->merged_file,
+                                                    desc->local_abspath,
+                                                    b->config,
+                                                    &remains_in_conflict,
+                                                    "3f",
+                                                    scratch_pool);
           if (err && err->apr_err == SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL)
             {
               SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n",
@@ -1345,7 +1395,7 @@ conflict_func_interactive(svn_wc_conflic
             {
               SVN_ERR(svn_cmdline_fprintf(stderr, scratch_pool, "%s\n",
                                           err->message ? err->message :
-                                          _("Error running invoke-diff2-cmd tool;"
+                                          _("Error running invoke-diff3-cmd tool;"
                                             " leaving all conflicts.")));
               b->external_failed = TRUE;
               return svn_error_trace(err);

Modified: subversion/branches/invoke-diff-merge-feature/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/svn/svn.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/svn/svn.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/svn/svn.c Tue Nov 12 14:31:11 2013
@@ -251,21 +251,21 @@ const apr_getopt_option_t svn_cl__option
   {"ignore-externals", opt_ignore_externals, 0,
                     N_("ignore externals definitions")},
   {"diff3-cmd",     opt_merge_cmd, 1, N_("use ARG as merge command")},
-  {"invoke-diff3-cmd", opt_invoke_diff_cmd, 1, 
-                   N_("use ARG as format string for external merge program\n"
+  {"invoke-diff3-cmd", opt_diff3_cmd, 1, 
+                    N_("use ARG as format string for external merge program\n"
                       "                             "
                       "invocation.  Substitutions: \n" 
                       "                             "
                       "  %svn_mine  'mine' file\n"
                       "                             "
                       "  %svn_yours 'yours' file\n"
-                      "                "
+                      "                             "
                       "  %svn_base  'base' file\n"
-                      "                "
+                      "                             "
                       "  %svn_label_mine   label of the 'mine file\n"
-                      "                "
+                      "                             "
                       "  %svn_label_yours  label of the 'yours' file\n"
-                      "                "
+                      "                             "
                       "  %svn_label_base   label of the 'mine file\n"
                       "                             "
                       "See 'help diff' for example usage.")},

Modified: subversion/branches/invoke-diff-merge-feature/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/invoke-diff-merge-feature/subversion/svn/util.c?rev=1541082&r1=1541081&r2=1541082&view=diff
==============================================================================
--- subversion/branches/invoke-diff-merge-feature/subversion/svn/util.c (original)
+++ subversion/branches/invoke-diff-merge-feature/subversion/svn/util.c Tue Nov 12 14:31:11 2013
@@ -174,50 +174,61 @@ svn_cl__merge_file_externally(const char
 }
 
 svn_error_t *
-svn_cl__invoke_diff3_cmd_file_externally(const char *base_path,
-                                         const char *their_path,
-                                         const char *my_path,
-                                         const char *merged_path,
-                                         const char *wc_path,
-                                         apr_hash_t *config,
-                                         svn_boolean_t *remains_in_conflict,
-                                         apr_pool_t *pool)
+svn_cl__invoke_diff3_cmd_externally(const char *base_path,
+                                    const char *their_path,
+                                    const char *my_path,
+                                    const char *merged_path,
+                                    const char *wc_path,
+                                    apr_hash_t *config,
+                                    svn_boolean_t *remains_in_conflict,
+                                    const char *opt_code,
+                                    apr_pool_t *pool)
 {
   char *invoke_diff3_cmd;
   /* Error if there is no editor specified */
   /* not sure how or where to set this, but it loads on fail... so... FIXME? */
-  if (apr_env_get(&invoke_diff3_cmd, "SVN_INVOKE_DIFF3_CMD", pool) != APR_SUCCESS)
-    {
-      struct svn_config_t *cfg;
-      invoke_diff3_cmd = NULL;
-      cfg = config ? svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG) : NULL;
-      /* apr_env_get wants char **, this wants const char ** */
-      svn_config_get(cfg, (const char **)&invoke_diff3_cmd,
-                     SVN_CONFIG_SECTION_HELPERS,
-                     SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD, NULL);
-    }
 
-  if (invoke_diff3_cmd)
+  if (0 == strcmp(opt_code,"3f")) /* command in config file */
     {
-      const char *c;
+      if (apr_env_get(&invoke_diff3_cmd, "SVN_INVOKE_DIFF3_CMD", pool) != APR_SUCCESS)
+        {
+          struct svn_config_t *cfg;
+          invoke_diff3_cmd = NULL;
+          cfg = config ? svn_hash_gets(config, SVN_CONFIG_CATEGORY_CONFIG) : NULL;
+          /* apr_env_get wants char **, this wants const char ** */
+          svn_config_get(cfg, (const char **)&invoke_diff3_cmd,
+                         SVN_CONFIG_SECTION_HELPERS,
+                         SVN_CONFIG_OPTION_INVOKE_DIFF3_CMD, NULL);
+        }
 
-      for (c = invoke_diff3_cmd; *c; c++)
-        if (!svn_ctype_isspace(*c))
-          break;
+      if (invoke_diff3_cmd)
+        {
+          const char *c;
+
+          for (c = invoke_diff3_cmd; *c; c++)
+            if (!svn_ctype_isspace(*c))
+              break;
 
-      if (! *c)
+          if (! *c)
+            return svn_error_create
+              (SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL, NULL,
+               _("The SVN_INVOKE_DIFF3_TOOL environment variable is empty or "
+                 "consists solely of whitespace. Expected a shell command.\n"));
+        }
+      else
         return svn_error_create
           (SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL, NULL,
-           _("The SVN_INVOKE_DIFF3_TOOL environment variable is empty or "
-             "consists solely of whitespace. Expected a shell command.\n"));
+           _("The environment variable SVN_INVOKE_DIFF3_TOOL and the invoke-diff3-cmd run-time "
+             "configuration option were not set.\n"));
     }
-  else
-      return svn_error_create
-        (SVN_ERR_CL_NO_EXTERNAL_MERGE_TOOL, NULL,
-         _("The environment variable SVN_INVOKE_DIFF3_TOOL and the invoke-diff3-cmd run-time "
-           "configuration option were not set.\n"));
-
-  {
+    /* if (0 == strcmp(opt_code,"3c") /\* command in on command line *\/ */
+    /*   { /\* nothing yet *\/} */
+    /*   else */
+    else
+      {
+        invoke_diff3_cmd = apr_pstrdup(pool, opt_code);
+      }
+    {
     const char ** cmd;
 
     apr_pool_t *scratch_pool = svn_pool_create(pool); 



Mime
View raw message