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

[PATCH] 'svn st --ignore-prop' (was Re: Proposal: --no-props switch for 'log', 'st' and 'diff')

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Thu, 04 Sep 2008 08:55:33 -0500

Hyrum K. Wright wrote:
> I'm currently investigating a generic '--ignore-prop' switch, initially for 'svn
> st'. It is being written in such a way that we could easily alias
> '--ignore-mergeinfo' or '--forget-merges' or
> '--dont-get-in-my-way-i'm-trying-to-do-real-work' to mean '--ignore-prop
> svn:mergeinfo'. I hope to have a proof-of-concept patch done in a few days.

As promised, here's a patch which implements the above. It completely
implements the functionality which it claims to, but there is still future work
to be done to flesh out the feature. This does not add a '--ignore-mergeinfo'
alias as discussed above, but adding such would be trivial.

I'd appreciate any feedback, but if there aren't serious objections, I'll commit
the patch in the next day or two.

[[[
Add support for ignoring arbitrary property modifications in 'svn st'.
This currently only works locally, not with 'svn st -u'.

* subversion/tests/cmdline/stat_tests.py
  (status_ignored_props): New test.
  (test_list): Run the new test.

* subversion/svn/cl.h
  (svn_cl__opt_state_t): New hash to hold the ignore properties.

* subversion/svn/main.c
  (svn_cl__longopt_t, svn_cl__options, main): Add support for the
    '--ignore-prop' switch.
  (svn_opt_subcommand_desc2_t): Let 'svn st' accept '--ignore-prop'.

* subversion/svn/status-cmd.c
  (svn_cl__status): Pass along the ignored props to the client library.

* subversion/include/svn_wc.h
  (svn_wc_status3): New.
  (svn_wc_status2): Deprecate.
  (svn_wc_get_status_editor4): New.
  (svn_wc_get_status_editor3): Deprecate.

* subversion/include/svn_client.h
  (svn_client_status4): New.
  (svn_client_status3): Deprecated.

* subversion/libsvn_wc/props.c
  (modified_props): Use ignored_props to calculate the property
    modification.
  (svn_wc_props_modified_p, svn_wc__has_prop_mods): Adjust call to
    modified_props.

* subversion/libsvn_wc/props.h
  (svn_wc__has_prop_mods): Use ignored_props.

* subversion/libsvn_wc/log.c
  (log_do_committed): Don't ignore any props.

* subversion/libsvn_wc/status.c
  (struct edit_baton, assemble_status, send_status_structure,
   handle_dir_entry, get_dir_status): Track the ignored properties.
  (send_unversioned_item): Don't bother ignoring properties.
  (svn_wc_get_status_editor4, svn_wc_status3): New.
  (svn_wc_get_status_editor3, svn_wc_status2): Deprecate and reimplement
    as a wrapper.

* subversion/libsvn_client/status.c
  (svn_client_status4): New.
  (svn_client_status3): Deprecate, and reimplement as a wrapper.
]]]

Index: subversion/tests/cmdline/stat_tests.py
===================================================================
--- subversion/tests/cmdline/stat_tests.py (revision 32889)
+++ subversion/tests/cmdline/stat_tests.py (working copy)
@@ -1510,6 +1510,55 @@
                                      [],
                                      "status", "-u")
 
