Charles Acknin <> (cacknin)

Found Patch
r865567 r874052, r871956, r871902, r870019, r870015, r869892, r869466, r869443, r869442, r868676, r868673, r868630, r868627, r868604, r867398, r867374, r867373, r867367, r867366, r867302, r867301, r867299, r867297, r867296, r867227, r867223, r867161, r867134, r867128, r867027, r867010, r867009, r866989, r866971, r866902, r866835, r866804, r866803, r866572, r866554, r866401, r866400, r866399, r866390, r866343, r866284, r866140, r866137, r866135, r866122, r866114, r866109, r866030, r866029, r866028, r865990, r865989, r865967, r865960, r865846, r865843, r865842, r865832, r865813, r865738, r865736

r865567 | dlr | 2007-06-21 21:55:00 +0000 (Thu, 21 Jun 2007)

* subversion/libsvn_ra_serf/README: Clarify how to enable ra_serf.

Found by: Charles Acknin <>

r865736 | cacknin | 2007-07-05 22:17:36 +0000 (Thu, 05 Jul 2007)

* COMMITTERS: Add myself to the 'Experimental branches' section, branch

r865738 | cacknin | 2007-07-05 22:28:35 +0000 (Thu, 05 Jul 2007)

Create branch for the 'svnpatch' format work.

r865813 | cacknin | 2007-07-14 17:10:00 +0000 (Sat, 14 Jul 2007)

Install --svnpatch command line option into 'svn diff' and provide
libsvn_client callbacks with svnpatch-format facilities when needed.

* subversion/svn/cl.h
  (svn_cl__longopt_t, svn_cl__opt_state_t): add command line option to enable
  svnpatch, and fix typo with 'svn_cl__no_diff_deleted'.

* subversion/libsvn_client/client.h
  Add SVN_CLIENT_SVNPATCH_VERSION macro that we need in the header.

* subversion/svn/main.c
  (svn_cl__options): provide the command line with svnpatch support, and fix
  typo with 'svn_cl__no_diff_deleted'.

* subversion/svn/diff-cmd.c
  (svn_cl__diff): enable svnpatch when calling svn_client_diff[_peg]4.

* notes/svnpatch
  Import the design document.

* subversion/include/svn_client.h
  (svn_client_diff4, svn_client_diff_peg4): add 'svnpatch_format' argument to
  the signatures.

* subversion/libsvn_wc/diff.c
  (dir_diff): new function similar to what file_diff() does for files.
  (directory_elements_diff): call dir_diff() when svnpatch'ing.

* subversion/libsvn_client/diff.c
  (diff_cmd_baton): provide the structure with svnpatch_format boolean type and
  an svnpatch buffer.
  (svnpatch_append): new function that helps to generate the svnpatch buffer.
  (diff_props_changed, diff_content_changed, diff_file_added,
  diff_file_deleted_with_diff, diff_file_deleted_no_diff, diff_dir_added,
  diff_dir_deleted): turn on sketchy svnpatch creation calls.
  (do_diff): allocate some room for svnpatch bytes, and output when using
  svnpatch_format before returning.
  (svn_client_diff4, svn_client_diff_peg4): add 'svnpatch_format' as in its
  (svn_client_diff3, svn_client_diff_peg3): disable 'svnpatch_format'

* subversion/tests/cmdline/
  (diff_svnpatch): new test to illustrate 'svn diff --svnpatch' behaviour

r865832 | cacknin | 2007-07-16 15:35:22 +0000 (Mon, 16 Jul 2007)

Add svn_stringbuf_appendformat, similar to svn_stringbuf_append{str,cstr,bytes}
except it uses variable-length argument like printf, and make use of it.

* subversion/include/svn_string.h
* subversion/libsvn_subr/svn_string.c
  (svn_stringbuf_appendformat): new function using variable-length argument,
  wrapping svn_stringbuf_append() + apr_pvsprintf().

* subversion/libsvn_client/diff.c
  (svnpatch_append): remove the function, useless against
  (diff_content_changed, diff_file_added, diff_file_deleted_with_diff,
  diff_file_deleted_no_diff, diff_dir_added, diff_dir_deleted): use
  svn_stringbuf_appendformat() now on when playing with the svnpatch buffer.
  (diff_props_changed): move svnpatch-buffer edition deeper.
  (display_prop_diffs): add svnpatch_format and svnpatch_buff arguments to
  satisfy svnpatch-diff needs, and edit svnpatch-buffer here.

r865842 | cacknin | 2007-07-17 13:28:55 +0000 (Tue, 17 Jul 2007)

Import and tweak some ra_svn marshalling routines to manipulate svnpatch output

* subversion/include/svn_client.h
  (clnt_svnpatch): add defgroup for svnpatch routines.

* subversion/include/svn_client.h
* subversion/libsvn_client/util.c
  (svn_client_write_number, svn_client_write_string, svn_client_write_cstring,
  svn_client_write_word, svn_client_write_proplist, svn_client_start_list,
  svn_client_end_list, svn_client_write_tuple, svn_client_write_cmd): add
  functions to manipulate svnpatch output.
  (vwrite_tuple): add local function to format output.

* subversion/libsvn_client/diff.c
  (do_diff): no need to output the header when the svnpatch is empty.

r865843 | cacknin | 2007-07-17 14:10:30 +0000 (Tue, 17 Jul 2007)

