Index: status.c =================================================================== --- status.c +++ status.c Thu Oct 17 00:46:16 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 non-zero 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, @@ -101,6 +105,7 @@ const 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; @@ -130,9 +135,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; @@ -288,12 +301,13 @@ const 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, adm_access, entry, path_kind, - get_all, pool)); + get_all, is_ignored, pool)); if (statstruct) apr_hash_set (statushash, path, APR_HASH_KEY_STRING, statstruct); @@ -303,15 +317,35 @@ /* 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 non-zero, all unversioned items will be added; + otherwise we will only add the items that do not match any of the + patterns in IGNORES. + + We need the IGNORES list of patterns even if NO_IGNORES is + non-zero, because in that case we still need to distinguish between: + + (1) "Regular" unversioned items, i.e. files that haven't been + placed under version control but don't match any of the + patterns in IGNORES. (These ultimately get their text_status + set to svn_wc_status_unversioned.) + + (2) Items that would normally have been ignored because they match + a pattern in IGNORES, but which are being represented in + status structures anyway because the caller has explicitly + requested _all_ items. (These ultimately get their + text_status set to svn_wc_status_none.) +*/ static svn_error_t * add_unversioned_items (const char *path, svn_wc_adm_access_t *adm_access, 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); @@ -384,7 +418,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); @@ -395,6 +429,7 @@ NULL, /* no entry */ *path_kind, FALSE, + ignore_me, /* is_ignored */ pool)); } } @@ -428,7 +463,7 @@ entry = NULL; SVN_ERR (assemble_status (&s, path, adm_access, entry, svn_node_unknown, - TRUE, pool)); + TRUE, FALSE, pool)); *status = s; return SVN_NO_ERROR; } @@ -466,8 +501,10 @@ ### Notice that because we're getting one specific file, we're ignoring the GET_ALL flag and unconditionally fetching the status structure. */ - SVN_ERR (add_status_structure (statushash, path, adm_access, entry, kind, - TRUE, pool)); + SVN_ERR (add_status_structure (statushash, path, adm_access, entry, kind, + TRUE, + FALSE, /* is_ignored */ + pool)); } @@ -492,12 +529,11 @@ SVN_ERR (svn_wc_entries_read (&entries, adm_access, 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, adm_access, 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)) @@ -528,8 +564,11 @@ svn_wc_status_t *status = apr_hash_get (statushash, fullpath, APR_HASH_KEY_STRING); if (! status) - SVN_ERR (add_status_structure (statushash, fullpath, adm_access, - entry, kind, get_all, pool)); + SVN_ERR (add_status_structure (statushash, fullpath, + adm_access, + entry, kind, get_all, + FALSE, /* is_ignored */ + pool)); } else { @@ -565,7 +604,9 @@ SVN_ERR (add_status_structure (statushash, fullpath, adm_access, 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) */ @@ -586,7 +627,9 @@ /* File entries are ... just fine! */ SVN_ERR (add_status_structure (statushash, fullpath, adm_access, entry, - fullpath_kind, get_all, pool)); + fullpath_kind, get_all, + FALSE, /* is_ignored */ + pool)); } } }