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

Re: [PATCH] error on export of nonexistent url

From: Martin Furter <mf_at_rola.ch>
Date: 2007-01-24 01:12:46 CET

On Tue, 23 Jan 2007, Daniel Rall wrote:

> On Tue, 23 Jan 2007, Lieven Govaerts wrote:
>
>> Martin Furter wrote:
> ...
>>> If noone objects I'm going to run the full test suite and commit this
>>> in a few days.
>>
>> Did someone already approve this patch?

I thought it's an (almost) obvious fix but I don't dare to commit anything
I'm not 120% sure it's the right thing. I'm sorry I didn't want to scare
you :)

> Not that I'm aware of. I committed it to trunk in r23191 and r23193.
> (I was at first unsure of the export.c change because I mis-read it a
> couple of times, bleh.)

Daniel, you changed my precious code! ;)
... which causes it to fail here:

$ python export_tests.py 3
Error about nonexistent URL expected
EXCEPTION: SVNExpectedStderr
FAIL: export_tests.py 3: attempt to export a nonexistent URL

Index: subversion/tests/cmdline/export_tests.py
===================================================================
--- subversion/tests/cmdline/export_tests.py (revision 23190)
+++ subversion/tests/cmdline/export_tests.py (revision 23191)
@@ -64,6 +64,17 @@
                                          expected_output,
                                          svntest.main.greek_state.copy())

+def export_nonexistent_url(sbox):
+ "attempt to export a nonexistent URL"
+ sbox.build(create_wc = False)
I assume 'create_wc = False' means do not checkout so the sbox.wc_dir will
not exist.

+
+ svntest.main.safe_rmtree(sbox.wc_dir)
+ export_target = os.path.join(sbox.wc_dir, 'nonexistent')
If my assumption is right this join is not needed.

+ nonexistent_url = sbox.repo_url
sbox.repo_url is the base URL of the repos which always exists but we want
to checkout a *nonexisting* dir.

+ svntest.actions.run_and_verify_svn("Error about nonexistent URL expected",
+ None, svntest.SVNAnyOutput,
+ 'export', nonexistent_url, export_target)

Another question: Why did you add curly braces around the
'return svn_error_createf(...)' ?
I don't see anything in hacking or in the gnu standards document. I'm
just curious if this is the preferred way for new code in subversion so I
can do it better next time.

Martin

[[[
Fix the test for the fix of the attempt to export of a nonexistent URL.

* subversion/tests/cmdline/export_tests.py
   (export_nonexistent_url): Make the URL point to a nonexistent node.
]]]

Index: subversion/tests/cmdline/export_tests.py
===================================================================
--- subversion/tests/cmdline/export_tests.py (revision 23199)
+++ subversion/tests/cmdline/export_tests.py (working copy)
@@ -70,7 +70,7 @@

    svntest.main.safe_rmtree(sbox.wc_dir)
    export_target = os.path.join(sbox.wc_dir, 'nonexistent')
- nonexistent_url = sbox.repo_url
+ nonexistent_url = sbox.repo_url + "/nonexistent"
    svntest.actions.run_and_verify_svn("Error about nonexistent URL expected",
                                       None, svntest.SVNAnyOutput,
                                       'export', nonexistent_url, export_target)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jan 24 01:13:04 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.