* subversion/include/svn_string.h
* subversion/libsvn_subr/svn_string.c
* subversion/libsvn_client/util.c
  Rename svn_stringbuf_appendformat to svn_stringbuf_appendf.

* subversion/libsvn_client/diff.c
  Rename svn_stringbuf_appendformat to svn_stringbuf_appendf and
  svnpatch_buff to svnpatch_buf.

Suggested by: Daniel Rall
              Erik Hülsmann

r865846 | cacknin | 2007-07-17 16:13:26 +0000 (Tue, 17 Jul 2007)

* subversion/tests/libsvn_subr/string-test.c
  (test24): add new test for svn_stringbuf_appendf().

r865960 | malcolm | 2007-07-30 13:09:20 +0000 (Mon, 30 Jul 2007)

* subversion/include/svn_io.h
  (svn_io_open_unique_file2): ensure the function's docstring is clear
    about how it opens the file -- read/write and not just read.

Patch by: cacknin
Suggested by: glasser

r865967 | cacknin | 2007-07-31 01:52:55 +0000 (Tue, 31 Jul 2007)

Move svnpatch generation from libsvn_client to libsvn_wc and get 'svn
diff --svnpatch' up and running for wc/wc diff.

What happens now in a wc/wc diff is libsvn_client opens an apr file
handler it passes to libsvn_wc to get filled up with ra_svn editor
commands, in clear-text.  It is libsvn_client's responsibility to
compute the temp file, that is, compress and base64'encode before
dumping to the outfile, likely stdout.

* subversion/include/svn_wc.h
  (svn_wc_diff4): provide with svnpatch facility
  (svn_wc_diff3): deprecate
  (svn_wc_write_number, svn_wc_write_string, svn_wc_write_cstring,
  svn_wc_write_word, svn_wc_write_proplist, svn_wc_start_list,
  svn_wc_end_list, svn_wc_write_tuple, svn_wc_write_cmd): svnpatch
  marshalling functions moved from libsvn_client (see below).

* subversion/include/svn_client.h
  (svn_client_write_number, svn_client_write_string,
  svn_client_write_cstring, svn_client_write_word,
  svn_client_write_proplist, svn_client_start_list, svn_client_end_list,
  svn_client_write_tuple, svn_client_write_cmd): move and tweak those
  functions into libsvn_wc (see above).

* subversion/libsvn_wc/diff.c
  (edit_baton, make_editor_baton): provide structure with a stream
  handler to an svnpatch_file, a list of diffables, and a token holder.
  (file_baton, dir_baton): provide structure with a token field.
  (make_token): new function to create tokens from edit_baton token.
  (make_dir_baton, make_file_baton): provide with token arg.
  (file_diff, dir_diff, directory_elements_diff): add some lines to fill
  our 'diffables' array.
  (svnpatch_open_root, svnpatch_open_directory,
  svnpatch_close_directory, svnpatch_add_directory,
  svnpatch_change_dir_prop, svnpatch_open_file, svnpatch_add_file,
  svnpatch_close_file, svnpatch_change_file_prop,
  svnpatch_delete_entry,svnpatch_apply_textdelta, svnpatch_close_edit):
  add svnpatch-specific editor functions.
  (get_svnpatch_diff_editor): initiate an svnpatch diff editor against
  static callbacks.
  (open_root, delete_entry, add_directory, open_directory, add_file,
  open_file, close_edit): disable token facility of
  (path_driver_cb_baton): new struct, baton to the callback func
  (path_driver_cb_func): new function, implements
  svn_delta_path_driver_cb_func_t to drive the editor.
  (svn_wc_diff4): new version deprecating svn_wc_diff3 with svnpatch
  (svn_wc_diff3): now calls svn_wc_diff4 with svnpatch disabled.

* subversion/libsvn_wc/util.c
  (svn_wc_write_number, svn_wc_write_string, svn_wc_write_cstring,
  svn_wc_write_word, svn_wc_write_proplist, svn_wc_start_list,
  svn_wc_end_list, svn_wc_write_tuple, svn_wc_write_cmd):
  move implementations from libsvn_client, and tweak to fit with a
  stream use.

* subversion/libsvn_client/util.c:
  (svn_client_write_number, svn_client_write_string,
  svn_client_write_cstring, svn_client_write_word,
  svn_client_write_proplist, svn_client_start_list, svn_client_end_list,
  svn_client_write_tuple, svn_client_write_cmd): move to libsvn_wc.

* subversion/libsvn_client/diff.c:
  (display_prop_diffs, diff_cmd_baton, diff_props_changed,
  diff_content_changed, diff_file_added, diff_file_deleted_with_diff,
  diff_file_deleted_no_diff, diff_dir_added, diff_dir_deleted): take
  away svnpatch-buffer generation.  We're now doing this directly from
  (dump_svnpatch): new function
  (diff_wc_wc): switch to the use of svn_wc_diff4.
  (do_diff): invoke dump_svnpatch() before exit.
  (svn_client_diff4, svn_client_diff_peg4): open a unique svnpatch temp
  file before passing the handler to do_diff()

r865989 | cacknin | 2007-08-01 15:27:54 +0000 (Wed, 01 Aug 2007)

* subversion/libsvn_wc/diff.c
  (file_diff): clarify a comment and fix bug when file is copied.

* subversion/tests/cmdline/
  (diff_svnpatch): update the test with clear-text commands, using
  python libs to zlib-compress and base64-encode to compare.

r865990 | cacknin | 2007-08-01 16:39:33 +0000 (Wed, 01 Aug 2007)

