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

Re: [PATCH] (v2) Fixed issue 3436 : Short option for --ignore-externals (-i?)

From: Stefan Sperling <stsp_at_elego.de>
Date: Wed, 2 Sep 2009 09:28:57 +0100

On Wed, Sep 02, 2009 at 11:28:17AM +0800, Edmund Wong wrote:
> Hi,
>
> Aside for being the second attempt at this post, I've added
> a test to this. As it is also my first actual test (though
> I did copy and paste it (sorry Stefan) from another issue,
> I did make sure the test does make sense), I'm not entirely
> sure if there are other checks I need to make. The main
> point of the test is initially create a WC, create some
> externals (which I believe externals_test_setup(sbox)
> does that for me) and then export to a new WC without
> the externals. The compare is with the actual tree and
> the expected tree which has none of the external dirs.
> I am still feeling around the realm of tests so any
> suggested improvements to this is very much appreciated.

Sounds good. The test tests for the semantics of the --ignore-externals
option, which you've shortened to --ie. So for --ie this should work
just as well.

> Log:
>
> [[[
>
> Fix issue #3436: Short option for --ignore-externals (-i?).
>
> Instead of using the suggested -i, markphip suggested --ie
> which is what is implemented following patch in accordance to
> the discussion at
> http://subversion.tigris.org/ds/viewMessage.do?dsMessageId=2370618&dsForumId=462.
> A new test has been added to externals_tests.py to check if the
> exported WC (using svn export --ie) contains any of the externals.
>
> * subversion/svn/main.c
> (svn_cl__options[]): Appended an alias to --ignore-externals and
> added a new option "ie".
>
> * subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
> Appended "[aliases: --ie]" to reflect the change in the help for
> svn help switch, which uses --ignore-externals.
>
> * subversion/tests/cmdline/externals_tests.py
> (export_wc_without_externals) : New test for issue #3436.
>
> Patch by: Edmund Wong ed <at> kdtc.net.
> Suggested by: markphip
> danielsh
> stsp
> ]]]
 
> Index: subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
> ===================================================================
> --- subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (revision 39017)
> +++ subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (working copy)
> @@ -130,6 +130,7 @@
> --diff3-cmd ARG : use ARG as merge command
> --relocate : relocate via URL-rewriting
> --ignore-externals : ignore externals definitions
> + [aliases: --ie]
> --force : force operation to run
> --accept ARG : specify automatic conflict resolution action
> ('postpone', 'base', 'mine-conflict',
> Index: subversion/tests/cmdline/externals_tests.py
> ===================================================================
> --- subversion/tests/cmdline/externals_tests.py (revision 39017)
> +++ subversion/tests/cmdline/externals_tests.py (working copy)
> @@ -1379,6 +1379,42 @@
>
> svntest.main.safe_rmtree(export_target)
>
> +#----------------------------------------------------------------------
> +
> +# Test for issue #3436

I'd simply drop the above comment.
It might be a bit confusing, as #3436 is really about adding an alias
for an existing command line option, rather than about "exports from
a WC without externals". Testing the new --ie option is just a
desirable side-effect of this new test, which tests whether ignoring
externals works when exporting from a working copy.

> +def export_wc_without_externals(sbox):
> + "test exports from wc without externals"

"export from working copy, ignoring externals"

> +
> + externals_test_setup(sbox)
> +
> + wc_dir = sbox.wc_dir
> + repo_url = sbox.repo_url
> + export_target = sbox.add_wc_path('export')
> +
> + # Create a working copy.
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'checkout',
> + repo_url, wc_dir)
> +
> + # Export the working copy without externals
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'export', '--ie',
> + wc_dir, export_target)
> +
> + paths = [
> + os.path.join(export_target, "A", "D", "x"),
> + os.path.join(export_target, "A", "D", "x", "y"),
> + os.path.join(export_target, "A", "D", "x", "y", "z"),
> + os.path.join(export_target, "A", "D", "x", "y", "z", "blah"),
> + os.path.join(export_target, "A", "D", "x", "y", "z", "blah", "E", "alpha"),
> + os.path.join(export_target, "A", "D", "x", "y", "z", "blah", "E", "beta"),
> + ]
> +# probe_paths_exist(paths)

Why is the above line present?

> +
> + probe_paths_missing(paths)
> +
> +
> +
> ########################################################################
> # Run the tests
>
> @@ -1406,6 +1442,7 @@
> XFail(update_lose_file_external),
> XFail(switch_relative_external),
> export_sparse_wc_with_externals,
> + export_wc_without_externals,
> ]
>
> if __name__ == '__main__':
> Index: subversion/svn/main.c
> ===================================================================
> --- subversion/svn/main.c (revision 39017)
> +++ subversion/svn/main.c (working copy)
> @@ -226,7 +226,9 @@
> {"ignore-ancestry", opt_ignore_ancestry, 0,
> N_("ignore ancestry when calculating merges")},
> {"ignore-externals", opt_ignore_externals, 0,
> - N_("ignore externals definitions")},
> + N_("ignore externals definitions\n"
> + " "
> + "[aliases: --e]")},

This should say --ie not --e.

Stefan

> {"diff-cmd", opt_diff_cmd, 1, N_("use ARG as diff command")},
> {"diff3-cmd", opt_merge_cmd, 1, N_("use ARG as merge command")},
> {"editor-cmd", opt_editor_cmd, 1, N_("use ARG as external editor")},
> @@ -303,6 +305,7 @@
> */
>
> {"cl", opt_changelist, 1, NULL},
> + {"ie", opt_ignore_externals, 0, NULL},
>
> {0, 0, 0, 0},
> };

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2390084
Received on 2009-09-02 10:29:34 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.