git-remote-svn: Week 7
Hi,
I thought I'd post a quick update again this week, since there's been some more progress. Daniel Shahaf has been awesome in helping me get acquainted with libsvn. I've made some more progress with the client and have gained some confidence- I should be able to complete the "dump editor" soon, but there are plenty of ifs and buts with respect to deltas. Hopefully, many of those doubts will be clear by next week.
-- Ram
Ramkumar Ramachandra (2):
Add skeleton RA svnclient
Add stripped dump editor
Makefile | 4 + debug_editor.c | 413 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ debug_editor.h | 6 + dump_editor.c | 365 +++++++++++++++++++++++++++++++++++++++++++++++++ dump_editor.h | 10 ++ svnclient_ra.c | 138 +++++++++++++++++++ 6 files changed, 936 insertions(+), 0 deletions(-) create mode 100644 Makefile create mode 100644 debug_editor.c create mode 100644 debug_editor.h create mode 100644 dump_editor.c create mode 100644 dump_editor.h create mode 100644 svnclient_ra.c
PATCH 1/2 Add skeleton RA svnclient
The SVN client uses the RA API to connect to a remote server and replay revisions. Currently, it wraps a debug editor to print out some tree information. In future, it will dump the data in every revision to stdout in dumpfile format (hopefully) without resorting to the FS API.
--- Makefile | 4 + debug_editor.c | 413 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ debug_editor.h | 6 + svnclient_ra.c | 131 ++++++++++++++++++ 4 files changed, 554 insertions(+), 0 deletions(-) create mode 100644 Makefile create mode 100644 debug_editor.c create mode 100644 debug_editor.h create mode 100644 svnclient_ra.c
Makefile new file +4 -0
@@ -0,0 +1,4 @@ +svnclient_ra: *.c *.h + $(CC) -Wall -Werror -ggdb3 -O0 -o $@ svnclient_ra.c debug_editor.c -lsvn_client-1 -I. -I/usr/local/include/subversion-1 -I/usr/include/apr-1.0 +clean: + $(RM) svnclient_ra
debug_editor.c new file +413 -0
413 lines not on this page · raw message
debug_editor.h new file +6 -0
@@ -0,0 +1,6 @@ +svn_error_t * +svn_delta__get_debug_editor (const svn_delta_editor_t **editor, +void **edit_baton, +const svn_delta_editor_t *wrapped_editor, +void *wrapped_edit_baton, +apr_pool_t *pool);
svnclient_ra.c new file +131 -0
131 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/2 Add stripped dump editor
In reply to Ramkumar RamachandraReplace the default editor with a dump editor from libsvn_repos/dump.c after stripping off filesystem dependencies. Currently, the dump editor does nothing, but will dump some revision information to stdout in future.
--- Makefile | 2 +- dump_editor.c | 365 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ dump_editor.h | 10 ++ svnclient_ra.c | 19 ++- 4 files changed, 389 insertions(+), 7 deletions(-) create mode 100644 dump_editor.c create mode 100644 dump_editor.h
Makefile +1 -1
@@ -1,4 +1,4 @@ svnclient_ra: *.c *.h - $(CC) -Wall -Werror -ggdb3 -O0 -o $@ svnclient_ra.c debug_editor.c -lsvn_client-1 -I. -I/usr/local/include/subversion-1 -I/usr/include/apr-1.0 + $(CC) -Wall -ggdb3 -O0 -o $@ svnclient_ra.c debug_editor.c dump_editor.c -lsvn_client-1 -I. -I/usr/local/include/subversion-1 -I/usr/include/apr-1.0 clean: $(RM) svnclient_ra
dump_editor.c new file +365 -0
365 lines not on this page · raw message
dump_editor.h new file +10 -0
@@ -0,0 +1,10 @@ +#include "svn_pools.h" +#include "svn_cmdline.h" +#include "svn_client.h" +#include "svn_ra.h" + +svn_error_t * +get_dump_editor (const svn_delta_editor_t **editor, +void **edit_baton, +svn_revnum_t to_rev, +apr_pool_t *pool);
svnclient_ra.c +13 -6
@@ -4,6 +4,7 @@#include "svn_ra.h" #include "debug_editor.h" +#include "dump_editor.h" static apr_pool_t *pool =NULL ;static svn_client_ctx_t *ctx =NULL ;
@@ -92,16 +93,22 @@ svn_error_t *open_connection(const char *url)svn_error_t *replay_range (svn_revnum_t start_revision,svn_revnum_t end_revision) { +svn_delta_editor_t *dump_editor, *debug_editor; +void *debug_baton, *dump_baton; +svn_revnum_t latest_revision; -svn_delta_editor_t *editor, *debug_editor; -replay_baton_t *replay_baton =apr_palloc (pool,sizeof (replay_baton_t)); -void *debug_baton;SVN_ERR (svn_ra_get_latest_revnum (session, &latest_revision, pool));printf ("%ld\n" , latest_revision); - editor =svn_delta_default_editor (pool); + +SVN_ERR (get_dump_editor ((const svn_delta_editor_t **)&dump_editor, + &dump_baton, end_revision, pool)); +SVN_ERR (svn_delta__get_debug_editor ((const svn_delta_editor_t **)&debug_editor, - &debug_baton, editor, -NULL , pool)); + &debug_baton, + (const svn_delta_editor_t *)dump_editor, + dump_baton, pool)); + +replay_baton_t *replay_baton =apr_palloc (pool,sizeof (replay_baton_t)); replay_baton->editor = debug_editor; replay_baton->baton = debug_baton; SVN_ERR(svn_ra_replay_range(session, start_revision, end_revision,
Signature · 1 line
1.7.1