* subversion/tests/cmdline/
  (diff_svnpatch): fix the expected_output array with a
  one-line-\n-terminated strings map workaround (thanks glasser!)

r866028 | cacknin | 2007-08-05 18:25:53 +0000 (Sun, 05 Aug 2007)

This is the implementation of repos/wc svnpatch diff.  Although repos/wc
diff is mid-repos-related, libsvn_wc is the target library here.  This
allows some abstraction towards RA protocols.

(repos/wc diff-test to come)

* subversion/include/svn_wc.h
  (svn_wc_get_diff_editor4): add svnpatch_file argument to initiate an
  svnpatch-enabled edit baton.

* subversion/libsvn_wc/diff.c
  (edit_baton): add an svn_delta_editor_t diff_editor handler to
  svnpatch editor functions.
  (file_baton, make_file_baton): add a dir_baton pointer to the file's
  parent dir.
  (directory_elements_diff): move dir_diff() call to some more
  appropriate place, and add break when the directory is scheduled for
  (report_wc_file_as_added): address a file addition against svnpatch.
  (report_wc_directory_as_added): add an svn_wc_entry_t argument needed
  to deal with prop changes, and invoke svnpatch diff editor functions.
  (path_driver_cb_baton): add a dir_baton field to implement a
  workaround (see docstring).
  (path_driver_cb_func): move to some place more appropriate in the
  same file.
  (open_root, delete_entry, add_directory, open_directory, add_file,
  open_file): dump bytes to svnpatch temp-file;  no svnpatch diff editor
  function calls here to keep things clean.
  (close_directory): address svnpatch.  This is close to what we have in
  svn_wc_diff4 and might be factorized soon.
  (close_file, change_file_prop, change_dir_prop, close_edit): invoke
  svnpatch diff editor functions.
  (svn_wc_get_diff_editor4): add svnpatch_file new argument.
  (svn_wc_get_diff_editor3): update 4's new argument.
  (svn_wc_diff4): ensure token initialization and disable

* subversion/libsvn_client/diff.c
  (diff_repos_wc): update the call to svn_wc_get_diff_editor4 with
  svnpatch_file argument.

r866029 | cacknin | 2007-08-05 19:08:45 +0000 (Sun, 05 Aug 2007)

Initialized merge tracking via "svnmerge" with revisions "1-25663" from

r866030 | cacknin | 2007-08-05 20:25:47 +0000 (Sun, 05 Aug 2007)

Merged revisions 25664-25955 via svnmerge from

r866109 | cacknin | 2007-08-10 20:24:24 +0000 (Fri, 10 Aug 2007)

Add a few (sub)tests for wc/repos svnpatch diffs and fix binary support.

* subversion/libsvn_wc/diff.c
  (directory_elements_diff): avoid including a path twice to the
  diffables' array.
  (transmit_svndiff): new static function that helps generating svndiff
  editor commands (apply-textdelta + textdelta-chunk/end) from roughly
  only the path of the file and an editor.
  (report_wc_file_as_added): avoid segfault on a null pointer.
  (delete_entry): also consider eb->reverse order for directories.
  (add_file): write add-file command to svnpatch.
  (close_file): fix binary support and make use of transmit_svndiff().

* subversion/tests/cmdline/
  (diff_svnpatch): add wc/repos tests and focus on svnpatch block checks
  instead of considering unidiff too.

r866114 | cacknin | 2007-08-10 22:36:13 +0000 (Fri, 10 Aug 2007)

Merged revisions 25956-26036 via svnmerge from

r866122 | cacknin | 2007-08-12 21:24:01 +0000 (Sun, 12 Aug 2007)

A bunch of bytes to implement the repos/repos svnpatch diff.

* subversion/libsvn_wc/diff.c
  (transmit_svndiff): use svn_stream_empty instead of an empty file to
  generate diffs against null.
  (svnpatch_open_root, svnpatch_open_directory, svnpatch_add_directory,
  directory_elements_diff): fix depth argument when calling
  make_dir_baton (calls broken from a previous merge).

* subversion/libsvn_client/repos_diff.c
  (SAVEPOINT_RELEASED): new macro to deal with released savepoints.
  (edit_baton): provide with svnpatch members, token holder, a
  diff_editor, and a savepoint offset.
  (dir_baton, file_baton): provide with token and savepoint members.
  (make_token): new function to generate tokens.
  (make_dir_baton): add token argument
  (make_file_baton): add token and parent_baton argument.
  (svnpatch_savepoint, svnpatch_release_savepoint, svnpatch_rollback):
  new set of functions to introduce savepoints and rollback facility to
  (svnpatch_close_file, svnpatch_change_file_prop,
  svnpatch_delete_entry, svndiff_write_handler, svndiff_close_handler,
  svnpatch_apply_textdelta, svnpatch_close_edit): add editor functions
  to deal with svnpatch serialiazed editor commands to repos/repos
  (transmit_svndiff): new function to short-drive an editor in dumping
  txdelta editor commands.
  (open_root, delete_entry, add_directory, open_directory, add_file,
  open_file, close_file, change_file_prop, change_dir_prop): set up
  support for svnpatch.
  (get_svnpatch_diff_editor): new command to create a diff editor.
  (svn_client__get_diff_editor): set up support for svnpatch and call

* subversion/libsvn_client/client.h
  (svn_client__get_diff_editor): add svnpatch_file argument.

