On Sunday, February 16, 2003, at 02:12 AM, Garrett Rooney wrote:
> i haven't even put this through make check yet, but i just wanted to
> get people's opinions. does this seem like a reasonable approach?
> something that just occurred to me is that
> svn_cancel_get_cancellation_editor should be smarter, it can check to
> see if the cancellation function is NULL, and if so just return the
> underlying editor it was passed, with no extra cancellation editor
> layered on top. that would also remove the checks in this patch that
> ensure the cancellation function is non-null before calling it.
ok, here's a revised copy of this patch.
it implements the cancellation editor and assuming that a cancellation
callback is specified in the client context, it uses it for 'svn diff'.
this allows (as far as i can tell) us to cleanly cancel out of 'svn
diff', which is less than entirely useful, but makes a decent proof of
concept.
if nobody has any objections, i'd like to commit this today, minus the
changes in clients/cmdline/main.c, so it won't actually have any effect
for users (i'd rather not remove their ability to control-c out of long
running operations until the cancellation editor is wrapped around more
of our functionality).
-garrett
* subversion/include/svn_error_codes.h
(SVN_ERR_CANCELLED): new error code to signify that an operation has
been
cancelled.
* subversion/include/svn_cancel.h: new file, holds prototypes for
cancellation
stuff.
* subversion/include/svn_wc.h
(svn_wc_get_diff_editor): add cancellation function/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): add cancellation function/baton, wrap our
editor in
a cancellation editor.
* subversion/libsvn_subr/cancel.c: new file, implements the
cancellation editor.
* subversion/libsvn_client/diff.c
(do_diff): pass cancellation function/baton into
svn_client__get_diff_editor
and svn_wc_get_diff_editor.
(do_merge): pass cancellation function/baton into
svn_client__get_diff_editor.
* subversion/libsvn_client/repos_diff.c
(svn_client__get_diff_editor): add cancellation function/baton
arguments,
wrap our editor in a cancellation editor.
* subversion/libsvn_client/client.h
(svn_client__get_diff_editor): add cancellation function/baton
arguments.
* subversion/clients/cmdline/main.c
(sig_int): signal handler for cancellation.
(check_cancel): cancellation callback function.
(main): set up signal handler for SIGINT, add check_cancel to our
client
context.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 17 16:35:39 2003