Combine the svn_wc_walk_entries3() and svn_wc__walk_entries_and_tc() APIs
into one svn_wc_walk_entries_4() with the various options presented as bit
flags in a single argument.

svn_wc_walk_entries3() has about 13 callers at present.

  Uses of the "show_hidden" mode:
    11 callers use "show_hidden = FALSE".
    2 callers use "show_hidden = TRUE".

  Uses of the dir-as-child callback:
    8 explicitly ignore dir-as-child,
    3 (in harvest_committables, tree_has_local_mods, invalidate_wc_props)
      accept it, but do they need it?
    1 (in merge) ignores it unless 'absent'.
    1 (svn_wc__adm_extend_lock_to_tree) WANTS the dir-as-child entry.

  Uses of the "and-tree-conflicts" version:
    1 caller uses svn_wc__walk_entries_and_tc() at the moment, but
      4 potential uses are known (info, status, resolve, revert).


* subversion/include/svn_wc.h
  (svn_wc_walk_entries_options_t): New enumeration.
  (svn_wc_walk_entries4): New revision of svn_wc_walk_entries3().
  (svn_wc_walk_entries3): Deprecate.

* subversion/libsvn_wc/entries.c
  (visit_tc_too_error_handler): ### Comment
  (svn_wc__walk_entries_and_tc): Rename to ...
  (svn_wc_walk_entries4): ... this, and implement the new 'options' field.

* subversion/libsvn_wc/wc.h
  (svn_wc__walk_entries_and_tc): Delete.

* subversion/libsvn_wc/adm_ops.c
  (revert_walk_baton_t): New baton. ### NOT USED
  (svn_wc_revert3): Start to use the new walker. ### NOT REACHED
  (resolve_found_entry_callback): ### Trivia
  (svn_wc_resolved_conflict4): Call the new walker instead of the old one.

--This line, and those below, will be ignored--
Index: subversion/include/svn_wc.h
===================================================================
--- subversion/include/svn_wc.h	(revision 34116)
+++ subversion/include/svn_wc.h	(working copy)
@@ -2252,6 +2254,13 @@ typedef struct svn_wc_entry_callbacks_t
 
 } svn_wc_entry_callbacks_t;
 