* subversion/libsvn_client/merge.c
  (do_merge): update the call to svn_client__get_diff_editor with
  svnpatch support disabled.

* subversion/libsvn_client/diff.c
  (diff_repos_repos): update the call to svn_client__get_diff_editor to
  support svnpatch.

r866135 | cacknin | 2007-08-13 21:37:14 +0000 (Mon, 13 Aug 2007)

Fix some repos/wc discrepancies and add two repos/repos tests.

* subversion/libsvn_wc/diff.c:
  (include apr_md5.h to calculate file checksums)
  (transmit_prop_deltas): new function to help dump property changes
  editor commands, in repos/wc diffs.
  (svnpatch_delete_entry): test reverse_order before writing command.
  (path_driver_cb_func): wrap a call to svnpatch_delete_entry with a
  fancy workaround.
  (add_directory): fix token creation and make use of reverse_order to
  deduce between add or del.
  (close_directory, close_file): make use of transmit_prop_deltas.
  (close_file): overwrite the text_checksum argument with a new one we
  calculate with svn_io_file_checksum against base-text or temp file.
  (add_file): check against reverse_order too, for accuracy.
  (change_dir_prop, change_file_prop): remove calls to diff_editor
  functions; we're doing this in close_directory and close_file now
  since we need some processing before being able to choose the right

* subversion/tests/cmdline/
  (diff_svnpatch): a two repos/repos tests, and fix some previous
  repos/wc tests.

r866137 | cacknin | 2007-08-13 21:48:38 +0000 (Mon, 13 Aug 2007)

Merged revisions 26037-26061 via svnmerge from

r866140 | cacknin | 2007-08-14 02:17:50 +0000 (Tue, 14 Aug 2007)

Empty skeleton in preparation for 'svn patch' implementation.

* subversion/svn/cl.h
  (svn_cl__opt_state_t): rephrase svnpatch opt docstring to fit width.
  (svn_opt_subcommand_t): add svn_cl__patch subcommand declaration.

* subversion/svn/main.c
  (svn_cl__cmd_table): add a new patch element to subcommand dispatch
  table, i.e. the cmdline help.

* subversion/svn/patch-cmd.c:
  New file, cmdline implementation of the new 'patch' subcommand.

* subversion/include/svn_client.h
  (svn_client_patch): new function, the client's interface to 'patch'.

* subversion/libsvn_client/patch.c:
  New file, wraps the (yet to come) wc 'patch' implementation.

r866284 | cacknin | 2007-08-20 18:42:44 +0000 (Mon, 20 Aug 2007)

Implementation of 'svn patch' guts.

* subversion/svn/patch-cmd.c
  (svn_cl__patch): set up the command line notifier for 'svn patch'.

* subversion/svn/main.c
  (svn_cl__cmd_table): provide 'patch' with svn_cl__force_opt option.

* subversion/include/svn_client.h
  (svn_client_patch): add the 'force' argument.

* subversion/include/svn_wc.h
  (svn_wc_read_item, svn_wc_parse_tuple, svn_wc_read_tuple,
  svn_wc_apply_patch): New functions to deal with svnpatch-reading.

* subversion/libsvn_wc/util.c
  (readbuf_getchar_skip_whitespace, read_string, read_item,
  vparse_tuple): New helper functions.
  (svn_wc_read_item, svn_wc_parse_tuple, svn_wc_read_tuple): New
  functions to read Editor Commands chunks.

* subversion/libsvn_wc/patch.c
  Similar to what libsvn_ra_svn/editorp.c does with ra_svn-based
  New file.  Read Editor Commands from a decoded patch file and drive
  the editor.

* subversion/libsvn_client/patch.c
  A lot of this file was imported from both merge.c and repos_diff.c.
  (patch_cmd_baton): analogous to merge_cmd_baton.
  (patch_callbacks, merge_props_changed, merge_file_changed,
  merge_file_added, merge_file_deleted, merge_dir_added,
  merge_dir_deleted): add svn_wc_diff_callbacks2_t functions to merge
  changes from the (svn)patch.
  (merge_delete_notify_baton_t, merge_delete_notify_func):
  Notify-wrapper and its baton from merge.c.
  (edit_baton, dir_baton, file_baton, make_dir_baton, make_file_baton,
  make_editor_baton): new baton structures/functions dealing with tree
  (create_empty_file, get_path_access, get_parent_access,
  get_empty_file): helper functions from repos_diff.c.
  (open_root, delete_entry, add_directory, open_directory,
  add_file, open_file, window_handler, apply_textdelta, close_file,
  close_directory, change_file_prop, change_dir_prop, close_edit):
  Editor functions, imported from repos_diff.c.
  (extract_svnpatch): Pull out the svnpatch block from patches and
  decode data (uncompress + base64-decode).
  (svn_client_patch): add 'force' flag and define the function to call

r866343 | cacknin | 2007-08-23 19:43:12 +0000 (Thu, 23 Aug 2007)

* notes/svnpatch:
  Clarify what we're doing at the moment regarding patch application and
  Unidiff, and add a new part entitled 'patch and merge in subversion'.

* subversion/include/svn_client.h
  (svn_client_patch): fix docstring accordingly to the use.

* subversion/tests/cmdline/getopt_tests_data/svn_help_stdout:
* subversion/tests/cmdline/getopt_tests_data/svn--help_stdout:
  add the new 'patch' subcommand so that 4 and 5 both
  get a nice PASS.

