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

[PATCH] error on export of nonexistent url

From: Martin Furter <mf_at_rola.ch>
Date: 2007-01-23 19:25:14 CET

Hello

Alexander Sinyushkin asked in IRC if it's a bug that export does not fail
for nonexistent URLs and DannyB said that many more people reported that
bug. So I wrote the following patch.

I ran the export tests only which show the following output before the
patch to export.c:

No error where one is expected
EXCEPTION: SVNExpectedStderr
FAIL: export_tests.py 3: export a nonexistent url

And this with the patch:

PASS: export_tests.py 2: export the greek tree
PASS: export_tests.py 3: export a nonexistent url
PASS: export_tests.py 4: export working copy

Shall I run the full test suite or is it enough to run the export tests
only for such a trivial patch?

If noone objects I'm going to run the full test suite and commit this in a
few days.

Martin

[[[
Print error on export of nonexistent URL.

* subversion/libsvn_client/export.c
   (svn_client_export3): Return error for nonexistent URL.

* subversion/tests/cmdline/export_tests.py
   (export_nonexistent_url): New function.
   (test_list): Add new test.

Suggested by: Alexander Sinyushkin <Alexander.Sinyushkin@svnkit.com>
Approved by:
]]]

Index: subversion/libsvn_client/export.c
===================================================================
--- subversion/libsvn_client/export.c (revision 23186)
+++ subversion/libsvn_client/export.c (working copy)
@@ -889,6 +889,9 @@
              SVN_ERR(svn_client__fetch_externals(eb->externals, TRUE,
                                                  &use_sleep, ctx, pool));
          }
+ else
+ return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
+ _("URL '%s' doesn't exist"), from);
      }
    else
      {
Index: subversion/tests/cmdline/export_tests.py
===================================================================
--- subversion/tests/cmdline/export_tests.py (revision 23186)
+++ subversion/tests/cmdline/export_tests.py (working copy)
@@ -64,6 +64,17 @@
                                          expected_output,
                                          svntest.main.greek_state.copy())

+def export_nonexistent_url(sbox):
+ "export a nonexistent url"
+ sbox.build(create_wc = False)
+
+ svntest.main.safe_rmtree(sbox.wc_dir)
+ export_target = sbox.wc_dir
+ nonexistent_url = sbox.repo_url + '/A/C/nonexistent'
+ svntest.actions.run_and_verify_svn("No error where one is expected",
+ None, svntest.SVNAnyOutput,
+ 'export', nonexistent_url, export_target)
+
  def export_working_copy(sbox):
    "export working copy"
    sbox.build()
@@ -393,6 +404,7 @@
  test_list = [ None,
                export_empty_directory,
                export_greek_tree,
+ export_nonexistent_url,
                export_working_copy,
                export_working_copy_with_mods,
                export_over_existing_dir,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jan 23 19:25:35 2007

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.