+
+#----------------------------------------------------------------------
+
+def status_ignored_props(sbox):
+ "'svn st --ignore-prop FOO'"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ os.chdir(wc_dir)
+
+ A_path = 'A'
+ C_path = os.path.join(A_path, 'C')
+ D_path = os.path.join(A_path, 'D')
+ H_path = os.path.join(D_path, 'H')
+ beta_path = os.path.join(A_path, 'B', 'E', 'beta')
+ gamma_path = os.path.join(D_path, 'gamma')
+ iota_path = 'iota'
+ chi_path = os.path.join(H_path, 'chi')
+
+ # Set some properties
+ svntest.main.run_svn(None, 'propset', 'svn:foo', 'bar', beta_path, H_path,
+ C_path, gamma_path)
+ svntest.main.run_svn(None, 'propset', 'svn:bar', 'foo', iota_path, chi_path)
+
+ # Check vanilla status
+ expected = svntest.verify.UnorderedOutput(
+ [' M ' + beta_path + '\n',
+ ' M ' + H_path + '\n',
+ ' M ' + C_path + '\n',
+ ' M ' + gamma_path + '\n',
+ ' M ' + iota_path + '\n',
+ ' M ' + chi_path + '\n'])
+ svntest.actions.run_and_verify_svn(None, expected, [], 'status')
+
+ # Check '--ignore-prop' status on one property
+ expected = svntest.verify.UnorderedOutput([
+ ' M ' + iota_path + '\n',
+ ' M ' + chi_path + '\n'])
+ svntest.actions.run_and_verify_svn(None, expected, [], 'status',
+ '--ignore-prop', 'svn:foo')
+
+ # Check '--ignore-prop' status on all the properties
+ expected = svntest.verify.UnorderedOutput([])
+ svntest.actions.run_and_verify_svn(None, expected, [], 'status',
+ '--ignore-prop', 'svn:foo',
+ '--ignore-prop', 'svn:bar')
+
+
 ########################################################################
 # Run the tests
 
@@ -1547,6 +1596,7 @@
               status_depth_local,
               status_depth_update,
               status_dash_u_type_change,
+ status_ignored_props,
              ]
 
 if __name__ == '__main__':
Index: subversion/svn/cl.h
===================================================================
--- subversion/svn/cl.h (revision 32889)
+++ subversion/svn/cl.h (working copy)
@@ -209,6 +209,7 @@
   svn_boolean_t reintegrate; /* use "reintegrate" merge-source heuristic */
   svn_boolean_t trust_server_cert; /* trust server SSL certs that would
                                       otherwise be rejected as "untrusted" */
+ apr_hash_t *ignored_props; /* list of props to ignore changes to */
 } svn_cl__opt_state_t;
 
 
Index: subversion/svn/main.c
===================================================================
--- subversion/svn/main.c (revision 32889)
+++ subversion/svn/main.c (working copy)
@@ -102,7 +102,8 @@
   opt_accept,
   opt_show_revs,
   opt_reintegrate,
- opt_trust_server_cert
+ opt_trust_server_cert,
+ opt_ignore_prop
 } svn_cl__longopt_t;
 
 /* Option codes and descriptions for the command line client.
@@ -269,6 +270,8 @@
                        "('merged', 'eligible')")},
   {"reintegrate", opt_reintegrate, 0,
                     N_("lump-merge all of source URL's unmerged changes")},
+ {"ignore-prop", opt_ignore_prop, 1,
+ N_("Ingore changes to property ARG")},
 
   /* Long-opt Aliases
    *
@@ -873,7 +876,7 @@
      " 965 687 joe wc/zig.c\n"
      " Status against revision: 981\n"),
     { 'u', 'v', 'N', opt_depth, 'q', opt_no_ignore, opt_incremental, opt_xml,
- opt_ignore_externals, opt_changelist} },
+ opt_ignore_externals, opt_changelist, opt_ignore_prop} },
 
   { "switch", svn_cl__switch, {"sw"}, N_
     ("Update the working copy to a different URL.\n"
@@ -1487,6 +1490,13 @@
       case opt_reintegrate:
         opt_state.reintegrate = TRUE;
         break;
+ case opt_ignore_prop:
+ if (opt_state.ignored_props == NULL)
+ opt_state.ignored_props = apr_hash_make(pool);
+
+ apr_hash_set(opt_state.ignored_props, apr_pstrdup(pool, opt_arg),
+ APR_HASH_KEY_STRING, (void *) 0xdeadbeef);
+ break;
       default:
         /* Hmmm. Perhaps this would be a good place to squirrel away
            opts that commands like svn diff might need. Hmmm indeed. */
Index: subversion/svn/status-cmd.c
===================================================================
--- subversion/svn/status-cmd.c (revision 32889)
+++ subversion/svn/status-cmd.c (working copy)
@@ -245,7 +245,7 @@
 
       /* Retrieve a hash of status structures with the information
          requested by the user. */