r866390 | cacknin | 2007-08-25 23:29:56 +0000 (Sat, 25 Aug 2007)

Set up 'svn patch' tests in the python test-suite.

* subversion/tests/cmdline/svntest/
  (run_and_verify_patch): new function similar to siblings dedicated to
  'svn patch'.

* subversion/tests/cmdline/
  New file, hosts 'svn patch'-specific tests.

* subversion/libsvn_client/patch.c
  (merge_file_changed):  ensure merge_required initialization
  (dry_run_deletions_hash): new function as a replacement for
  svn_client__dry_run_deletions which is merge-specific.
  (delete_entry, close_directory): substitute to make use of this new
  function above.

* subversion/tests/cmdline/
  (diff_svnpatch): fix typo

r866399 | cacknin | 2007-08-26 15:47:48 +0000 (Sun, 26 Aug 2007)

Merged revisions 26062-26316 via svnmerge from

r866400 | cacknin | 2007-08-26 15:52:21 +0000 (Sun, 26 Aug 2007)

* subversion/libsvn_client/patch.c:
  (get_empty_file, merge_file_added): fix cache issue as the empty file
  is moved.

r866401 | cacknin | 2007-08-26 16:43:02 +0000 (Sun, 26 Aug 2007)

* build.conf:
  Add to the [test-scripts] section.

r866554 | cacknin | 2007-09-06 11:39:10 +0000 (Thu, 06 Sep 2007)

Merged revisions 26317-26479 via svnmerge from

r866572 | cacknin | 2007-09-08 18:00:26 +0000 (Sat, 08 Sep 2007)

Cleanup some compiler warnings and unrelated fix.

* subversion/libsvn_wc/diff.c
  (transmit_svndiff, close_file, change_file_prop, change_dir_prop):
  remove unused variables.

* subversion/libsvn_client/repos_diff.c
  (apply_textdelta): remove unused variables.

* subversion/libsvn_client/patch.c
  (get_empty_file): fix messy use of ||
  (merge_file_added): avoid useless sprintf()
  (open_directory, add_file, open_file, apply_textdelta,
  change_file_prop, change_dir_prop): remove unused variables.

* subversion/libsvn_client/diff.c
  (diff_dir_added, diff_dir_deleted): remove unused variables.

Found by: glasser
(just the "messy use of ||" and "useless sprintf()" parts.)

r866803 | cacknin | 2007-09-21 16:14:41 +0000 (Fri, 21 Sep 2007)

* subversion/tests/cmdline/
  (diff_svnpatch): fix test now that the server sends the copy-path

r866804 | cacknin | 2007-09-21 17:44:18 +0000 (Fri, 21 Sep 2007)

Merged revisions 26480-26729 via svnmerge from

r866835 | cacknin | 2007-09-23 18:51:32 +0000 (Sun, 23 Sep 2007)

Provide 'svn patch' with support for Unidiff.  This includes a new
--patch-cmd option along with its analog run-time config entry to
determine the program to call in charge of applying the unidiff.

* subversion/svn/cl.h
  (svn_cl__longopt_t): add svn_cl__patch_cmd_opt to the enum.
  (svn_cl__opt_state_t): provide with a patch_cmd field.

* subversion/include/svn_config.h
  (SVN_CONFIG_OPTION_PATCH_CMD): new macro for 'patch-cmd' user config
  (global): adjust macros padding (cosmetic change)

* subversion/svn/patch-cmd.c
  (svn_cl__patch): initialize/open outfile and errfile pipes and pass
  those to svn_client_patch().

* subversion/svn/main.c
  (svn_cl__options): provide options array with a patch-cmd entry.
  (svn_cl__cmd_table): add the patch_cmd option to 'svn patch'.
  (main): initialize opt_state.patch_cmd;  override the user config when
  --patch-cmd was passed on the command line.

* subversion/libsvn_subr/config_file.c:
  (svn_config_ensure): add 'patch-cmd' to the default user config file

* subversion/include/svn_client.h:
  (svn_client_patch): adjust docstring accordingly to this commit
  purpose; also add outfile and errfile arguments.

* subversion/libsvn_client/patch.c
  (apply_unidiff): new function to call external patch program.
  (svn_client_patch): add the two outfile and errfile args; add the call
  to apply_unidiff().

* subversion/tests/cmdline/
  (diff_svnpatch): fix output as svn:mergeinfo shows up when a file is
  copied in the working copy;  reverse the copyfrom-field once more, it
  seems like the server doesn't send this information anymore..

* subversion/tests/cmdline/
  (global): remove deprecated SVNAnyOutput
  (gnupatch_garbage_re): global regexp to catch patch(1) message when
  fed with unidiff-less data.
  (patch_basic): adjust accordingly with gnupatch_garbage_re.

r866902 | cacknin | 2007-09-28 14:03:42 +0000 (Fri, 28 Sep 2007)

Use copyfrom-args when creating/applying (svn)patch in a WC->WC diff
context towards file-copy (directory-copy needs some work).

* subversion/include/svn_wc.h
  (svn_wc_notify_state_t): add svn_wc_notify_state_source_missing field.
  (svn_wc_diff_callbacks3_t): new; rev-up svn_wc_diff_callbacks2_t to
  add copyfrom-args support.

* subversion/libsvn_wc/diff.c
  (path_driver_cb_func): use relative-to-root path instead of basename.

