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

[PATCH] checkout, make sure source exists

From: plasma <plasmaball_at_pchome.com.tw>
Date: 2003-07-15 11:21:59 CEST

Hi all,

If the source of checkout doesn't exists, the destination directory
is still created.

> svnadmin create SVN
> svn co file://`pwd`/SVN/repos repos
  svn: Filesystem has no item
  svn: file not found: revision `0', path `/repos'
> ll
  total 4
  drwxr-xr-x 6 plasma plasma 512 7 15 17:12 SVN
  drwxr-xr-x 3 plasma plasma 512 7 15 17:12 repos

The patch (which is against subversion 0.25) fixes this behavior by
making sure the source does exist before actually doing update.

> svnadmin create SVN
> svn co file://`pwd`/SVN/repos repos
  subversion/libsvn_client/checkout.c:97: (apr_err=125002)
  svn: Bogus URL
  svn: Source URL doesn't exist: file:///home/plasma/tmp/xx/SVN/repos.
> ll
  total 2
  drwxrwxr-x 6 plasma plasma 512 Jul 15 17:14 SVN

All tests in 'make check' are passed.

BTW, I'm not sure if SVN_ERR_BAD_URL is the correct error code.
Please let me know if there's a better one.

plasma

LOG:

* subversion/libsvn_client/checkout.c (svn_client__checkout_internal):
  Make sure the source exists before start to update.

PATCH:

Index: subversion/libsvn_client/checkout.c
===================================================================
--- subversion/libsvn_client/checkout.c (revision 886)
+++ subversion/libsvn_client/checkout.c (revision 887)
@@ -90,6 +90,13 @@
       SVN_ERR (svn_client__get_revision_number
                (&revnum, ra_lib, session, revision, path, pool));
 
+ /* Make sure we have something to work with. */
+ SVN_ERR (ra_lib->check_path(&kind, session, "", revnum, pool));
+ if (kind == svn_node_none)
+ {
+ return svn_error_createf (SVN_ERR_BAD_URL, NULL,
+ "Source URL doesn't exist: %s.", URL);
+ }
       
       SVN_ERR (svn_io_check_path (path, &kind, pool));
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 15 11:41:47 2003

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.