- SVN_ERR(svn_cl__try(svn_client_status3(&repos_rev, target, &rev,
+ SVN_ERR(svn_cl__try(svn_client_status4(&repos_rev, target, &rev,
                                              print_status, &sb,
                                              opt_state->depth,
                                              opt_state->verbose,
@@ -253,6 +253,7 @@
                                              opt_state->no_ignore,
                                              opt_state->ignore_externals,
                                              opt_state->changelists,
+ opt_state->ignored_props,
                                              ctx, subpool),
                           NULL, opt_state->quiet,
                           /* not versioned: */
Index: subversion/include/svn_wc.h
===================================================================
--- subversion/include/svn_wc.h (revision 32889)
+++ subversion/include/svn_wc.h (working copy)
@@ -2528,8 +2528,26 @@
  * straightforward in their meanings. See the comments on the
  * @c svn_wc_status_kind structure for some hints.
  *
+ * @a ignored_props is a hash of property names which will be ignored when
+ * checking for property modifications.
+ *
+ * @since New in 1.6.
+ */
+svn_error_t *
+svn_wc_status3(svn_wc_status2_t **status,
+ const char *path,
+ apr_hash_t *ignored_props,
+ svn_wc_adm_access_t *adm_access,
+ apr_pool_t *pool);
+
+
+/**
+ * Same as svn_wc_status3(), but @a ignored_props is always @c NULL.
+ *
  * @since New in 1.2.
+ * @deprecated Provided for backward compatibility with the 1.5 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_wc_status2(svn_wc_status2_t **status,
                const char *path,
@@ -2630,8 +2648,35 @@
  * Allocate the editor itself in @a pool, but the editor does temporary
  * allocations in a subpool of @a pool.
  *
+ * @since New in 1.6.
+ */
+svn_error_t *
+svn_wc_get_status_editor4(const svn_delta_editor_t **editor,
+ void **edit_baton,
+ void **set_locks_baton,
+ svn_revnum_t *edit_revision,
+ svn_wc_adm_access_t *anchor,
+ const char *target,
+ svn_depth_t depth,
+ svn_boolean_t get_all,
+ svn_boolean_t no_ignore,
+ apr_array_header_t *ignore_patterns,
+ apr_hash_t *ignored_props,
+ svn_wc_status_func2_t status_func,
+ void *status_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ svn_wc_traversal_info_t *traversal_info,
+ apr_pool_t *pool);
+
+/**
+ * Same as svn_wc_get_status_editor4(), but @a ignored_props is always
+ * @c NULL.
+ *
  * @since New in 1.5.
+ * @deprecated Provided for backward compatibility with the 1.5 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_wc_get_status_editor3(const svn_delta_editor_t **editor,
                           void **edit_baton,
Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h (revision 32889)
+++ subversion/include/svn_client.h (working copy)
@@ -1805,8 +1805,35 @@
  * it's a member of one of those changelists. If @a changelists is
  * empty (or altogether @c NULL), no changelist filtering occurs.
  *
+ * @a ignored_props is a hash of property names for which modifications
+ * will be ignored.
+ *
+ * @since New in 1.6.
+ */
+svn_error_t *
+svn_client_status4(svn_revnum_t *result_rev,
+ const char *path,
+ const svn_opt_revision_t *revision,
+ svn_wc_status_func2_t status_func,
+ void *status_baton,
+ svn_depth_t depth,
+ svn_boolean_t get_all,
+ svn_boolean_t update,
+ svn_boolean_t no_ignore,
+ svn_boolean_t ignore_externals,
+ const apr_array_header_t *changelists,
+ const apr_hash_t *ignored_props,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/**
+ * Like svn_client_status4(), except with @a ignored_props passed as
+ * @c NULL.
+ *
  * @since New in 1.5.
+ * @deprecated Provided for backward compatibility with the 1.5 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_client_status3(svn_revnum_t *result_rev,
                    const char *path,
@@ -1822,6 +1849,7 @@
                    svn_client_ctx_t *ctx,
                    apr_pool_t *pool);
 
+
 /**
  * Like svn_client_status3(), except with @a changelists passed as @c
  * NULL, and with @a recurse instead of @a depth. If @a recurse is
Index: subversion/libsvn_wc/props.c
===================================================================
--- subversion/libsvn_wc/props.c (revision 32889)
+++ subversion/libsvn_wc/props.c (working copy)
@@ -2828,6 +2828,7 @@
 modified_props(svn_boolean_t *modified_p,
                const char *path,
                apr_hash_t **which_props,
+ apr_hash_t *ignored_props,
                svn_wc_adm_access_t *adm_access,
                apr_pool_t *pool)
 {
@@ -2841,6 +2842,9 @@
   if (want_props)
     *which_props = apr_hash_make(pool);
 
+ if (ignored_props && apr_hash_count(ignored_props) == 0)
+ ignored_props = NULL;
+
   SVN_ERR(svn_wc_entry(&entry, path, adm_access, TRUE, subpool));
 
   /* If we have no entry, we can't have any prop mods. */
@@ -2855,9 +2859,9 @@
   if (wc_format > SVN_WC__NO_PROPCACHING_VERSION)
     {
       /* Only continue if there are prop mods
- and we want to know the details. */
+ and we want to know the details or we have ignored props. */
       *modified_p = entry->has_prop_mods;
- if (!*modified_p || !want_props)
+ if (!*modified_p || (!want_props && !ignored_props))
         goto cleanup;
     }
 
@@ -2873,7 +2877,7 @@
 
   /* Check for numerous easy outs on older WC formats before we
      resort to svn_prop_diffs(). */
- if (wc_format <= SVN_WC__NO_PROPCACHING_VERSION)
+ if (wc_format <= SVN_WC__NO_PROPCACHING_VERSION && !ignored_props)
     {
       svn_boolean_t bempty, wempty;
       /* Decide if either path is "empty" of properties. */
@@ -3008,20 +3012,34 @@
       }
     else
       {
- *modified_p = TRUE;
-
- /* Record the changed props if that's what we want. */
- if (want_props)
+ if (!ignored_props && !want_props)
           {
+ *modified_p = TRUE;
+ }
+ else
+ {
             int i;
+ *modified_p = FALSE;
+
             for (i = 0; i < local_propchanges->nelts; i++)
               {
                 svn_prop_t *propt = &APR_ARRAY_IDX(local_propchanges, i,
                                                    svn_prop_t);
- apr_hash_set(*which_props, propt->name,
- APR_HASH_KEY_STRING, propt->value);
+
+ /* Make sure this property is not on our ignored list. */
+ if (ignored_props
+ && apr_hash_get(ignored_props, propt->name,
+ APR_HASH_KEY_STRING))
+ continue;
+
+ /* Record the changed props if that's what we want. */
+ if (want_props)
+ apr_hash_set(*which_props, propt->name,
+ APR_HASH_KEY_STRING, propt->value);
+
+ *modified_p = TRUE;
               }
- }
+ }
       }
   }
 
@@ -3038,17 +3056,18 @@
                         svn_wc_adm_access_t *adm_access,
                         apr_pool_t *pool)
 {
- return modified_props(modified_p, path, NULL, adm_access, pool);
+ return modified_props(modified_p, path, NULL, NULL, adm_access, pool);
 }
 
 
 svn_error_t *
 svn_wc__has_prop_mods(svn_boolean_t *prop_mods,
                       const char *path,
+ apr_hash_t *ignored_props,
                       svn_wc_adm_access_t *adm_access,
                       apr_pool_t *pool)
 {
- return modified_props(prop_mods, path, NULL, adm_access, pool);
+ return modified_props(prop_mods, path, NULL, ignored_props, adm_access, pool);
 }
 
 
Index: subversion/libsvn_wc/props.h
===================================================================
--- subversion/libsvn_wc/props.h (revision 32889)
+++ subversion/libsvn_wc/props.h (working copy)
@@ -195,11 +195,15 @@
 
 /* Check PATH for prop mods, returning the result in *PROP_MODS.
 
+ If IGNORED_PROPS is not NULL, any modifications to properties whose
+ names are keys in the hash will be ignored.
+
    This function takes into account that some working copy versions
    don't have a has_prop_mods cache laying around */
 svn_error_t *
 svn_wc__has_prop_mods(svn_boolean_t *prop_mods,
                       const char *path,
+ apr_hash_t *ignored_props,
                       svn_wc_adm_access_t *adm_access,
                       apr_pool_t *pool);
 
Index: subversion/libsvn_wc/log.c
===================================================================
--- subversion/libsvn_wc/log.c (revision 32889)
+++ subversion/libsvn_wc/log.c (working copy)
@@ -1228,8 +1228,8 @@
                                 remove_deleted_entry, loggy, pool));
     }
 