* subversion/libsvn_client/patch.c:
  (docstrings): update from svn_wc_diff_callbacks2_t to
  (merge_file_added): update to svn_wc_diff_callbacks3_t; split the
  merge in two depending on whether this is scheduled-*with-history*.
  (merge_dir_added, patch_callbacks, edit_baton): update to use
  (file_baton, make_file_baton): add/use copyfrom_path and copyfrom_rev.
  (delete_entry, open_file): update make_file_baton call.
  (add_directory, add_file): make use of copyfrom_path and
  copyfrom_revision args according to svn_wc_diff_callbacks3_t.
  (close_file): update file_added call with copyfrom-args; make use of
  svn_wc_notify_state_source_missing for notification.
  (make_editor_baton): switch to svn_wc_diff_callbacks3_t use.

* subversion/tests/cmdline/
  (diff_svnpatch): add-file now has a copyfrom-path in a
  relative-to-root fashion.

* subversion/svn/notify.c:
  (notify): add case for svn_wc_notify_state_source_missing.

r866971 | cacknin | 2007-10-02 21:09:01 +0000 (Tue, 02 Oct 2007)

Follow-up to r26828.
(Use copyfrom-args when creating/applying (svn)patch in a WC->WC diff
context towards file-copy (directory-copy needs some work).)

* subversion/include/svn_wc.h
  (svn_wc_diff_callbacks3_t): fix docstring and terminology for
  file_added and dir_added copyfrom_{path, revision} arguments.

Suggested by: glasser

r866989 | cacknin | 2007-10-03 22:14:08 +0000 (Wed, 03 Oct 2007)

Follow-up to 26761.
(Provide 'svn patch' with support for Unidiff.  This includes a new
--patch-cmd option along with its analog run-time config entry to
determine the program to call in charge of applying the unidiff.)

* notes/svnpatch:
  update accordingly to the new unidiff handling.

* subversion/include/svn_error_codes.h

* subversion/include/svn_config.h:
  Revert r26761 ident adjustments and place SVN_CONFIG_OPTION_PATCH_CMD
  near its peers.