+/* Options for svn_wc_walk_entries4(), to be combined with bitwise-OR. */
+typedef enum svn_wc_walk_entries_options_t
+{
+  SVN_WC_WALK_ENTRIES_WITH_HIDDEN = 1,
+  SVN_WC_WALK_ENTRIES_WITH_TREE_CONFLICTS = 2
+} svn_wc_walk_entries_options_t;
+
 /**
  * A generic entry-walker.
  *
@@ -2271,10 +2280,15 @@ typedef struct svn_wc_entry_callbacks_t
  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
  * if the client has cancelled the operation.
  *
- * Like our other entries interfaces, entries that are in a 'excluded',
- * 'deleted' or 'absent' state (and not scheduled for re-addition) are not
- * discovered, unless @a show_hidden is TRUE. Excluded entries are those with
- * their depth set to @c svn_depth_exclude.
+ * If @a options includes @c SVN_WC_WALK_ENTRIES_WITH_HIDDEN, include
+ * entries that are in an 'excluded' or 'deleted' or 'absent' state (and
+ * not scheduled for re-addition). Excluded entries are those with their
+ * depth set to @c svn_depth_exclude
+ *
+ * If @a options includes @c SVN_WC_WALK_ENTRIES_WITH_TREE_CONFLICTS,
+ * include every tree conflict victim even if it is an unversioned path.
+ * For such a path, call the "found_entry" callback with a null "entry"
+ * parameter.
  *
  * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always
  * be returned first.
@@ -2285,7 +2299,24 @@ typedef struct svn_wc_entry_callbacks_t
  * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name'
  * field of the entry.
  *
- * @since New in 1.5.
+ * @since New in 1.6.
+ */
+svn_error_t *
+svn_wc_walk_entries4(const char *path,
+                     svn_wc_adm_access_t *adm_access,
+                     const svn_wc_entry_callbacks2_t
+                     *walk_callbacks,
+                     void *walk_baton,
+                     svn_depth_t depth,
+                     svn_wc_walk_entries_options_t options,
+                     svn_cancel_func_t cancel_func,
+                     void *cancel_baton,
+                     apr_pool_t *pool);
+
+/**
+ * Similar to svn_wc_walk_entries4(), but ###.
+ *
+ * @deprecated Provided for backward compatibility with the 1.5 API.
  */
 svn_error_t *
 svn_wc_walk_entries3(const char *path,
Index: subversion/libsvn_wc/entries.c
===================================================================
--- subversion/libsvn_wc/entries.c	(revision 34116)
+++ subversion/libsvn_wc/entries.c	(working copy)
@@ -3391,10 +3391,9 @@ visit_tc_too_error_handler(const char *p
 {
   struct visit_tc_too_baton_t *baton = walk_baton;
 
-  /* First, if this is an unversioned tree conflict victim, call the
-   * "found entry" callback for a null entry.
-   * The "unversioned resource" error occurs when the root of the walk is
-   * an unversioned resource; it can't occur for nodes recursed into. */
+  /* If this is an unversioned tree conflict victim, call the "found entry"
+   * callback. This can occur on the root node of the walk; we do not expect
+   * to reach such a node by recursion. */
   if (err && (err->apr_err == SVN_ERR_UNVERSIONED_RESOURCE))
     {
       svn_wc_adm_access_t *adm_access;
@@ -3430,14 +3429,15 @@ visit_tc_too_callbacks =
   };
 
 svn_error_t *
-svn_wc__walk_entries_and_tc(const char *path,
-                            svn_wc_adm_access_t *adm_access,
-                            const svn_wc_entry_callbacks2_t *walk_callbacks,
-                            void *walk_baton,
-                            svn_depth_t depth,
-                            svn_cancel_func_t cancel_func,
-                            void *cancel_baton,
-                            apr_pool_t *pool)
+svn_wc_walk_entries4(const char *path,
+                     svn_wc_adm_access_t *adm_access,
+                     const svn_wc_entry_callbacks2_t *walk_callbacks,
+                     void *walk_baton,
+                     svn_depth_t depth,
+                     svn_wc_walk_entries_options_t options,
+                     svn_cancel_func_t cancel_func,
+                     void *cancel_baton,
+                     apr_pool_t *pool)
 {
   visit_tc_too_baton_t visit_tc_too_baton;
 
@@ -3445,10 +3445,18 @@ svn_wc__walk_entries_and_tc(const char *
   visit_tc_too_baton.callbacks = walk_callbacks;
   visit_tc_too_baton.baton = walk_baton;
 
-  SVN_ERR(svn_wc_walk_entries3(path, adm_access,
-                               &visit_tc_too_callbacks, &visit_tc_too_baton,
-                               depth, TRUE /*show_hidden*/,
-                               cancel_func, cancel_baton, pool));
+  if (options & SVN_WC_WALK_ENTRIES_WITH_TREE_CONFLICTS)
+    SVN_ERR(svn_wc_walk_entries3(path, adm_access,
+                                 &visit_tc_too_callbacks, &visit_tc_too_baton,
+                                 depth,
+                                 options & SVN_WC_WALK_ENTRIES_WITH_HIDDEN,
+                                 cancel_func, cancel_baton, pool));
+  else
+    SVN_ERR(svn_wc_walk_entries3(path, adm_access,
+                                 walk_callbacks, walk_baton,
+                                 depth,
+                                 options & SVN_WC_WALK_ENTRIES_WITH_HIDDEN,
+                                 cancel_func, cancel_baton, pool));
   return SVN_NO_ERROR;
 }
 
Index: subversion/libsvn_wc/wc.h
===================================================================
--- subversion/libsvn_wc/wc.h	(revision 34116)
+++ subversion/libsvn_wc/wc.h	(working copy)
@@ -312,21 +312,6 @@ svn_wc__ambient_depth_filter_editor(cons
                                     svn_wc_adm_access_t *adm_access,
                                     apr_pool_t *pool);
 
-/* Similar to svn_wc_walk_entries3(), but also visit unversioned paths that
- * are tree conflict victims. For such a path, call the "found_entry"
- * callback but with a null "entry" parameter. Walk all entries including
- * hidden and schedule-delete entries, like with "show_hidden = TRUE" in
- * svn_wc_walk_entries3(). */
-svn_error_t *
-svn_wc__walk_entries_and_tc(const char *path,
-                            svn_wc_adm_access_t *adm_access,
-                            const svn_wc_entry_callbacks2_t *walk_callbacks,
-                            void *walk_baton,
-                            svn_depth_t depth,
-                            svn_cancel_func_t cancel_func,
-                            void *cancel_baton,
-                            apr_pool_t *pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c	(revision 34116)
+++ subversion/libsvn_wc/adm_ops.c	(working copy)
@@ -2334,6 +2334,14 @@ revert_internal(const char *path,
   return SVN_NO_ERROR;
 }
 
+typedef struct revert_walk_baton_t
+{
+  svn_boolean_t use_commit_times;
+  apr_hash_t *changelist_hash;
+  svn_wc_notify_func2_t notify_func;
+  void *notify_baton;
+} revert_walk_baton_t;
+
 
 svn_error_t *
 svn_wc_revert3(const char *path,
@@ -2353,6 +2361,20 @@ svn_wc_revert3(const char *path,
   return revert_internal(path, parent_access, depth, use_commit_times,
                          changelist_hash, cancel_func, cancel_baton,
                          notify_func, notify_baton, pool);
+  {
+    svn_wc_entry_callbacks2_t walk_callbacks =
+      { NULL, svn_wc__walker_default_error_handler };
+    revert_walk_baton_t walk_baton;
+
+    walk_baton.use_commit_times = use_commit_times;
+    walk_baton.changelist_hash = changelist_hash;
+    walk_baton.notify_func = notify_func;
+    walk_baton.notify_baton = notify_baton;
+    return svn_wc_walk_entries4(path, parent_access,
+                                &walk_callbacks, &walk_baton, depth,
+                                SVN_WC_WALK_ENTRIES_WITH_TREE_CONFLICTS,
+                                cancel_func, cancel_baton, pool);
+  }
 }
 
 
@@ -2886,7 +2908,7 @@ resolve_found_entry_callback(const char 
      first one (where it's a child of a parent dir), and only print
      the second one (where we're looking at THIS_DIR). */
   if ((entry->kind == svn_node_dir)
-      && (strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR)))
+      && (strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR) != 0))
     return SVN_NO_ERROR;
 
   /* Figger out the directory in which the conflict resides. */
@@ -2937,9 +2959,10 @@ svn_wc_resolved_conflict4(const char *pa
   baton->notify_baton = notify_baton;
   baton->conflict_choice = conflict_choice;
 
-  return svn_wc_walk_entries3(path, adm_access,
+  return svn_wc_walk_entries4(path, adm_access,
                               &resolve_walk_callbacks, baton, depth,
-                              FALSE, cancel_func, cancel_baton, pool);
+                              SVN_WC_WALK_ENTRIES_WITH_TREE_CONFLICTS,
+                              cancel_func, cancel_baton, pool);
 }
 
 svn_error_t *svn_wc_add_lock(const char *path, const svn_lock_t *lock,