- SVN_ERR(svn_wc__has_prop_mods(&prop_mods,
- full_path, loggy->adm_access, pool));
+ SVN_ERR(svn_wc__has_prop_mods(&prop_mods, full_path, NULL,
+ loggy->adm_access, pool));
   if (prop_mods)
     {
       if (entry->kind == svn_node_file)
Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c (revision 32889)
+++ subversion/libsvn_wc/status.c (working copy)
@@ -87,6 +87,9 @@
   svn_wc_traversal_info_t *traversal_info;
   apr_hash_t *externals;
 
+ /* Properties to which changes will be ignored. */
+ apr_hash_t *ignored_props;
+
   /* Status item for the path represented by the anchor of the edit. */
   svn_wc_status2_t *anchor_status;
 
@@ -244,6 +247,7 @@
                 svn_node_kind_t path_kind, svn_boolean_t path_special,
                 svn_boolean_t get_all,
                 svn_boolean_t is_ignored,
+ apr_hash_t *ignored_props,
                 apr_hash_t *repos_locks,
                 const char *repos_root,
                 apr_pool_t *pool)
@@ -375,8 +379,8 @@
         final_prop_status = svn_wc_status_normal;
 
       /* If the entry has a property file, see if it has local changes. */
- SVN_ERR(svn_wc__has_prop_mods(&prop_modified_p, path, adm_access,
- pool));
+ SVN_ERR(svn_wc__has_prop_mods(&prop_modified_p, path, ignored_props,
+ adm_access, pool));
 
 #ifdef HAVE_SYMLINK
       if (has_props)