* subversion/include/svn_wc.h
  (svn_wc_apply_svnpatch): rename from svn_wc_apply_patch.
  (svn_wc_apply_unidiff): new public API (moved from

* subversion/libsvn_wc/patch.c
  (svn_wc_apply_svnpatch): rename from svn_wc_apply_patch.
  (svn_wc_apply_unidiff): new public API (moved from
  subversion/libsvn_client/patch.c:apply_unidiff); also fix the exitcode
  handling so that higher layers --UIs-- can address it instead.

* subversion/libsvn_client/patch.c
  (apply_unidiff): move to
  (svn_client_patch): update the call to apply unidiff.

* subversion/svn/patch-cmd.c
  (svn_cl__patch): handle external program exitcode here.

* subversion/include/svn_client.h
  (svn_client_patch): fix docstring to not be CLI-speficic.

Suggested by: glasser

r867009 | cacknin | 2007-10-04 14:11:01 +0000 (Thu, 04 Oct 2007)

Fix in 'svn patch' help message.

* subversion/svn/main.c
  (svn_cl__cmd_table): avoid vague words in 'svn patch' usage message when
  talking about fuzzing.

Suggested by: glasser

r867010 | cacknin | 2007-10-04 14:38:09 +0000 (Thu, 04 Oct 2007)

* subversion/libsvn_wc/patch.c
  (svn_wc_apply_unidiff): "-p0" and not "p0".

r867027 | cacknin | 2007-10-05 17:09:58 +0000 (Fri, 05 Oct 2007)

Fix copyfrom-path use for file move operations when applying a
WC->WC-created svnpatch.

* subversion/libsvn_client/patch.c
  (patch_cmd_baton): add deletions hash member.
  (is_removal_safe): new helper function.
  (merge_file_added): make use of the new deletions hash and
  is_removal_safe function to decide, when this involves a move, whether
  the source can be deleted or not.
  (merge_file_deleted): turn on the keep_local feature of
  svn_client__wc_delete by default and make use of the new deletions
  hash and is_removal_safe function to decide whether the file can be
  deleted from disk.
  (svn_client_patch): allocate/initialize the deletions hash table
  upon patch_cmd_baton initialization.

r867128 | cacknin | 2007-10-09 20:29:55 +0000 (Tue, 09 Oct 2007)

Test patch application with unidiff.  run_and_verify_patch was tweaked a
bit so that the output can be checked against a list, which is more
convenient when it comes to parsing the output of an external program.

* subversion/tests/cmdline/svntest/
  (verify_update): conditionalize output checking so that we can still
  use verify_update for disk and status checks.
  (run_and_verify_patch): update so that output_tree can be a list that
  we check in a line-by-line manner rather than in a tree manner.

* subversion/tests/cmdline/
  (patch_unidiff): new test for unidiff external support.

r867134 | cacknin | 2007-10-10 01:28:52 +0000 (Wed, 10 Oct 2007)

Provide svn_wc_apply_unidiff API with dry_run and force options to pass
along the external program arguments.

* subversion/include/svn_wc.h
  (svn_wc_apply_unidiff): add force and dry_run arguments to pass to the
  external patching program.

* subversion/libsvn_wc/patch.c
  (svn_wc_apply_unidiff): add force and dry_run arguments to pass to the
  external patching program; make use of a subpool.

* subversion/libsvn_client/patch.c
  (svn_client_patch): update the call to svn_wc_apply_unidiff with the
  corresponding dry_run and force arguments.

r867161 | cacknin | 2007-10-10 19:45:15 +0000 (Wed, 10 Oct 2007)

Revert r26953 (Fix copyfrom-path use for file move operations when
applying a WC->WC-created svnpatch.) since it fixed move operations at
the expense of breaking delete operations.

r867223 | cacknin | 2007-10-12 16:52:36 +0000 (Fri, 12 Oct 2007)

Merged revisions 26730-27147 via svnmerge from

r867227 | cacknin | 2007-10-12 18:47:07 +0000 (Fri, 12 Oct 2007)

* subversion/svn/patch-cmd.c
  (svn_cl__patch): use svn_error_root_cause() instead of
  svn_error_root_cause_is() which was removed in r26837.

r867296 | cacknin | 2007-10-16 20:02:16 +0000 (Tue, 16 Oct 2007)

Attempt to fix 'svn patch' copy/move behavior using copyfrom argument
from WC-WC serialiazed diff.

* subversion/libsvn_client/patch.c:
  (create_empty_file): put a forward declaration at the beginning.
  (add_file_with_history): new function to help merge_file_added in its
  quest for both correctness and clarity.
  (merge_file_added): make use of add_file_with_history and a large
  amount of indent adjustments.
  (merge_file_deleted): prevent svn_client__wc_delete from deleting the
  file when it has local modifications.

r867297 | cacknin | 2007-10-16 20:20:29 +0000 (Tue, 16 Oct 2007)

* subversion/tests/cmdline/svntest/
  (run_and_verify_patch): fix error_string regexp matching so that it
  doesn't return when the expected error is actually found.

* subversion/tests/cmdline/
  (patch_unidiff): enable dry-run test too.

r867299 | cacknin | 2007-10-16 22:55:45 +0000 (Tue, 16 Oct 2007)

* subversion/libsvn_client/patch.c:
  (add_file_with_history): move the function up in the file so that it
  is not lost among the diff_callbacks.

r867301 | cacknin | 2007-10-16 23:55:04 +0000 (Tue, 16 Oct 2007)

* subversion/libsvn_client/patch.c
  (extract_svnpatch): make it static.

Found by: glasser

r867302 | cacknin | 2007-10-17 00:13:17 +0000 (Wed, 17 Oct 2007)

* subversion/libsvn_client/patch.c
  (add_file_with_history): ensure it's clear that eol and keyword
  translations do happen.

Suggested by: glasser

r867366 | cacknin | 2007-10-19 13:22:23 +0000 (Fri, 19 Oct 2007)

Let svn_wc_copy2 API operate on missing working source file.

* subversion/include/svn_wc.h
  (svn_wc_copy2): fix docstring to reflect the new behaviour.

* subversion/libsvn_wc/copy.c
  (svn_wc_copy2): assume the working source file may be missing.
  (copy_file_administratively): when copying the working source file,
  fallback on its text-base if it fails on ENOENT.

r867367 | cacknin | 2007-10-19 13:30:21 +0000 (Fri, 19 Oct 2007)

A partial rollback of r27222 to make use of svn_wc_copy2 (tweaked in

(The dry_run case is broken).

* subversion/libsvn_client/patch.c
  (merge_file_added): make use of svn_wc_copy2 now that it can address
  missing source file.
  (create_empty_file): remove forward declaration.
  (add_file_with_history): remove function

r867373 | cacknin | 2007-10-21 16:17:45 +0000 (Sun, 21 Oct 2007)

* subversion/tests/cmdline/
  (patch_copy_and_move): new test.  Use of the copyfrom-arg in two ways:
  with or without local mods.

r867374 | cacknin | 2007-10-21 17:01:15 +0000 (Sun, 21 Oct 2007)

Merged revisions 27148-27299 via svnmerge from

r867398 | cacknin | 2007-10-23 15:12:27 +0000 (Tue, 23 Oct 2007)

Add a non-regression diff test against bug that r26503 fixes.  (see

* subversion/tests/cmdline/
  (diff_backward_repos_wc_copy): new test for backward repos->wc diff
  against copied-file.
  (test_list): add this new test.

Approved by: kfogel

r868604 | cacknin | 2007-12-18 19:23:39 +0000 (Tue, 18 Dec 2007)

Merged revisions 27300-28525 via svnmerge from

r868627 | cacknin | 2007-12-19 14:04:03 +0000 (Wed, 19 Dec 2007)

On the svnpatch-diff branch:

(Some fixes following some tests on OS X)

* subversion/tests/cmdline/
  (diff_svnpatch): make use of Python's base64 legacy interface to
  encode (that is, switch from base64.b64encode *new in 2.4* to
  base64.encodestring) so that older versions of Python (<2.4) work.
* subversion/tests/cmdline/
  (svnpatch_encode): make use of Python's base64 legacy interface to
  encode (that is, switch from base64.b64encode *new in 2.4* to
  base64.encodestring) so that older versions of Python (<2.4) work.
  (patch_basic, patch_unidiff, patch_copy_and_move): fix paths issue
  (os.tempnam() behaves accordingly to libc's tempnam and thus differs
  from one platform to another; make sure we don't get trapped)

r868630 | cacknin | 2007-12-19 15:03:02 +0000 (Wed, 19 Dec 2007)

On the svnpatch-diff branch:

* subversion/svn/diff-cmd.c
  (svn_cl__diff): set the no-diff-deleted option to TRUE when the
  svnpatch option is turned on; this is to avoid a discrepancy when
  applying with GNU-patch
* subversion/svn/main.c
  (svn_cl__options): update the svnpatch option description accordingly
  (svn_opt_subcommand_desc2_t): re-order 'svn diff' options

r868673 | cacknin | 2007-12-20 17:57:54 +0000 (Thu, 20 Dec 2007)

On the svnpatch-diff branch:

Drop 'svn patch' dry-run mode from APIs but leave the mechanic in place
until we come up with a better idea or our own unidiff patch

* subversion/include/svn_wc.h
  (svn_wc_apply_unidiff): drop the dry_run argument from API

* subversion/include/svn_client.h
  (svn_client_patch): drop the dry_run argument from API

* subversion/libsvn_wc/patch.c
  (svn_wc_apply_unidiff): drop the dry_run argument and disable its use

* subversion/libsvn_client/patch.c
  (svn_client_patch): drop the dry_run argument and disable its use

* subversion/svn/patch-cmd.c
  (svn_cl__patch): drop the dry_run argument of svn_patch_client() call

* subversion/tests/cmdline/
  (patch_unidiff): don't test dry-run mode

r868676 | cacknin | 2007-12-20 19:01:08 +0000 (Thu, 20 Dec 2007)

On the svnpatch-diff branch:

Follow up to 28599 to actually remove --dry-run on the 'patch'

* subversion/svn/main.c
  (svn_opt_subcommand_desc2_t): remove opt_dry_run from 'svn patch'

r869442 | cacknin | 2008-02-15 00:00:38 +0000 (Fri, 15 Feb 2008)

Bug fix that incidentally allows more fuzzing on directory copy and move
operations at patch-generation time.

* subversion/libsvn_wc/diff.c
  (file_diff): Ensure this is the top-most entry to be copied before
  marking it as a diffable item.

r869443 | cacknin | 2008-02-15 00:02:27 +0000 (Fri, 15 Feb 2008)

* subversion/libsvn_wc/diff.c
  (file_diff): Whitespace indent fix.

r869466 | cacknin | 2008-02-15 21:12:25 +0000 (Fri, 15 Feb 2008)

Merged revisions 28539,28541-28544,28546-28547,28550-28552,28558-28560,28563,28572,28574-28580,28584,28591-28598,28603-28608,28610-28618,28623,28628-28634,28637,28639-28643,28645-28648,28652,28658-28660,28662-28665,28672,28681-28682,28692-28696,28700-28707,28712-28713,28717-28721,28727-28731,28733,28736,28739,28741-28743,28745-28747,28749,28758,28760-28761,28766,28771,28775-28776,28781,28791-28792,28795,28798,28802,28808,28810,28812,28814,28818-28820,28824-28832,28834-28835,28837,28839-28842,28846,28848-28853,28856-28858,28860-28866,28871-28875,28878-28882,28885,28893-28894,28902,28904-28922,28926,28928-28929,28933-28944,28946,28950-28961,28965-28968,28970-28975,28978-28980,28983,28985-28990,28992-28997,28999,29001-29006,29008-29031,29034-29039,29042-29049,29053-29059,29061-29080,29083,29085,29090-29094,29098-29099,29101,29106-29108,29110-29111,29114,29117-29120,29123,29126-29128,29134-29136,29138-29139,29143-29144,29148,29151-29153,29155,29161,29163-29164,29166-29171,29174-29176,29180-29181,29185-29199,29201-29202,29207-29208,29210,29214-29216,29218,29220,29225,29228,29230-29234,29239,29241-29243,29250-29256,29261-29262,29267-29271,29273,29277,29280-29281,29284,29287-29288,29298,29304,29308-29309,29313,29320,29326,29328-29329,29334,29336,29344,29348,29353,29358,29360,29364,29366 via svnmerge from

r869892 | cacknin | 2008-03-10 01:15:05 +0000 (Mon, 10 Mar 2008)

* notes/wc-ng-design: Organize the classification of svn_wc_entry_t
  fields into a table and fix some mistakes.

r870015 | cacknin | 2008-03-17 13:02:38 +0000 (Mon, 17 Mar 2008)

Sync svnpatch-diff branch with trunk.

r870019 | cacknin | 2008-03-18 21:50:21 +0000 (Tue, 18 Mar 2008)

On the svnpatch-diff branch:
  Follow-up to r29573 "Allow testing of application exit codes."

* subversion/tests/cmdline/
  (diff_svnpatch): Accept exit_code returned from run_and_verify_svn.

* subversion/tests/cmdline/svntest/
  (run_and_verify_patch): Accept exit_code returned from main.run_svn.

r871902 | cacknin | 2008-06-21 01:16:24 +0000 (Sat, 21 Jun 2008)

On the svnpatch-diff branch, bring up to sync with trunk.

Note that there is a compilation warning on subversion/libsvn_wc/diff.c due to
recent diff-callbacks3 API changes.  Some diff-tests are expected to fail but
this doesn't prevent the branch to honor its own purpose (svn diff --svnpatch
&& svn patch).  A fix will follow though.

r871956 | cacknin | 2008-06-25 13:30:23 +0000 (Wed, 25 Jun 2008)

On the svnpatch-diff branch:

* notes/svnpatch: fill the HISTORY part and some minor fixes.

r874052 | cacknin | 2008-10-31 15:34:02 +0000 (Fri, 31 Oct 2008)

On the svnpatch-diff branch: Merge 33893:33977 from trunk.