[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Add '--include' and '--exclude' options to 'svnadmin dump'

From: Sergey Raevskiy <sergey.raevskiy_at_visualsvn.com>
Date: Wed, 12 Oct 2016 15:58:37 +0300

Hi Bert, thanks for your reply.

The problem that I've described is not about revision numbers, it's about copied
nodes.

Suppose we have an repository 'repo' containing nodes '/A' and '/B',
where '/B' (or some path under '/B') was create by copying of '/A' (or some
path under '/A').

Now, if we run 'svndumpfilter include /B' against dump of 'repo', we will get
an error:

[[
...
svndumpfilter: E200003: Invalid copy source path '/A'
]]

This happens because 'svndumpfilter' tries to add copy of '/A', but node '/A'
is not included in destination dump.

On Wed, Oct 12, 2016 at 2:10 PM, Bert Huijben <bert_at_qqmail.nl> wrote:
>
>
>> -----Original Message-----
>> From: Sergey Raevskiy [mailto:sergey.raevskiy_at_visualsvn.com]
>> Sent: woensdag 12 oktober 2016 12:44
>> To: Subversion Development <dev_at_subversion.apache.org>
>> Subject: [PATCH] Add '--include' and '--exclude' options to 'svnadmin dump'
>>
>> Hi!
>>
>> 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.
>>
>> 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
>
> I don't see a --renumber-revs on your invocation of svndumpfilter. Did you try these options to see if these resolve your problem (they should)
>
> $ svndumpfilter help include
> include: Filter out nodes without given prefixes from dumpstream.
> usage: svndumpfilter include PATH_PREFIX...
>
> Valid options:
> --drop-empty-revs : Remove revisions emptied by filtering.
> --drop-all-empty-revs : Remove all empty revisions found in dumpstream
> except revision 0.
> --renumber-revs : Renumber revisions left after filtering.
> --skip-missing-merge-sources : Skip missing merge sources.
> --targets ARG : Read additional prefixes, one per line, from
> file ARG.
> --preserve-revprops : Don't filter revision properties.
> --quiet : Do not display filtering statistics.
> --pattern : Treat the path prefixes as file glob patterns.
>
>
> Bert
>
>> ...
>> 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.
>>
>> Some usage examples for the proposed options:
>> [[
>> $ svnadmin dump repos --include /calc > calc-dumpfile
>> ...
>> $ svnadmin dump repos --include /calc --include /calendar > dumpfile
>> ...
>> $ svnadmin dump repos --exclude /secret > dumpfile
>> ...
>> $ svnadmin dump repos --include /calc --exclude /calendar > dumpfile
>> svnadmin: E205000: Try 'svnadmin help' for more info
>> svnadmin: E205000: '--exclude' and '--include' options cannot be used
>> simultaneously
>>
>> $ svnadmin dump repos --include /cal* --pattern > dumpfile
>> ...
>> ]]
>>
>> 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
>> ]]
>
Received on 2016-10-12 14:59:10 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.