@@ -539,6 +543,7 @@
                       svn_boolean_t path_special,
                       svn_boolean_t get_all,
                       svn_boolean_t is_ignored,
+ apr_hash_t *ignored_props,
                       apr_hash_t *repos_locks,
                       const char *repos_root,
                       svn_wc_status_func2_t status_func,
@@ -549,7 +554,7 @@
 
   SVN_ERR(assemble_status(&statstruct, path, adm_access, entry, parent_entry,
                           path_kind, path_special, get_all, is_ignored,
- repos_locks, repos_root, pool));
+ ignored_props, repos_locks, repos_root, pool));
   if (statstruct && (status_func))
     (*status_func)(status_baton, path, statstruct);
 
@@ -671,7 +676,7 @@
 
   SVN_ERR(assemble_status(&status, path, adm_access, NULL, NULL,
                           path_kind, path_special, FALSE, ignore_me,
- repos_locks, repos_root, pool));
+ NULL, repos_locks, repos_root, pool));
 
   if (is_external)
     status->text_status = svn_wc_status_external;
@@ -760,8 +765,8 @@
         {
           SVN_ERR(send_status_structure(path, adm_access, full_entry,
                                         dir_entry, kind, special, get_all,
- FALSE, eb->repos_locks,
- eb->repos_root,
+ FALSE, eb->ignored_props,
+ eb->repos_locks, eb->repos_root,
                                         status_func, status_baton, pool));
         }
     }
@@ -770,7 +775,8 @@
       /* File entries are ... just fine! */
       SVN_ERR(send_status_structure(path, adm_access, entry, dir_entry,
                                     kind, special, get_all, FALSE,
- eb->repos_locks, eb->repos_root,
+ eb->ignored_props, eb->repos_locks,
+ eb->repos_root,
                                     status_func, status_baton, pool));
     }
   return SVN_NO_ERROR;
