subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Foad <jul...@foad.me.uk>
Subject Re: [PATCH] Add '--include' and '--exclude' options to 'svnadmin dump'
Date Fri, 28 Oct 2016 15:15:06 GMT
On 12/10/16, Sergey Raevskiy wrote:
> I've attached a patch that adds '--include/--exclude' options to 'svnadmin
> dump'. These options work similarly to 'svndumpfilter include/exclude'
> but provide proper handling of 'copy from' paths.

Thank you! As I'm sure you're aware, this feature has been wanted almost 
forever. For example, over ten years ago

Ben Collins-Sussman wrote "History simply cannot be filtered by 
filtering a stream; the filtering process sometimes needs random-access 
to all of the history. [...] 'svndumpfilter' needs to die, and the 
functionality needs to be pushed into 'svnadmin dump' directly." [1]

However, I don't have the capacity to review it. I hope someone can.

- Julian


[1] On users@, 2005-08-17, "Re: svndumpfilter: Invalid copy source 
path", https://svn.haxx.se/users/archive-2005-08/0744.shtml


> Consider the following example with svndumpfilter:
> [[
> $ svnadmin create /repo
> $ svn mkdir -m "" file:///repo/A
> $ svn copy -m "" file:///repo/A file:///repo/B
> $ svnadmin dump /repo | svndumpfilter include /B > dump
> ...
> Revision 0 committed as 0.
> Revision 1 committed as 1.
> svndumpfilter: E200003: Invalid copy source path '/A'
> ]]
>
> The 'svnadmin dump' with proposed include/exclude options can handle this use
> case properly:
> [[
> $ svnadmin dump /repo --include /B > dump
> * Dumped revision 0.
> * Dumped revision 1.
> * Dumped revision 2.
> ]]
>
> The proposed options are implemented using 'svn_repos_authz_func_t' and the
> not-included copy sources are hidden by the 'svn_repos' layer.

[...]
> Log message:
>
> [[
> Add '--include' and '--exclude' options to 'svnadmin dump'.
>
> * include/svn_repos.h
>   (svn_repos_dump_filter_func_t): New.
>   (svn_repos_dump_fs4): Update function signature and comment.
>   (svn_repos_dump_fs3): Update comment.
>
> * libsvn_repos/deprecated.c
>   (svn_repos_dump_fs3): Update caller.
>
> * libsvn_repos/dump.c
>   (write_revision_record): Call to svn_repos_fs_revision_proplist() (with
>    AUTHZ_FUNC) instead of svn_fs_revision_proplist2() to filter revision
>    properties as well as revisions. Update comment.
>   (dump_filter_baton_t,
>    dump_filter_authz_func): New.
>   (svn_repos_dump_fs4): Initialize and pass AUTHZ_FUNC and AUTHZ_BATON to
>    the repos layer API if FILTER_FUNC is specified by caller.
>
> * subversion/svnadmin/svnadmin.c
>   (svnadmin__cmdline_options_t): Add enum values for new options.
>   (options_table): Add new options.
>   (cmd_table): Add new options to 'dump' subcommand.
>   (svnadmin_opt_state): Add new fields to represent new options.
>   (ary_prefix_match): New. Copied from svndumpfilter.
>   (dump_filter_baton_t,
>    dump_filter_func): New.
>   (subcommand_dump): Initialize FILTER_BATON.  Pass DUMP_FILTER_FUNC and a
>    pointer to FILTER_BATON to svn_repos_dump_fs() if any filtering prefixes
>    specified.
>   (sub_main): Handle new options.
>
> * subversion/tests/cmdline/svnadmin_tests.py
>   (dump_exclude,
>    dump_exclude_copysource,
>    dump_include,
>    dump_not_include_copysource,
>    dump_exclude_by_pattern,
>    dump_include_by_pattern,
>    dump_exclude_all_rev_changes,
>    dump_invalid_filtering_option): New.
>   (test_list): Add new tests to table.
>
> * subversion/tests/libsvn_repos/dump-load-test.c
>   (test_dump_bad_props): Update caller.
>
> Patch by: sergey.raevskiy{_AT_}visualsvn.com
> ]]
>

Mime
View raw message