Checkout Tools
  • last updated 57 mins ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Lay the groundwork that would allow ra_serf to stream svndiff deltas

without creating temporary files when working against new servers.

This patch adds a new delta editor callback, apply_textdelta_stream()

that we'll use to stream the deltas, fully implements in the ra_serf's

commit editor, but doesn't yet change the behavior of existing editor

drivers, such as svn_client_import5() or svn_client_commit6().

This requires a minor tweak to the Subversion's HTTP protocol, and

it's the reason why streaming would only work against new servers.

Currently, all PUT requests include a special header that contains the

result checksum, which is used by the server to validate the integrity

of the result after it applies the delta received over the wire. While

this approach works fine if the client first creates a temporary file with

the delta and only then starts sending it to the server (the result checksum

is calculated while preparing the temporary file), it can't be used in the

stream approach, as with it we'd need to know the result checksum _before_

we start sending data.

So we turn the existing scheme inside out, and teach mod_dav_svn to send the

result checksum in the responses to PUT requests. Then, the client would

check if the received checksum matches what it calculated, and, possibly,

return a checksum mismatch error (thus aborting the edit and the transaction).

* subversion/include/svn_delta.h

(svn_txdelta_stream_open_func_t): New callback type.

(svn_delta_editor_t): Add a forward declaration for this type.

(svn_delta_editor_t.apply_textdelta_stream): New vtable member.

* subversion/libsvn_delta/default_editor.c

(apply_textdelta_stream): Provide default implementation for this callback

that performs a fallback to apply_textdelta().

(default_editor): Extend the default instance of an svn_delta_editor_t.

* subversion/libsvn_delta/cancel.c

(apply_textdelta_stream): Implement this forwarding callback, and ...

(svn_delta_get_cancellation_editor): ...install it here.

* subversion/include/svn_dav.h

(SVN_DAV_NS_DAV_SVN_PUT_RESULT_CHECKSUM): New.

* subversion/mod_dav_svn/repos.c

(close_stream): Send the "X-SVN-Result-Fulltext-MD5" header when responding

to successful PUT requests.

* subversion/mod_dav_svn/version.c

(get_vsn_options): Advertise new capability.

* subversion/libsvn_ra_serf/ra_serf.h

(svn_ra_serf__session_t.supports_put_result_checksum): New field.

* subversion/libsvn_ra_serf/options.c

(capabilities_headers_iterator_callback): Remember if the server sends

the result checksum in the response to a successful PUT request.

* subversion/libsvn_ra_serf/commit.c

(file_context_t.svndiff_sent): New field.

(file_context_t.remote_result_checksum): New field.

(apply_textdelta): Update the comment stating that it would be nice to

get rid of temporary files for svndiff delta. Factor out the svndiff

format selection logic ...

(negotiate_put_encoding): ...into this new helper function.

(open_txdelta_baton_t): New.

(txdelta_stream_errfunc): New error function for the stream bucket.

(create_body_from_txdelta_stream): New svn_ra_serf__request_body_delegate_t

that creates the request body by opening an svn_txdelta_stream_t, turning

it into svn_stream_t and giving away a bucket wrapping around that stream.

Use it in ...

(apply_textdelta_stream): ...this new function that performs a PUT, and

streams the request body.

(put_response_ctx_t): New.

(put_response_handler): New, remembers the result checksum we received

from the server.

(close_file): Don't do a PUT if we did it in apply_textdelta_stream().

Check for a checksum mismatch using the checksum returned from the server.

(svn_ra_serf__get_commit_editor): Install the new apply_textdelta_stream()

callback when working against new servers.

  1. … 8 more files in changeset.
* subversion/libsvn_delta/cancel.c

(svn_delta_get_cancellation_editor): Revert accidental commit in r1445360.

* subversion/libsvn_wc/diff_editor.c

(wrap_dir_closed,

wrap_dir_changed): Use constant instead of the availability of

left_src to say that the node was not added. Do this to cover

for a current bug in the repos-wc driver.

(The difference is visible in svn diff --summarize)

* subversion/libsvn_delta/cancel.c

(svn_delta_get_cancellation_editor): Add optimization that wasn't ready yet

(and might require revving the api). Reverted this part in r1445361.

  1. … 1 more file in changeset.
Test out my new and fancy ASF commit priviledges by changing the copyright

wording in our license headers to reflect ownership by the ASF.

* NOTICE:

Change terminology to ASF, and update a link.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the ASF, and update the project website.

* everywhere:

Change license text to reflect ASF ownership.

  1. … 891 more files in changeset.
Relicense Subversion under the Apache License, Version 2.0.

* NOTICE: New.

* LICENSE: New.

* COPYING,

subversion/LICENSE: Remove.

* subversion/libsvn_subr/opt.c

(svn_opt__print_version_info): Note that the product as a whole is

copyrighted by the SVN Corp, and that it contains contributions from

many people, as referenced in NOTICE.

* subversion/bindings/swig/python/LICENSE_FOR_PYTHON_BINDINGS:

Relicense the SVN parts under Apache 2.0.

* everywhere:

Change copyright notices in file headers to reflect the Apache 2.0 license.

  1. … 882 more files in changeset.
Directly return some errors, removing superfluous invocations of SVN_ERR().

This only handles libsvn_delta. See r33043 for more discussion about the

general idea.

* subversion/libsvn_delta/svndiff.c,

subversion/libsvn_delta/cancel.c,

subversion/libsvn_delta/debug_editor.c,

subversion/libsvn_delta/text_delta.c:

Directly return errors from some called functions.

  1. … 3 more files in changeset.
The cancellation editor has been discarding the wrapped editor's

abort_edit callback, and all cancellation-wrapped editors have

been using the default editor's no-op abort_edit.

* subversion/include/svn_delta.h

(svn_delta_editor_t): Add comment about updating cancellation and

default editors when adding new callbacks.

* subversion/libsvn_delta/cancel.c

(abort_edit): Add new wrapper.

(svn_delta_get_cancellation_editor): Set abort_edit.

  1. … 1 more file in changeset.
cancelation -> cancellation.

* subversion/libsvn_ra_dav/util.c

* subversion/libsvn_delta/cancel.c

* subversion/libsvn_client/list.c

Make sure we spell "cancellation" the same way everywhere. :-)

Found by: Ed Price <ed.price{_AT_}gmail.com>

  1. … 2 more files in changeset.
Reformat the code to use a consistent no-space-before-param-list-paren style.

See here for the vote that decided this:

http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=111877

From: "Peter N. Lundblad" <peter@famlundblad.se>

To: "Peter N. Lundblad" <peter@famlundblad.se>

cc: dev@subversion.tigris.org

Subject: Results of: [VOTE] New space-before-parens style

Date: Wed, 8 Feb 2006 12:00:35 +0100 (CET)

Message-ID: <Pine.LNX.4.55.0602080918350.10805@localhost.localdomain>

I took the opportunity to make spacing among all parens in SVN_ERR

macro calls consistent. But I did not address consistency of casts,

nor whether a function name should always appear below its return type

in declarations and definitions, nor whether there should be a space

before/after the "*" when declaring pointer return types.

* www/hacking.html

(coding-style): Document that we are no-space-before-paren now.

* everywhere: Reformat.

  1. … 365 more files in changeset.
Enable two build generator include dep warnings that I recently added disabled.

Add comment explaining their purpose.

Consistify usage of #include <foo.h> vs. "foo.h" throughout the project.

* build/generator/gen_base.py: Enable warnings, add comment.

* build/generator/gen_base.py:

* subversion/libsvn_fs_base/lock.c:

* subversion/include/svn_ra_svn.h:

* subversion/libsvn_subr/xml.c:

* subversion/libsvn_subr/io.c:

* subversion/libsvn_subr/nls.c:

* subversion/libsvn_subr/date.c:

* subversion/libsvn_subr/config_win.c:

* subversion/bindings/java/javahl/native/SVNClient.cpp:

* subversion/bindings/java/javahl/native/Prompter.cpp:

* subversion/bindings/java/javahl/native/Targets.cpp:

* subversion/bindings/java/javahl/native/Notify.h:

* subversion/bindings/java/javahl/native/EnumMapper.h:

* subversion/bindings/java/javahl/native/Outputer.h:

* subversion/bindings/java/javahl/native/Notify2.h:

* subversion/bindings/java/javahl/native/BlameCallback.h:

* subversion/bindings/java/javahl/native/Revision.h:

* subversion/bindings/java/javahl/native/Pool.cpp:

* subversion/bindings/java/javahl/native/SVNClient.h:

* subversion/bindings/java/javahl/native/Prompter.h:

* subversion/bindings/java/javahl/native/JNIUtil.cpp:

* subversion/bindings/java/javahl/native/Inputer.h:

* subversion/bindings/java/javahl/native/BlameCallback.cpp:

* subversion/bindings/java/javahl/native/CommitMessage.cpp:

* subversion/bindings/swig/include/svn_global.swg:

* subversion/bindings/swig/svn_delta.i:

* subversion/mod_dav_svn/mod_dav_svn.c:

* subversion/tests/libsvn_wc/translate-test.c:

* subversion/tests/libsvn_subr/opt-test.c:

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

* subversion/tests/libsvn_subr/path-test.c:

* subversion/libsvn_ra_svn/cram.c:

* subversion/libsvn_ra_svn/ra_svn.h:

* subversion/libsvn_delta/cancel.c:

* subversion/svnserve/serve.c:

* subversion/libsvn_fs_fs/lock.c:

* contrib/client-side/svn-push/svn-push.c:

* contrib/client-side/mucc.c:

Consistify #includes.

  1. … 37 more files in changeset.
Rationalize #includes in C source files.

If a file does not use symbols from a given header, then do not include

that header.

If a file uses symbols from a given header 'H', and H was only being

included via another header that neither needs nor guarantees to include

H, then include H directly.

(By "symbols from a given header" I mean symbols that it either defines

itself or pulls in from other headers with the specific intention of

providing them to its users.)

  1. … 149 more files in changeset.
Set property 'svn:eol-style' consistently to 'native' on C and Python source

files and files that are only for humans to read (README, INSTALL). Most such

files were already set this way; the files changed here had no 'svn:eol-style'.

* subversion/bindings/swig/python/__init__.py

* subversion/bindings/swig/python/svn/core.py

* subversion/libsvn_client/ctx.c

* subversion/libsvn_client/relocate.c

* subversion/libsvn_client/url.c

* subversion/libsvn_delta/cancel.c

* subversion/libsvn_delta/path_driver.c

* subversion/libsvn_diff/diff.h

* subversion/libsvn_diff/diff3.c

* subversion/libsvn_diff/diff4.c

* subversion/libsvn_diff/lcs.c

* subversion/libsvn_diff/token.c

* subversion/libsvn_diff/util.c

* subversion/libsvn_ra_svn/cram.c

* subversion/libsvn_repos/replay.c

* subversion/libsvn_subr/cmdline.c

* subversion/libsvn_subr/config_auth.c

* subversion/libsvn_subr/date.c

* subversion/libsvn_subr/stream.c

* subversion/libsvn_wc/relocate.c

* subversion/mod_authz_svn/INSTALL

* subversion/tests/README

* subversion/tests/clients/cmdline/revert_tests.py

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

* subversion/tests/libsvn_vcdiff/README

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

* subversion/tests/python-libs/exectest.py

* subversion/tests/svn_test_editor.c

* subversion/tests/svn_tests_main.c

Set property 'svn:eol-style' to 'native'.

  1. … 28 more files in changeset.
Update copyright notices for 2004, resolving issue #1651.

(See also revision 8019, which fixed a couple of missed spots.)

  1. … 361 more files in changeset.
Merge /branches/partial-authz-dev to /trunk, r7571:7672.

See the branch for full log messages.

Here's my nutshell summary of the new 'partial read-authz feature':

If a client checks out or updates a tree, a server authz system now

has the ability to selectively deny read-access on arbitrary files and

dirs by supplying a authz_read_func to svn_repos_dir_delta(). In this

situation, dir_delta() will call new absent_[file|dir]() editor

functions instead of the usual [open|add] functions. The DAV layer

now marshals these messages over the network, and libsvn_wc marks the

appropriate wc entries as 'absent'. Entries marked 'absent' are

essentially treated like 'deleted' ones; most client commands can't

see them at all. (But 'svn up' *does* report them to the server, in

case read-access is re-granted.)

(There are still a couple of small wc bugs, specifically triggered by

repeated granting/ungranting of read-access to files. They'll be

fixed RSN.)

Final note: this change upgrades working copies from format 2 to

format 3 'in place'. Format 1 wc's are no longer supported.

  1. … 27 more files in changeset.
* subversion/libsvn_delta/cancel.c

(svn_delta_get_cancellation_editor): Uh, semicolon, not comma.

First part of issue #1100 ("imports need to do checksumming").

Move the result checksum from apply_textdelta to close_file:

* subversion/include/svn_delta.h: Include apr_md5.h.

(svn_delta_editor_t): Remove result_checksum from from

apply_textdelta, and add text_checksum to close_file.

(svn_txdelta_apply): Change result_checksum to result_digest, now

an outgoing parameter instead of incoming.

Deal with the fallout:

* subversion/libsvn_delta/text_delta.c

(struct apply_baton): Convert result_checksum to result_digest,

reflecting the corresponding change to svn_txdelta_apply.

(svn_txdelta_apply): Change result_checksum to result_digest, now

an outgoing parameter instead of incoming. Initialize accordingly

and stash in the apply_baton.

(apply_window): Don't compare the result checksum, just store it.

* subversion/libsvn_delta/cancel.c

(apply_textdelta): Lose the result_checksum argument.

(close_file): Take new text_checksum argument.

* subversion/libsvn_delta/default_editor.c

(apply_textdelta): Lose the result_checksum argument.

(close_file): Take new text_checksum argument.

(default_editor): Use close_file instead of the generic

single_baton_func.

* subversion/libsvn_repos/checkout.c: Include apr_md5.h and svn_md5.h.

(send_file_contents): Don't pass null result_checksum argument to

editor->apply_textdelta.

(walk_tree): Pass text checksum to editor->close_file.

* subversion/libsvn_repos/commit.c: Include apr_md5.h and svn_md5.h.

(apply_textdelta): Lose result_checksum argument, pass NULL for the

result_checksum to svn_fs_apply_textdelta.

(close_file): New function, just compares given checksum against

the checksum of the file in the txn.

(svn_repos_get_commit_editor): Set the editor's close_file function.

* subversion/libsvn_repos/delta.c

(send_text_delta): Lose result_checksum argument, stop passing it

to editor->apply_textdelta.

(add_file_or_dir, replace_file_or_dir): Pass text checksum to

editor->close_file.

(delta_files): Don't calculate target checksum, don't pass it to

send_text_delta.

* subversion/libsvn_repos/node_tree.c

(apply_textdelta): Lose result_checksum argument.

* subversion/libsvn_client/commit.c

(send_file_contents): Don't pass result_checksum to

editor->apply_textdelta.

(import_file): Pass null for text_checksum to editor->close_file,

and leave a comment indicating that more work will be done here.

* subversion/libsvn_client/commit_util.c

(apply_textdelta): Don't take result_checksum argument, don't pass

it to real_editor->apply_textdelta.

(close_file): Take text_checksum argument, pass it to

real_editor->close_file.

(do_item_commit): Pass null for the text_checksum argument when

calling editor->close_file on file batons that have no text mods.

* subversion/libsvn_client/copy.c

(repos_to_repos_copy): Pass null text_checksum to editor->close_file.

* subversion/libsvn_client/repos_diff.c

(apply_textdelta): Lose the result_checksum argument.

(close_file): Take text_checksum argument, ignore it.

* subversion/libsvn_wc/adm_crawler.c

(svn_wc_transmit_text_deltas): Don't pass result_checksum to

editor->apply_textdelta. Pass null text_checksum to

editor->close_file when no window handler, otherwise pass the

digest of the tmp_base.

* subversion/libsvn_wc/diff.c

(apply_textdelta): Lose the result_checksum argument.

(close_file): Take text_checksum argument, ignore it.

* subversion/libsvn_wc/status_editor.c

(apply_textdelta): Lose the result_checksum argument.

(close_file): Take text_checksum argument, ignore it.

* subversion/libsvn_wc/update_editor.c

(struct file_baton): Add new digest field.

(make_file_baton): Add a comment about how digest is initialized for

free by pcalloc.

(apply_textdelta): Lose the result_checksum argument, adjust call

to svn_txdelta_apply to receive a checksum instead of giving one.

(close_file): Take text_checksum argument, compare it against the

calculated checksum in the file baton.

* subversion/libsvn_ra_dav/commit.c

