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

Re: [PATCH] - Fix for issue #3792

From: Noorul Islam K M <noorul_at_collab.net>
Date: Fri, 04 Mar 2011 08:56:49 +0530

Stefan Sperling <stsp_at_elego.de> writes:

> On Thu, Mar 03, 2011 at 10:39:11PM +0530, Noorul Islam K M wrote:
>
>> @@ -164,9 +171,18 @@
>> if (tmpinfo->depth == svn_depth_unknown)
>> tmpinfo->depth = svn_depth_infinity;
>>
>> - SVN_ERR(svn_wc__node_get_schedule(&tmpinfo->schedule, NULL,
>> - wc_ctx, local_abspath, pool));
>> + if (exclude)
>> + tmpinfo->depth = svn_depth_exclude;
>>
>> + err = svn_wc__node_get_schedule(&tmpinfo->schedule, NULL,
>> + wc_ctx, local_abspath, pool);
>> +
>
> The following needs some curly braces:
>
>> + if (err)
>> + if (exclude && err->apr_err == SVN_ERR_ENTRY_NOT_FOUND)
>> + svn_error_clear(err);
>> + else
>> + return svn_error_return(err);
>> +
>> SVN_ERR(svn_wc_get_wc_root(&tmpinfo->wcroot_abspath, wc_ctx,
>> local_abspath, pool, pool));
>>

I saw the warning but I thought it is readable and easily understood.

Please find attached updated patch.

Thanks and Regards
Noorul

Index: subversion/tests/cmdline/depth_tests.py
===================================================================
--- subversion/tests/cmdline/depth_tests.py (revision 1076929)
+++ subversion/tests/cmdline/depth_tests.py (working copy)
@@ -2348,8 +2348,6 @@
                                      'mkdir', 'C')
 
 
-# Issue 3792.
-_at_XFail()
 @Issue(3792)
 def info_excluded(sbox):
   "'info' should treat excluded item as versioned"
Index: subversion/svn/info-cmd.c
===================================================================
--- subversion/svn/info-cmd.c (revision 1076929)
+++ subversion/svn/info-cmd.c (working copy)
@@ -344,6 +344,10 @@
           SVN_ERR(svn_cmdline_printf(pool, _("Depth: immediates\n")));
           break;
 
+ case svn_depth_exclude:
+ SVN_ERR(svn_cmdline_printf(pool, _("Depth: exclude\n")));
+ break;
+
         case svn_depth_infinity:
           /* Infinity is the default depth for working copy
              directories. Let's not print it, it's not special enough
Index: subversion/include/private/svn_wc_private.h
===================================================================
--- subversion/include/private/svn_wc_private.h (revision 1076929)
+++ subversion/include/private/svn_wc_private.h (working copy)
@@ -764,6 +764,16 @@
                          apr_pool_t *result_pool,
                          apr_pool_t *scratch_pool);
 
+/**
+ * Find whether @a local_abspath is set with depth exclude using @a wc_ctx.
+ */
+svn_error_t *
+svn_wc__node_depth_is_exclude(svn_boolean_t *exclude,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/libsvn_wc/node.c
===================================================================
--- subversion/libsvn_wc/node.c (revision 1076929)
+++ subversion/libsvn_wc/node.c (working copy)
@@ -1528,3 +1528,28 @@
 
   return SVN_NO_ERROR;
 }
+
+svn_error_t *
+svn_wc__node_depth_is_exclude(svn_boolean_t *exclude,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
+{
+ svn_wc__db_status_t status;
+ svn_error_t *err;
+
+ *exclude = FALSE;
+
+ err = svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ wc_ctx->db, local_abspath, scratch_pool,
+ scratch_pool);
+
+ if ((! err) && (status == svn_wc__db_status_excluded))
+ *exclude = TRUE;
+
+ return svn_error_return(err);
+}
+
Index: subversion/libsvn_client/info.c
===================================================================
--- subversion/libsvn_client/info.c (revision 1076929)
+++ subversion/libsvn_client/info.c (working copy)
@@ -96,13 +96,20 @@
   apr_time_t lock_date;
   const svn_checksum_t *checksum;
   svn_node_kind_t kind;
+ svn_error_t *err;
+ svn_boolean_t exclude = FALSE;
 
   SVN_ERR(svn_wc_read_kind(&kind, wc_ctx, local_abspath, FALSE, pool));
 
   if (kind == svn_node_none)
- return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
- _("The node '%s' was not found."),
- svn_dirent_local_style(local_abspath, pool));
+ {
+ svn_error_clear(svn_wc__node_depth_is_exclude(&exclude, wc_ctx,
+ local_abspath, pool));
+ if (! exclude)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The node '%s' was not found."),
+ svn_dirent_local_style(local_abspath, pool));
+ }
 
   tmpinfo = apr_pcalloc(pool, sizeof(*tmpinfo));
   tmpinfo->kind = kind;
@@ -164,9 +171,20 @@
   if (tmpinfo->depth == svn_depth_unknown)
     tmpinfo->depth = svn_depth_infinity;
 
- SVN_ERR(svn_wc__node_get_schedule(&tmpinfo->schedule, NULL,
- wc_ctx, local_abspath, pool));
+ if (exclude)
+ tmpinfo->depth = svn_depth_exclude;
 
+ err = svn_wc__node_get_schedule(&tmpinfo->schedule, NULL,
+ wc_ctx, local_abspath, pool);
+
+ if (err)
+ {
+ if (exclude && err->apr_err == SVN_ERR_ENTRY_NOT_FOUND)
+ svn_error_clear(err);
+ else
+ return svn_error_return(err);
+ }
+
   SVN_ERR(svn_wc_get_wc_root(&tmpinfo->wcroot_abspath, wc_ctx,
                              local_abspath, pool, pool));
 
Received on 2011-03-04 04:27:34 CET

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