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

[PATCH] - Fix for issue #3792

From: Noorul Islam K M <noorul_at_collab.net>
Date: Thu, 03 Feb 2011 14:15:48 +0530

Attached is the patch to fix issue #3792. Please review and let me know
your comments.

Log
[[[

Fix for issue #3792. Make svn info to display information for
excluded items.

* subversion/include/private/svn_wc_private.h,
  subversion/libsvn_wc/node.c
  (svn_wc__node_depth_is_exclude): New helper function to find
    whether the node is set with depth 'exclude'.

* subversion/libsvn_client/info.c
  (crawl_entries): Build minimal information if the node has
    depth set as 'exclude'.

* subversion/svn/info-cmd.c
  (print_info): Print depth as 'exclude' for nodes having depth
    exclude. Hide node kind while printing exclude infomation.

* subversion/tests/cmdline/depth_tests.py
  (test_list): Remove XFail marker from info_excluded test.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
]]]

Index: subversion/tests/cmdline/depth_tests.py
===================================================================
--- subversion/tests/cmdline/depth_tests.py (revision 1066732)
+++ subversion/tests/cmdline/depth_tests.py (working copy)
@@ -2841,7 +2841,7 @@
               excluded_path_misc_operation,
               excluded_receive_remote_removal,
               exclude_keeps_hidden_entries,
- XFail(info_excluded, issues=3792),
+ info_excluded,
               tree_conflicts_resolved_depth_empty,
               tree_conflicts_resolved_depth_files,
               tree_conflicts_resolved_depth_immediates,
Index: subversion/svn/info-cmd.c
===================================================================
--- subversion/svn/info-cmd.c (revision 1066732)
+++ subversion/svn/info-cmd.c (working copy)
@@ -291,7 +291,8 @@
       break;
 
     case svn_node_none:
- SVN_ERR(svn_cmdline_printf(pool, _("Node Kind: none\n")));
+ if (info->depth != svn_depth_exclude)
+ SVN_ERR(svn_cmdline_printf(pool, _("Node Kind: none\n")));
       break;
 
     case svn_node_unknown:
@@ -363,6 +364,9 @@
         SVN_ERR(svn_cmdline_printf(pool, _("Copied From Rev: %ld\n"),
                                    info->copyfrom_rev));
     }
+
+ if (info->depth == svn_depth_exclude)
+ SVN_ERR(svn_cmdline_printf(pool, _("Depth: exclude\n")));
 
   if (info->last_changed_author)
     SVN_ERR(svn_cmdline_printf(pool, _("Last Changed Author: %s\n"),
Index: subversion/include/private/svn_wc_private.h
===================================================================
--- subversion/include/private/svn_wc_private.h (revision 1066732)
+++ subversion/include/private/svn_wc_private.h (working copy)
@@ -759,6 +759,15 @@
                          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 1066732)
+++ subversion/libsvn_wc/node.c (working copy)
@@ -247,6 +247,30 @@
 }
 
 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);
+}
+
+svn_error_t *
 svn_wc__node_get_depth(svn_depth_t *depth,
                        svn_wc_context_t *wc_ctx,
                        const char *local_abspath,
Index: subversion/libsvn_client/info.c
===================================================================
--- subversion/libsvn_client/info.c (revision 1066732)
+++ subversion/libsvn_client/info.c (working copy)
@@ -405,20 +405,31 @@
       /* Check for a tree conflict on the root node of the info, and if there
          is one, send a minimal info struct. */
       const svn_wc_conflict_description2_t *tree_conflict;
+ svn_boolean_t exclude = FALSE;
 
       SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, ctx->wc_ctx,
                                         local_abspath, pool, pool));
 
- if (tree_conflict)
+ /* Check whether depth of the node is set as exclude. */
+ if (! tree_conflict)
+ SVN_ERR(svn_wc__node_depth_is_exclude(&exclude, ctx->wc_ctx,
+ local_abspath, pool));
+
+ if (tree_conflict || exclude)
         {
           svn_info_t *info;
           svn_error_clear(err);
 
           SVN_ERR(build_info_for_unversioned(&info, pool));
- info->tree_conflict = svn_wc__cd2_to_cd(tree_conflict, pool);
 
+ if (tree_conflict)
+ info->tree_conflict = svn_wc__cd2_to_cd(tree_conflict, pool);
+ else
+ info->depth = svn_depth_exclude;
+
           SVN_ERR(svn_wc__node_get_repos_info(&(info->repos_root_URL),
- NULL,
+ exclude ?
+ &(info->repos_UUID) : NULL,
                                               ctx->wc_ctx,
                                               local_abspath, FALSE, FALSE,
                                               pool, pool));
Received on 2011-02-03 09:48:44 CET

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