@@ -923,9 +929,9 @@
   if (! skip_this_dir)
     SVN_ERR(send_status_structure(path, adm_access, dir_entry,
                                   parent_entry, svn_node_dir, FALSE,
- get_all, FALSE, eb->repos_locks,
- eb->repos_root, status_func, status_baton,
- subpool));
+ get_all, FALSE, eb->ignored_props,
+ eb->repos_locks, eb->repos_root,
+ status_func, status_baton, subpool));
 
   /* If the requested depth is empty, we only need status on this-dir. */
   if (depth == svn_depth_empty)
@@ -2056,7 +2062,7 @@
 /*** Public API ***/
 
 svn_error_t *
-svn_wc_get_status_editor3(const svn_delta_editor_t **editor,
+svn_wc_get_status_editor4(const svn_delta_editor_t **editor,
                           void **edit_baton,
                           void **set_locks_baton,
                           svn_revnum_t *edit_revision,
@@ -2066,6 +2072,7 @@
                           svn_boolean_t get_all,
                           svn_boolean_t no_ignore,
                           apr_array_header_t *ignore_patterns,
+ apr_hash_t *ignored_props,
                           svn_wc_status_func2_t status_func,
                           void *status_baton,
                           svn_cancel_func_t cancel_func,
@@ -2076,6 +2083,9 @@
   struct edit_baton *eb;
   svn_delta_editor_t *tree_editor = svn_delta_default_editor(pool);
 
+ if (ignored_props && apr_hash_count(ignored_props) == 0)
+ ignored_props = NULL;
+
   /* Construct an edit baton. */
   eb = apr_palloc(pool, sizeof(*eb));
   eb->default_depth = depth;
@@ -2083,6 +2093,7 @@
   eb->adm_access = anchor;
   eb->get_all = get_all;
   eb->no_ignore = no_ignore;
+ eb->ignored_props = ignored_props;
   eb->status_func = status_func;
   eb->status_baton = status_baton;
   eb->cancel_func = cancel_func;
@@ -2110,7 +2121,8 @@
 
   /* The edit baton's status structure maps to PATH, and the editor
      have to be aware of whether that is the anchor or the target. */
- SVN_ERR(svn_wc_status2(&(eb->anchor_status), eb->anchor, anchor, pool));
+ SVN_ERR(svn_wc_status3(&(eb->anchor_status), eb->anchor, ignored_props,
+ anchor, pool));
 
   /* Construct an editor. */
   tree_editor->set_target_revision = set_target_revision;
@@ -2140,6 +2152,32 @@
 
 
 svn_error_t *
+svn_wc_get_status_editor3(const svn_delta_editor_t **editor,
+ void **edit_baton,
+ void **set_locks_baton,
+ svn_revnum_t *edit_revision,
+ svn_wc_adm_access_t *anchor,
+ const char *target,
+ svn_depth_t depth,
+ svn_boolean_t get_all,
+ svn_boolean_t no_ignore,
+ apr_array_header_t *ignore_patterns,
+ svn_wc_status_func2_t status_func,
+ void *status_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ svn_wc_traversal_info_t *traversal_info,
+ apr_pool_t *pool)
+{
+ return svn_wc_get_status_editor4(editor, edit_baton, set_locks_baton,
+ edit_revision, anchor, target, depth,
+ get_all, no_ignore, ignore_patterns, NULL,
+ status_func, status_baton, cancel_func,
+ cancel_baton, traversal_info, pool);
+}
+
+
+svn_error_t *
 svn_wc_get_status_editor2(const svn_delta_editor_t **editor,
                           void **edit_baton,
                           void **set_locks_baton,
@@ -2267,8 +2305,9 @@
 
 
 svn_error_t *
-svn_wc_status2(svn_wc_status2_t **status,
+svn_wc_status3(svn_wc_status2_t **status,
                const char *path,
+ apr_hash_t *ignored_props,
                svn_wc_adm_access_t *adm_access,
                apr_pool_t *pool)
 {
@@ -2278,6 +2317,9 @@
   if (adm_access)
     SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
 
+ if (ignored_props && apr_hash_count(ignored_props) == 0)
+ ignored_props = NULL;
+
   if (entry && ! svn_path_is_empty(path))
     {
       const char *parent_path = svn_path_dirname(path, pool);
@@ -2289,14 +2331,23 @@
                              FALSE, pool));
     }
 
- SVN_ERR(assemble_status(status, path, adm_access, entry, parent_entry,
- svn_node_unknown, FALSE, /* bogus */
- TRUE, FALSE, NULL, NULL, pool));
- return SVN_NO_ERROR;
+ return assemble_status(status, path, adm_access, entry, parent_entry,
+ svn_node_unknown, FALSE, /* bogus */
+ TRUE, FALSE, ignored_props, NULL, NULL, pool);
 }
 
 
 svn_error_t *
+svn_wc_status2(svn_wc_status2_t **status,
+ const char *path,
+ svn_wc_adm_access_t *adm_access,
+ apr_pool_t *pool)
+{
+ return svn_wc_status3(status, path, NULL, adm_access, pool);
+}
+
+
+svn_error_t *
 svn_wc_status(svn_wc_status_t **status,
               const char *path,
               svn_wc_adm_access_t *adm_access,
Index: subversion/libsvn_client/status.c
===================================================================
--- subversion/libsvn_client/status.c (revision 32889)
+++ subversion/libsvn_client/status.c (working copy)
@@ -206,7 +206,7 @@
 
 
 svn_error_t *
-svn_client_status3(svn_revnum_t *result_rev,
+svn_client_status4(svn_revnum_t *result_rev,
                    const char *path,
                    const svn_opt_revision_t *revision,
                    svn_wc_status_func2_t status_func,
@@ -217,6 +217,7 @@
                    svn_boolean_t no_ignore,
                    svn_boolean_t ignore_externals,
                    const apr_array_header_t *changelists,
+ const apr_hash_t *ignored_props,
                    svn_client_ctx_t *ctx,
                    apr_pool_t *pool)
 {
@@ -235,6 +236,14 @@
   if (changelists && changelists->nelts)
     SVN_ERR(svn_hash_from_cstring_keys(&changelist_hash, changelists, pool));
 
+ if (ignored_props && apr_hash_count(ignored_props) == 0)
+ ignored_props = NULL;
+
+ /* We don't yet support ignored properties with '-u', so error. */
+ if (ignored_props && update)
+ return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("Ignoring properties with a remote status not yet supported."));
+
   sb.real_status_func = status_func;
   sb.real_status_baton = status_baton;
   sb.deleted_in_repos = FALSE;
@@ -268,12 +277,12 @@
   /* Get the status edit, and use our wrapping status function/baton
      as the callback pair. */
   SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
- SVN_ERR(svn_wc_get_status_editor3(&editor, &edit_baton, &set_locks_baton,
+ SVN_ERR(svn_wc_get_status_editor4(&editor, &edit_baton, &set_locks_baton,
                                     &edit_revision, anchor_access, target,
                                     depth, get_all, no_ignore, ignores,
- tweak_status, &sb, ctx->cancel_func,
- ctx->cancel_baton, traversal_info,
- pool));
+ ignored_props, tweak_status, &sb,
+ ctx->cancel_func, ctx->cancel_baton,
+ traversal_info, pool));
 
   /* If we want to know about out-of-dateness, we crawl the working copy and
      let the RA layer drive the editor for real. Otherwise, we just close the
@@ -406,7 +415,29 @@
   return SVN_NO_ERROR;
 }
 
+
 svn_error_t *
+svn_client_status3(svn_revnum_t *result_rev,
+ const char *path,
+ const svn_opt_revision_t *revision,
+ svn_wc_status_func2_t status_func,
+ void *status_baton,
+ svn_depth_t depth,
+ svn_boolean_t get_all,
+ svn_boolean_t update,
+ svn_boolean_t no_ignore,
+ svn_boolean_t ignore_externals,
+ const apr_array_header_t *changelists,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ return svn_client_status4(result_rev, path, revision, status_func,
+ status_baton, depth, get_all, update, no_ignore,
+ ignore_externals, changelists, NULL, ctx, pool);
+}
+
+
+svn_error_t *
 svn_client_status2(svn_revnum_t *result_rev,
                    const char *path,
                    const svn_opt_revision_t *revision,

Received on 2008-09-04 15:56:07 CEST

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