Index: status.c =================================================================== --- status.c +++ status.c Thu Aug 29 23:07:51 2002 @@ -93,6 +93,10 @@ If GET_ALL is zero, and ENTRY is not locally modified, then *STATUS will be set to NULL. If GET_ALL is non-zero, then *STATUS will be allocated and returned no matter what. + + If IS_IGNORED is set and this is a non-versioned entity, set the + text_status to svn_wc_status_none. Otherwise set the text_status + to svn_wc_status_unversioned. */ static svn_error_t * assemble_status (svn_wc_status_t **status, @@ -100,6 +104,7 @@ svn_wc_entry_t *entry, svn_node_kind_t path_kind, svn_boolean_t get_all, + svn_boolean_t is_ignored, apr_pool_t *pool) { svn_wc_status_t *stat; @@ -129,9 +134,17 @@ stat->copied = FALSE; /* If this path has no entry, but IS present on disk, it's - unversioned. */ - if (path_kind != svn_node_none) - stat->text_status = svn_wc_status_unversioned; + unversioned. If this file is being explicitly ignored (due + to matching an ignore-pattern), the text_status is set to + svn_wc_status_none. Otherwise the text_status is set to + svn_wc_status_unversioned. */ + if (path_kind != svn_node_none) + { + if (is_ignored) + stat->text_status = svn_wc_status_none; + else + stat->text_status = svn_wc_status_unversioned; + } *status = stat; return SVN_NO_ERROR; @@ -284,12 +297,13 @@ svn_wc_entry_t *entry, svn_node_kind_t path_kind, svn_boolean_t get_all, + svn_boolean_t is_ignored, apr_pool_t *pool) { svn_wc_status_t *statstruct; SVN_ERR (assemble_status (&statstruct, path, entry, path_kind, - get_all, pool)); + get_all, is_ignored, pool)); if (statstruct) apr_hash_set (statushash, path, APR_HASH_KEY_STRING, statstruct); @@ -299,14 +313,17 @@ /* Add all items that are NOT in ENTRIES (which is a list of PATH's versioned things) to the STATUSHASH as unversioned items, - allocating everything in POOL. If IGNORES is non-NULL, it contains - the default ignores, else this is an indication that no ignores - should be honored. */ + allocating everything in POOL. IGNORES contains the list of + patterns to be ignored. If NO_IGNORE is set, all unversioned items + will be added; otherwise we will only add the items that do not match + any of the ignore patterns. +*/ static svn_error_t * add_unversioned_items (const char *path, apr_hash_t *entries, apr_hash_t *statushash, apr_array_header_t *ignores, + svn_boolean_t no_ignore, apr_pool_t *pool) { apr_pool_t *subpool = svn_pool_create (pool); @@ -379,7 +396,7 @@ /* If we aren't ignoring it, add a status structure for this dirent. */ - if (! ignore_me) + if (no_ignore || ! ignore_me) { printable_path = svn_path_join (path, keystring, pool); @@ -389,6 +406,7 @@ NULL, /* no entry */ *path_kind, FALSE, + ignore_me, /* is_ignored */ pool)); } } @@ -414,7 +432,8 @@ passed to assemble_status() below. */ svn_wc_entry (&entry, path, FALSE, pool); - SVN_ERR (assemble_status (&s, path, entry, svn_node_unknown, TRUE, pool)); + SVN_ERR (assemble_status (&s, path, entry, svn_node_unknown, + TRUE, FALSE, pool)); *status = s; return SVN_NO_ERROR; } @@ -452,7 +471,9 @@ we're ignoring the GET_ALL flag and unconditionally fetching the status structure. */ SVN_ERR (add_status_structure (statushash, path, entry, kind, - TRUE, pool)); + TRUE, + FALSE, /* is_ignored */ + pool)); } @@ -477,12 +498,11 @@ SVN_ERR (svn_wc_entries_read (&entries, path, FALSE, pool)); /* Read the default ignores from the config files. */ - if (! no_ignore) - SVN_ERR (get_default_ignores (&ignores, pool)); + SVN_ERR (get_default_ignores (&ignores, pool)); /* Add the unversioned items to the status output. */ SVN_ERR (add_unversioned_items (path, entries, statushash, - ignores, pool)); + ignores, no_ignore, pool)); /* Loop over entries hash */ for (hi = apr_hash_first (pool, entries); hi; hi = apr_hash_next (hi)) @@ -514,7 +534,9 @@ = apr_hash_get (statushash, fullpath, APR_HASH_KEY_STRING); if (! status) SVN_ERR (add_status_structure (statushash, fullpath, - entry, kind, get_all, pool)); + entry, kind, get_all, + FALSE, /* is_ignored */ + pool)); } else { @@ -561,7 +583,9 @@ SVN_ERR (add_status_structure (statushash, fullpath, fullpath_entry, - fullpath_kind, get_all, pool)); + fullpath_kind, get_all, + FALSE, /* is_ignored */ + pool)); /* Descend only if the subdirectory is a working copy directory (and DESCEND is non-zero ofcourse) */ @@ -578,7 +602,9 @@ /* File entries are ... just fine! */ SVN_ERR (add_status_structure (statushash, fullpath, entry, fullpath_kind, - get_all, pool)); + get_all, + FALSE, /* is_ignored */ + pool)); } } }