(struct put_baton_t): Lose the `file' field, there's no longer any

need to store the file baton here.

(struct resource_baton_t): New put_baton field.

(commit_stream_close): Remove, since this work is done in

commit_close_file now.

(commit_apply_txdelta): Lose result_checksum argument, don't

initialize a result_checksum in the baton. Don't set a close

function on the stream anymore, since commit_close_file will take

care of it.

(commit_close_file): Construct the PUT request, since this is where

we have both the base_checksum and text_checksum now.

* subversion/libsvn_ra_svn/editor.c

(ra_svn_apply_textdelta): Lose result_checksum argument, and

don't send it over the wire in the "apply-textdelta" command.

(ra_svn_close_file): Take text_checksum argument, send it over the

wire as an optional tuple.

(ra_svn_handle_apply_textdelta): Don't handle result_checksum.

(ra_svn_handle_close_file): Handle text_checksum.

* subversion/libsvn_ra_dav/fetch.c

(simple_fetch_file): Lose result_checksum parameter, and don't

pass it to editor->apply_textdelta.

(start_element): Don't pass result_checksum to simple_fetch_file.

Initialize rb->result_checksum to NULL in ELEM_open_file, and to

the found checksum or NULL in ELEM_add_file and ELEM_fetch_file.

(end_element): Pass rb->result_checksum to editor->close_file

instead of to editor->apply_textdelta.

(fetch_file): Pass checksum to editor->close_file instead of to

simple_fetch_file.

* subversion/mod_dav_svn/merge.c

(mr_close_file): Take new text_checksum argument, ignore it.

* subversion/mod_dav_svn/update.c

(struct item_baton_t): New text_changed boolean field.

(upd_apply_textdelta): Don't send the "fetch-file" xml here, just

store the base_checksum in the item baton and set text_changed.

(upd_close_file): Send the "fetch-file" xml here instead of in

upd_apply_textdelta.

* subversion/tests/svn_test_editor.c

(test_apply_textdelta): Lose the result_checksum argument.

(test_close_file): Take new text_checksum argument, ignore it.

* subversion/tests/libsvn_repos/dir-delta-editor.c

(test_apply_textdelta): Lose the result_checksum argument, pass NULL

for the result_checksum to svn_fs_apply_textdelta.

* subversion/bindings/swig/swigutil_py.c

(thunk_apply_textdelta): Lose the result_checksum argument.

(thunk_close_file): Take new text_checksum argument, invoke the

appropriate method manually, instead of factoring out to

close_baton like the other close functions.

  1. … 23 more files in changeset.
Move the svn_cancel_func_t typedef to svn_types.h.

Part of issue #1004.

* subversion/include/svn_types.h: move svn_cancel_func_t from svn_cancel.h

to here.

* subversion/include/svn_cancel.h: deleted, since it is now empty.

* subversion/include/svn_client.h: remove include of svn_cancel.h

* subversion/include/svn_delta.h: ditto.

* subversion/include/svn_wc.h: ditto.

* subversion/libsvn_delta/cancel.c: ditto.

  1. … 5 more files in changeset.
Start issue #1004: cancellation of long-running subversion functions.

This change just begins laying the groundwork, it's not actually turned on

for the command line client yet, since the only functions that can actually

be cancelled are the implementations of 'svn diff', so installing a signal

handler that removes the user's ability to kill the client with a control-c

seems a bit premature at this stage.

* subversion/include/svn_error_codes.h

(SVN_ERR_CANCELLED): new error code for use when a function is cancelled

by the client.

* subversion/include/svn_cancel.h: new header for things related to the

cancellation infrastructure.

* subversion/include/svn_delta.h

(svn_delta_get_cancellation_editor): new function declaration.

* subversion/include/svn_wc.h

(svn_wc_get_diff_editor): accept cancellation function and baton arguments.

* subversion/include/svn_client.h

(svn_client_ctx_t): add cancellation function/baton members.

* subversion/libsvn_wc/diff.c

(svn_wc_get_diff_editor): take cancellation function and baton arguments,

and use them to wrap our editor in a cancellation editor.

* subversion/libsvn_client/diff.c

(do_merge): pass the cancellation function and baton into

svn_client__get_diff_editor.

(do_diff): pass the cancellation function and baton into

svn_wc_get_diff_editor and svn_client__get_diff_editor.

* subversion/libsvn_client/repos_diff.c

(svn_client__get_diff_editor): take cancellation function and baton args,

use them to wrap the editor in a cancellation editor.

* subversion/libsvn_client/client.h

(svn_client__get_diff_editor): add cancellation function and baton args.

* subversion/libsvn_delta/cancel.c: new function, contains implementation of

the cancellation editor.

* subversion/libsvn_delta/libsvn_delta.dsp: add cancel.c

  1. … 10 more files in changeset.