You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/08/10 19:18:56 UTC

svn commit: r984136 [1/2] - in /subversion/branches/issue-2779-dev: ./ notes/ subversion/bindings/javahl/native/ subversion/bindings/swig/ subversion/bindings/swig/python/ subversion/bindings/swig/python/libsvn_swig_py/ subversion/bindings/swig/python/...

Author: cmpilato
Date: Tue Aug 10 17:18:54 2010
New Revision: 984136

URL: http://svn.apache.org/viewvc?rev=984136&view=rev
Log:
Sync branch with trunk.  (Merged /subversion/trunk:r983009-984118)

Added:
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/cleanup.c
      - copied unchanged from r984118, subversion/trunk/subversion/libsvn_wc/cleanup.c
Removed:
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/log.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/log.h
Modified:
    subversion/branches/issue-2779-dev/   (props changed)
    subversion/branches/issue-2779-dev/notes/unicode-composition-for-filenames
    subversion/branches/issue-2779-dev/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/branches/issue-2779-dev/subversion/bindings/swig/python/README
    subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
    subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
    subversion/branches/issue-2779-dev/subversion/bindings/swig/python/tests/delta.py
    subversion/branches/issue-2779-dev/subversion/bindings/swig/svn_delta.i
    subversion/branches/issue-2779-dev/subversion/include/private/svn_wc_private.h
    subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
    subversion/branches/issue-2779-dev/subversion/libsvn_client/diff.c
    subversion/branches/issue-2779-dev/subversion/libsvn_client/repos_diff.c
    subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/ra_neon.h
    subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/session.c
    subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/util.c
    subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_ops.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/ambient_depth_filter_editor.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/copy.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.h
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/merge.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/node.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.h
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/translate.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/update_editor.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/upgrade.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/wc.h
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/wc_db.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/wc_db.h
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/workqueue.c
    subversion/branches/issue-2779-dev/subversion/libsvn_wc/workqueue.h
    subversion/branches/issue-2779-dev/subversion/svn/propedit-cmd.c
    subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.c
    subversion/branches/issue-2779-dev/subversion/svnrdump/load_editor.h
    subversion/branches/issue-2779-dev/subversion/svnsync/main.c
    subversion/branches/issue-2779-dev/subversion/tests/cmdline/diff_tests.py
    subversion/branches/issue-2779-dev/subversion/tests/cmdline/schedule_tests.py
    subversion/branches/issue-2779-dev/subversion/tests/cmdline/svntest/actions.py

Propchange: subversion/branches/issue-2779-dev/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 10 17:18:54 2010
@@ -20,6 +20,7 @@
 /subversion/branches/kwallet:870785-871314
 /subversion/branches/log-g-performance:870941-871032
 /subversion/branches/merge-skips-obstructions:874525-874615
+/subversion/branches/nfc-nfd-aware-client:870276,870376
 /subversion/branches/ra_serf-digest-authn:875693-876404
 /subversion/branches/reintegrate-improvements:873853-874164
 /subversion/branches/subtree-mergeinfo:876734-878766
@@ -34,4 +35,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:965496-983008
+/subversion/trunk:965496-984118

Modified: subversion/branches/issue-2779-dev/notes/unicode-composition-for-filenames
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/notes/unicode-composition-for-filenames?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/notes/unicode-composition-for-filenames (original)
+++ subversion/branches/issue-2779-dev/notes/unicode-composition-for-filenames Tue Aug 10 17:18:54 2010
@@ -251,6 +251,32 @@ Implementing option (4) means:
     communicate with the server.
 
 
+The above means the client has to be very carefull to preserve the
+encoding from the server and use that when talking to the server
+otherwise the server may not recognize the path as a versioned entity.
+
+Locally however, we can't be sure the filesystem enforces the encoding
+the server sent to the client, meaning there are (contrived) cases where
+a file exists in a different encoding locally than in the repository.
+Which means we have to be very carefull about how we find our files and
+to use the encoding we got from the local filesystem.
+
+Implementation details:
+
+ * The hash keys in svn_wc_adm_access_t's are hashed on the normalized
+   path encoding, not the repository path, in order to be able to
+   calculate the hash key from both the wc path as well as the repo path
+ * The same line of reasoning applies to the hash keys in the entries hash
+
+New conventions:
+ * variables containing a path as encoded in the local filesystem
+   should contain the (sub)string 'wc_path'
+ * variables containing a path as encoded in the repository should
+   contain the (sub)string 'repo_path'
+
+
+
+
 References
 ==========
 

Modified: subversion/branches/issue-2779-dev/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/bindings/javahl/native/SVNClient.cpp?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/issue-2779-dev/subversion/bindings/javahl/native/SVNClient.cpp Tue Aug 10 17:18:54 2010
@@ -68,6 +68,52 @@
 #include <iostream>
 #include <sstream>
 
+class CommitNotifier
+{
+  public:
+    CommitNotifier(SVN::Pool &inPool)
+        : pool(inPool), info(NULL)
+    {
+        ;
+    }
+
+    static svn_error_t *callback(const svn_commit_info_t *commit_info,
+                                 void *baton,
+                                 apr_pool_t *pool)
+    {
+      if (baton)
+        return ((CommitNotifier *)baton)->stashInfo(commit_info);
+
+      return SVN_NO_ERROR;
+    }
+
+    long getRevnum()
+    {
+        if (info && SVN_IS_VALID_REVNUM(info->revision))
+            return info->revision;
+
+        return SVN_INVALID_REVNUM;
+    }
+
+    /* Special operator new to allocate this thing in a pool. */
+    void * operator new(size_t sz, SVN::Pool &pool)
+    {
+        void *ptr = apr_pcalloc(pool.pool(), sizeof(CommitNotifier));
+        return ptr;
+    }
+
+  protected:
+    svn_error_t *stashInfo(const svn_commit_info_t *commit_info)
+    {
+        info = svn_commit_info_dup(commit_info, pool.pool());
+        return SVN_NO_ERROR;
+    }
+
+  private:
+    SVN::Pool &pool;
+    svn_commit_info_t *info;
+};
+
 struct log_msg_baton
 {
     const char *message;
@@ -314,7 +360,6 @@ void SVNClient::setProgressListener(Prog
 void SVNClient::remove(Targets &targets, const char *message, bool force,
                        bool keep_local, RevpropTable &revprops)
 {
-    svn_commit_info_t *commit_info = NULL;
     SVN::Pool requestPool;
     svn_client_ctx_t *ctx = getContext(message);
     if (ctx == NULL)
@@ -323,7 +368,7 @@ void SVNClient::remove(Targets &targets,
     const apr_array_header_t *targets2 = targets.array(requestPool);
     SVN_JNI_ERR(targets.error_occured(), );
 
-    SVN_JNI_ERR(svn_client_delete3(&commit_info, targets2, force, keep_local,
+    SVN_JNI_ERR(svn_client_delete4(targets2, force, keep_local,
                                    revprops.hash(requestPool), ctx,
                                    requestPool.pool()), );
 }
@@ -411,24 +456,20 @@ jlong SVNClient::commit(Targets &targets
                         StringArray &changelists, RevpropTable &revprops)
 {
     SVN::Pool requestPool;
-    svn_commit_info_t *commit_info = NULL;
     const apr_array_header_t *targets2 = targets.array(requestPool);
     SVN_JNI_ERR(targets.error_occured(), -1);
     svn_client_ctx_t *ctx = getContext(message);
     if (ctx == NULL)
         return SVN_INVALID_REVNUM;
 
-    SVN_JNI_ERR(svn_client_commit4(&commit_info, targets2, depth,
+    SVN_JNI_ERR(svn_client_commit5(targets2, depth,
                                    noUnlock, keepChangelist,
                                    changelists.array(requestPool),
                                    revprops.hash(requestPool), ctx,
                                    requestPool.pool()),
                 SVN_INVALID_REVNUM);
 
-    if (commit_info && SVN_IS_VALID_REVNUM(commit_info->revision))
-        return commit_info->revision;
-
-    return SVN_INVALID_REVNUM;
+    return ((CommitNotifier *)ctx->commit_baton)->getRevnum();
 }
 
 void SVNClient::copy(CopySources &copySources, const char *destPath,
@@ -452,8 +493,7 @@ void SVNClient::copy(CopySources &copySo
     if (ctx == NULL)
         return;
 
-    svn_commit_info_t *commit_info;
-    SVN_JNI_ERR(svn_client_copy5(&commit_info, srcs, destinationPath.c_str(),
+    SVN_JNI_ERR(svn_client_copy6(srcs, destinationPath.c_str(),
                                  copyAsChild, makeParents, ignoreExternals,
                                  revprops.hash(requestPool), ctx,
                                  requestPool.pool()), );
@@ -475,8 +515,7 @@ void SVNClient::move(Targets &srcPaths, 
     if (ctx == NULL)
         return;
 
-    svn_commit_info_t *commit_info;
-    SVN_JNI_ERR(svn_client_move5(&commit_info, (apr_array_header_t *) srcs,
+    SVN_JNI_ERR(svn_client_move6((apr_array_header_t *) srcs,
                                  destinationPath.c_str(), force, moveAsChild,
                                  makeParents, revprops.hash(requestPool), ctx,
                                  requestPool.pool()), );
@@ -486,7 +525,6 @@ void SVNClient::mkdir(Targets &targets, 
                       RevpropTable &revprops)
 {
     SVN::Pool requestPool;
-    svn_commit_info_t *commit_info = NULL;
     svn_client_ctx_t *ctx = getContext(message);
     if (ctx == NULL)
         return;
@@ -494,7 +532,7 @@ void SVNClient::mkdir(Targets &targets, 
     const apr_array_header_t *targets2 = targets.array(requestPool);
     SVN_JNI_ERR(targets.error_occured(), );
 
-    SVN_JNI_ERR(svn_client_mkdir3(&commit_info, targets2, makeParents,
+    SVN_JNI_ERR(svn_client_mkdir4(targets2, makeParents,
                                   revprops.hash(requestPool), ctx,
                                   requestPool.pool()), );
 }
@@ -606,14 +644,12 @@ void SVNClient::doImport(const char *pat
     Path intUrl(url);
     SVN_JNI_ERR(intUrl.error_occured(), );
 
-    svn_commit_info_t *commit_info = NULL;
     svn_client_ctx_t *ctx = getContext(message);
     if (ctx == NULL)
         return;
 
-    SVN_JNI_ERR(svn_client_import3(&commit_info, intPath.c_str(),
-                                   intUrl.c_str(), depth, noIgnore,
-                                   ignoreUnknownNodeTypes,
+    SVN_JNI_ERR(svn_client_import4(intPath.c_str(), intUrl.c_str(), depth,
+                                   noIgnore, ignoreUnknownNodeTypes,
                                    revprops.hash(requestPool), ctx,
                                    requestPool.pool()), );
 }
@@ -932,7 +968,6 @@ void SVNClient::propertySet(const char *
     else
       val = svn_string_create(value, requestPool.pool());
 
-    svn_commit_info_t *commit_info = NULL;
     Path intPath(path);
     SVN_JNI_ERR(intPath.error_occured(), );
 
@@ -940,7 +975,7 @@ void SVNClient::propertySet(const char *
     if (ctx == NULL)
         return;
 
-    SVN_JNI_ERR(svn_client_propset3(&commit_info, name, val, intPath.c_str(),
+    SVN_JNI_ERR(svn_client_propset4(name, val, intPath.c_str(),
                                     depth, force, SVN_INVALID_REVNUM,
                                     changelists.array(requestPool),
                                     revprops.hash(requestPool),
@@ -1144,7 +1179,8 @@ SVNClient::diffSummarize(const char *tar
 
 svn_client_ctx_t *SVNClient::getContext(const char *message)
 {
-    apr_pool_t *pool = JNIUtil::getRequestPool()->pool();
+    SVN::Pool *requestPool = JNIUtil::getRequestPool();
+    apr_pool_t *pool = requestPool->pool();
     svn_auth_baton_t *ab;
     svn_client_ctx_t *ctx;
     SVN_JNI_ERR(svn_client_create_context(&ctx, pool), NULL);
@@ -1240,6 +1276,9 @@ svn_client_ctx_t *SVNClient::getContext(
     ctx->progress_func = ProgressListener::progress;
     ctx->progress_baton = m_progressListener;
 
+    ctx->commit_callback2 = CommitNotifier::callback;
+    ctx->commit_baton = new (*requestPool) CommitNotifier(*requestPool);
+
     if (m_conflictResolver)
     {
         ctx->conflict_func = ConflictResolverCallback::resolveConflict;

Modified: subversion/branches/issue-2779-dev/subversion/bindings/swig/python/README
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/bindings/swig/python/README?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/bindings/swig/python/README (original)
+++ subversion/branches/issue-2779-dev/subversion/bindings/swig/python/README Tue Aug 10 17:18:54 2010
@@ -37,3 +37,14 @@ TRANSLATING PARAMETER LISTS
               foo(function)
           except:
               # handle it
+
+
+RUNNING THE TESTS
+
+   $ cd subversion/bindings/swig/python
+   $ python ./tests/run_all.py --help
+   $ python ./tests/run_all.py [TEST...]
+
+   where TEST can be the name of a test suite ('core', 'mergeinfo',
+   'client', etc.), or see '--help' for other options.  The default is to
+   run the tests in all modules.

Modified: subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (original)
+++ subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c Tue Aug 10 17:18:54 2010
@@ -4073,14 +4073,16 @@ svn_swig_py_setup_wc_diff_callbacks2(voi
 
 PyObject *
 svn_swig_py_txdelta_window_t_ops_get(svn_txdelta_window_t *window,
-                                     swig_type_info * op_type_info)
+                                     swig_type_info * op_type_info,
+                                     PyObject *window_pool)
 {
   PyObject *result = PyList_New(window->num_ops);
   int i;
   
   for (i = 0; i < window->num_ops; ++i)
       PyList_SET_ITEM(result, i,
-                      SWIG_NewPointerObj(window->ops + i, op_type_info, 0));
+                      svn_swig_NewPointerObj(window->ops + i, op_type_info,
+                                             window_pool, NULL));
 
   return result;
 }

Modified: subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h (original)
+++ subversion/branches/issue-2779-dev/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.h Tue Aug 10 17:18:54 2010
@@ -510,11 +510,14 @@ extern const svn_ra_reporter2_t swig_py_
 
 /* Get a list of ops from a window. Used to replace the naive
    svn_txdelta_window_t.ops accessor. op_type_info is supposed to be
-   the SWIG descriptor of "svn_txdelta_op_t *". */
+   the SWIG descriptor of "svn_txdelta_op_t *". window_pool is supposed
+   to be the pool associated with the window proxy and used for wrapping
+   the op objects. */
 SVN_SWIG_SWIGUTIL_EXPORT
 PyObject *
 svn_swig_py_txdelta_window_t_ops_get(svn_txdelta_window_t *window,
-                                     swig_type_info * op_type_info);
+                                     swig_type_info * op_type_info,
+                                     PyObject *window_pool);
 
 #ifdef __cplusplus
 }

Modified: subversion/branches/issue-2779-dev/subversion/bindings/swig/python/tests/delta.py
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/bindings/swig/python/tests/delta.py?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/bindings/swig/python/tests/delta.py (original)
+++ subversion/branches/issue-2779-dev/subversion/bindings/swig/python/tests/delta.py Tue Aug 10 17:18:54 2010
@@ -62,6 +62,9 @@ class DeltaTestCase(unittest.TestCase):
     self.assertEqual(window.src_ops, len([op for op in window.ops
       if op.action_code == svn.delta.svn_txdelta_source]))
 
+    # Check that the ops inherit the window's pool
+    self.assertEqual(window.ops[0]._parent_pool, window._parent_pool)
+
 def suite():
   return unittest.defaultTestLoader.loadTestsFromTestCase(DeltaTestCase)
 

Modified: subversion/branches/issue-2779-dev/subversion/bindings/swig/svn_delta.i
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/bindings/swig/svn_delta.i?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/bindings/swig/svn_delta.i (original)
+++ subversion/branches/issue-2779-dev/subversion/bindings/swig/svn_delta.i Tue Aug 10 17:18:54 2010
@@ -176,10 +176,53 @@ svn_txdelta_window_t_ops_get(svn_txdelta
 %ignore svn_txdelta_window_t::ops;
 %inline %{
 static PyObject *
-svn_txdelta_window_t_ops_get(svn_txdelta_window_t *window)
+svn_txdelta_window_t_ops_get(PyObject *window_ob)
 {
-  return svn_swig_py_txdelta_window_t_ops_get(window,
-    SWIG_TypeQuery("svn_txdelta_op_t *"));
+  void *window;
+  PyObject *ops_list, *window_pool;
+  int status;
+  
+  /* Kludge alert!
+     Normally, these kinds of conversions would belong in a typemap.
+     However, typemaps won't allow us to change the result type to an array,
+     so we have to make this custom accessor function.
+     A cleaner approach would be to use something like: 
+     
+     %extend svn_txdelta_window_t { void get_ops(apr_array_header_t ** ops); }
+     
+     But that means unnecessary copying, plus more hacks to get the pool for the
+     array and for wrapping the individual op objects. So we just don't bother.
+  */
+  
+  /* Note: the standard svn-python typemap releases the GIL while calling the
+     wrapped function, but this function does Python stuff, so we have to
+     reacquire it again. */
+  svn_swig_py_acquire_py_lock();
+  status = svn_swig_ConvertPtr(window_ob, &window,
+    SWIG_TypeQuery("svn_txdelta_window_t *"));
+    
+  if (status != 0)
+    {
+      PyErr_SetString(PyExc_TypeError,
+                      "expected an svn_txdelta_window_t* proxy");
+      svn_swig_py_release_py_lock();
+      return NULL;
+    }
+    
+  window_pool = PyObject_GetAttrString(window_ob, "_parent_pool");
+
+  if (window_pool == NULL)
+    {
+      svn_swig_py_release_py_lock();
+      return NULL;
+    }
+    
+  ops_list = svn_swig_py_txdelta_window_t_ops_get(window,
+    SWIG_TypeQuery("svn_txdelta_op_t *"), window_pool);
+    
+  svn_swig_py_release_py_lock();
+  
+  return ops_list;
 }
 %}
 #endif

Modified: subversion/branches/issue-2779-dev/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/include/private/svn_wc_private.h?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/issue-2779-dev/subversion/include/private/svn_wc_private.h Tue Aug 10 17:18:54 2010
@@ -55,15 +55,6 @@ svn_wc__path_switched(svn_boolean_t *swi
                       apr_pool_t *scratch_pool);
 
 
-/* Return the shallowest sufficient @c levels_to_lock value for @a depth;
- * see the @a levels_to_lock parameter of svn_wc_adm_open3() and
- * similar functions for more information.
- */
-#define SVN_WC__LEVELS_TO_LOCK_FROM_DEPTH(depth)              \
-  (((depth) == svn_depth_empty || (depth) == svn_depth_files) \
-   ? 0 : (((depth) == svn_depth_immediates) ? 1 : -1))
-
-
 /* Return TRUE iff CLHASH (a hash whose keys are const char *
    changelist names) is NULL or if LOCAL_ABSPATH is part of a changelist in
    CLHASH. */

Modified: subversion/branches/issue-2779-dev/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/include/svn_wc.h?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/include/svn_wc.h (original)
+++ subversion/branches/issue-2779-dev/subversion/include/svn_wc.h Tue Aug 10 17:18:54 2010
@@ -7046,15 +7046,17 @@ svn_wc_create_tmp_file(apr_file_t **fp,
  * @c SVN_WC_TRANSLATE_TO_NF is specified, against @a versioned_file itself
  * if @c SVN_WC_TRANSLATE_FROM_NF is specified.
  *
- * Output files are created in the temp file area belonging to
- * @a versioned_file.  By default they will be deleted at pool cleanup.
- *
- * If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the default
- * pool cleanup handler to remove @a *xlated_path is not registered.
+ * If a new output file is created, it is created in the temp file area
+ * belonging to @a versioned_file.  By default it will be deleted at pool
+ * cleanup.  If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the
+ * default pool cleanup handler to remove @a *xlated_path is not registered.
+ * If the input file is returned as the output, its lifetime is not
+ * specified.
  *
  * If an error is returned, the effect on @a *xlated_path is undefined.
  *
  * @since New in 1.4
+ * @deprecated Provided for compatibility with the 1.6 API
  */
 SVN_DEPRECATED
 svn_error_t *
@@ -7095,6 +7097,7 @@ svn_wc_translated_file(const char **xlat
  * svn_wc_translated_file().
  *
  * @since New in 1.5.
+ * @deprecated Provided for compatibility with the 1.6 API.
  */
 SVN_DEPRECATED
 svn_error_t *

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_client/diff.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_client/diff.c Tue Aug 10 17:18:54 2010
@@ -617,7 +617,7 @@ diff_props_changed(const char *local_dir
   SVN_ERR(svn_categorize_props(propchanges, NULL, NULL, &props, subpool));
 
   if (apr_hash_get(diff_cmd_baton->visited_paths, path, APR_HASH_KEY_STRING))
-      show_diff_header = FALSE;
+    show_diff_header = FALSE;
   else
     show_diff_header = TRUE;
 

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_client/repos_diff.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_client/repos_diff.c Tue Aug 10 17:18:54 2010
@@ -89,6 +89,17 @@ struct edit_baton {
   svn_wc_notify_func2_t notify_func;
   void *notify_baton;
 
+  /* TRUE if the operation needs to walk deleted dirs on the "old" side.
+     FALSE otherwise. */
+  svn_boolean_t walk_deleted_repos_dirs;
+
+  /* A callback used to see if the client wishes to cancel the running
+     operation. */
+  svn_cancel_func_t cancel_func;
+
+  /* A baton to pass to the cancellation callback. */
+  void *cancel_baton;
+
   apr_pool_t *pool;
 };
 
@@ -291,9 +302,11 @@ get_file_mime_types(const char **mimetyp
 }
 
 
-/* Get the repository version of a file. This makes an RA request to
- * retrieve the file contents. A pool cleanup handler is installed to
- * delete this file.
+/* Get revision REVISION of the file described by B from the repository.
+ * Set B->path_start_revision to the path of a new temporary file containing
+ * the file's text.  Set B->pristine_props to a new hash containing the
+ * file's properties.  Install a pool cleanup handler on B->pool to delete
+ * the file.
  */
 static svn_error_t *
 get_file_from_ra(struct file_baton *b, svn_revnum_t revision)
@@ -443,6 +456,87 @@ open_root(void *edit_baton,
   return SVN_NO_ERROR;
 }
 
+/* Recursively walk tree rooted at DIR (at REVISION) in the repository,
+ * reporting all files as deleted.  Part of a workaround for issue 2333.
+ *
+ * DIR is a repository path relative to the URL in RA_SESSION.  REVISION
+ * may be NULL, in which case it defaults to HEAD.  EB is the
+ * overall crawler editor baton.  If CANCEL_FUNC is not NULL, then it
+ * should refer to a cancellation function (along with CANCEL_BATON).
+ */
+/* ### TODO: Handle depth. */
+static svn_error_t *
+diff_deleted_dir(const char *dir,
+                 svn_revnum_t revision,
+                 svn_ra_session_t *ra_session,
+                 struct edit_baton *eb,
+                 svn_cancel_func_t cancel_func,
+                 void *cancel_baton,
+                 apr_pool_t *pool)
+{
+  apr_hash_t *dirents;
+  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_hash_index_t *hi;
+
+  if (cancel_func)
+    SVN_ERR(cancel_func(cancel_baton));
+
+  SVN_ERR(svn_ra_get_dir2(ra_session,
+                          &dirents,
+                          NULL, NULL,
+                          dir,
+                          revision,
+                          SVN_DIRENT_KIND,
+                          pool));
+  
+  for (hi = apr_hash_first(pool, dirents); hi;
+       hi = apr_hash_next(hi))
+    {
+      const char *path;
+      const char *name = svn__apr_hash_index_key(hi);
+      svn_dirent_t *dirent = svn__apr_hash_index_val(hi);
+
+      svn_pool_clear(iterpool);
+
+      path = svn_relpath_join(dir, name, iterpool);
+
+      if (dirent->kind == svn_node_file)
+        {
+          struct file_baton *b;
+          const char *mimetype1, *mimetype2;
+
+          /* Compare a file being deleted against an empty file */
+          b = make_file_baton(path, FALSE, eb, iterpool);
+          SVN_ERR(get_file_from_ra(b, revision));
+
+          SVN_ERR(get_empty_file(b->edit_baton, &(b->path_end_revision)));
+      
+          get_file_mime_types(&mimetype1, &mimetype2, b);
+
+          SVN_ERR(eb->diff_callbacks->file_deleted(
+                                NULL, NULL, NULL, b->wcpath,
+                                b->path_start_revision,
+                                b->path_end_revision,
+                                mimetype1, mimetype2,
+                                b->pristine_props,
+                                b->edit_baton->diff_cmd_baton,
+                                pool));
+        }
+ 
+      if (dirent->kind == svn_node_dir)
+        SVN_ERR(diff_deleted_dir(path,
+                                 revision,
+                                 ra_session,
+                                 eb,
+                                 cancel_func,
+                                 cancel_baton,
+                                 iterpool));
+    }
+
+  svn_pool_destroy(iterpool);
+  return SVN_NO_ERROR;
+}
+
 /* An editor function.  */
 static svn_error_t *
 delete_entry(const char *path,
@@ -500,6 +594,20 @@ delete_entry(const char *path,
                     (local_dir_abspath, &state, &tree_conflicted,
                      svn_dirent_join(eb->target, path, pool),
                      eb->diff_cmd_baton, pool));
+ 
+            if (eb->walk_deleted_repos_dirs)
+              {
+                /* A workaround for issue 2333.  The "old" dir will be
+                skipped by the repository report.  Crawl it recursively,
+                diffing each file against the empty file. */
+                SVN_ERR(diff_deleted_dir(path,
+                                         eb->revision,
+                                         eb->ra_session,
+                                         eb,
+                                         eb->cancel_func,
+                                         eb->cancel_baton,
+                                         pool));
+              }
             break;
           }
         default:
@@ -1213,6 +1321,9 @@ svn_client__get_diff_editor(const char *
   eb->pool = subpool;
   eb->notify_func = notify_func;
   eb->notify_baton = notify_baton;
+  eb->walk_deleted_repos_dirs = TRUE;
+  eb->cancel_func = cancel_func;
+  eb->cancel_baton = cancel_baton;
 
   tree_editor->set_target_revision = set_target_revision;
   tree_editor->open_root = open_root;

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/ra_neon.h?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/ra_neon.h Tue Aug 10 17:18:54 2010
@@ -98,7 +98,8 @@ typedef struct svn_ra_neon__session_t {
   void *callback_baton;
 
   svn_auth_iterstate_t *auth_iterstate; /* state of authentication retries */
-  const char *auth_username;            /* last authenticated username used */
+  svn_boolean_t auth_used;              /* Save authorization state after
+                                           successful usage */
 
   svn_auth_iterstate_t *p11pin_iterstate; /* state of PKCS#11 pin retries */
 

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/session.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/session.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/session.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/session.c Tue Aug 10 17:18:54 2010
@@ -94,8 +94,8 @@ static int request_auth(void *userdata, 
   void *creds;
   svn_auth_cred_simple_t *simple_creds;
 
-  /* Start by clearing the cache of any previously-fetched username. */
-  ras->auth_username = NULL;
+  /* Start by marking the current credentials invalid. */
+  ras->auth_used = FALSE;
 
   /* No auth_baton?  Give up. */
   if (! ras->callbacks->auth_baton)
@@ -135,13 +135,14 @@ static int request_auth(void *userdata, 
     }
   simple_creds = creds;
 
+  /* Make svn_ra_neon__request_dispatch store the credentials after it
+     sees a succesful response */
+  ras->auth_used = TRUE;
+
   /* ### silently truncates username/password to 256 chars. */
   apr_cpystrn(username, simple_creds->username, NE_ABUFSIZ);
   apr_cpystrn(password, simple_creds->password, NE_ABUFSIZ);
 
-  /* Cache the fetched username in ra_session. */
-  ras->auth_username = apr_pstrdup(ras->pool, simple_creds->username);
-
   return 0;
 }
 

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/util.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra_neon/util.c Tue Aug 10 17:18:54 2010
@@ -364,9 +364,6 @@ svn_ra_neon__request_create(svn_ra_neon_
   svn_ra_neon__request_t *req;
   const char *path;
 
-    /* If there is auth credentials in this session, store it if we can. */
-  SVN_ERR(svn_ra_neon__maybe_store_auth_info(sess, pool));
-
   /* We never want to send Neon an absolute URL, since that can cause
      problems with some servers (for example, those that may be accessed
      using different server names from different locations, or those that
@@ -1492,6 +1489,15 @@ svn_ra_neon__request_dispatch(int *code_
   req->code_desc = apr_pstrdup(pool, statstruct->reason_phrase);
   req->code = statstruct->code;
 
+  /* If we see a successful request that used authentication, we should store
+     the credentials for future use. */
+  if (req->sess->auth_used
+      && statstruct->code < 400)
+    {
+      req->sess->auth_used = FALSE;
+      SVN_ERR(svn_ra_neon__maybe_store_auth_info(req->sess, pool));
+    }
+
   if (code_p)
      *code_p = req->code;
 

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_ra_serf/commit.c Tue Aug 10 17:18:54 2010
@@ -753,7 +753,6 @@ create_proppatch_body(serf_bucket_t **bk
 {
   proppatch_context_t *ctx = baton;
   serf_bucket_t *body_bkt;
-  svn_error_t *err;
 
   body_bkt = serf_bucket_aggregate_create(alloc);
 

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_crawler.c Tue Aug 10 17:18:54 2010
@@ -146,6 +146,8 @@ svn_wc_restore(svn_wc_context_t *wc_ctx,
                                  _("The node '%s' can not be restored."),
                                  svn_dirent_local_style(local_abspath,
                                                         scratch_pool));
+      default:
+        break;
     }
 
   if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_ops.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/adm_ops.c Tue Aug 10 17:18:54 2010
@@ -52,10 +52,8 @@
 #include "svn_sorts.h"
 
 #include "wc.h"
-#include "log.h"
 #include "adm_files.h"
 #include "entries.h"
-#include "lock.h"
 #include "props.h"
 #include "translate.h"
 #include "tree_conflicts.h"
@@ -1538,7 +1536,7 @@ revert_entry(svn_depth_t *depth,
           /* Before single-db we didn't have to perform a recursive delete
              here. With single-db we really must delete missing nodes */
           if (disk_kind == svn_node_none
-              || svn_wc__adm_missing(db, local_abspath, pool))
+              || status == svn_wc__db_status_obstructed_add)
             {
               /* Schedule add but missing, just remove the entry
                  or it's missing an adm area in which case
@@ -1940,6 +1938,7 @@ svn_wc__internal_remove_from_revision_co
 {
   svn_error_t *err;
   svn_boolean_t left_something = FALSE;
+  svn_wc__db_status_t status;
   svn_wc__db_kind_t kind;
 
   /* ### This whole function should be rewritten to run inside a transaction,
@@ -1958,7 +1957,11 @@ svn_wc__internal_remove_from_revision_co
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, db, local_abspath, FALSE, scratch_pool));
+  SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL,
+                               db, local_abspath, scratch_pool, scratch_pool));
 
   if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
     {
@@ -2050,7 +2053,9 @@ svn_wc__internal_remove_from_revision_co
 
     }  /* done with file case */
 #ifndef SVN_WC__SINGLE_DB
-  else if (svn_wc__adm_missing(db, local_abspath, scratch_pool))
+  else if (status == svn_wc__db_status_obstructed
+           || status == svn_wc__db_status_obstructed_add
+           || status == svn_wc__db_status_obstructed_delete)
     {
       /* The directory is missing  so don't try to recurse, in
          not existing administrative data, just delete the
@@ -2155,7 +2160,8 @@ svn_wc__internal_remove_from_revision_co
           err = svn_io_dir_remove_nonrecursive(local_abspath, iterpool);
           if (err)
             {
-              left_something = TRUE;
+              if (!APR_STATUS_IS_ENOENT(err->apr_err))
+                left_something = TRUE;
               svn_error_clear(err);
             }
         }

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/ambient_depth_filter_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/ambient_depth_filter_editor.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/ambient_depth_filter_editor.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/ambient_depth_filter_editor.c Tue Aug 10 17:18:54 2010
@@ -29,7 +29,6 @@
 #include "svn_path.h"
 
 #include "wc.h"
-#include "lock.h"
 
 /*
      Notes on the general depth-filtering strategy.
@@ -176,6 +175,9 @@ ambient_read_info(svn_boolean_t *hidden,
         case svn_wc__db_status_absent:
         case svn_wc__db_status_excluded:
           *hidden = TRUE;
+          break;
+        default:
+          break;
       }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/copy.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/copy.c Tue Aug 10 17:18:54 2010
@@ -34,7 +34,6 @@
 #include "svn_path.h"
 
 #include "wc.h"
-#include "log.h"
 #include "workqueue.h"
 #include "adm_files.h"
 #include "props.h"

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.c Tue Aug 10 17:18:54 2010
@@ -35,7 +35,6 @@
 #include "adm_files.h"
 #include "lock.h"
 #include "props.h"
-#include "log.h"
 #include "wc_db.h"
 
 #include "svn_private_config.h"
@@ -147,7 +146,6 @@ svn_wc__internal_check_wc(int *wc_format
 #ifdef SVN_WC__SINGLE_DB
     if (*wc_format >= SVN_WC__WC_NG_VERSION)
       {
-        svn_error_t *err;
         svn_wc__db_status_t db_status;
         svn_wc__db_kind_t db_kind;
 
@@ -631,22 +629,35 @@ close_single(svn_wc_adm_access_t *adm_ac
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_wc__adm_available(svn_boolean_t *available,
-                      svn_wc__db_kind_t *kind,
-                      svn_boolean_t *obstructed,
-                      svn_wc__db_t *db,
-                      const char *local_abspath,
-                      apr_pool_t *scratch_pool)
+/* Retrieves the KIND of LOCAL_ABSPATH and whether its administrative data is
+   available in the working copy.
+
+   *AVAILABLE is set to TRUE when the node and its metadata are available,
+   otherwise to FALSE (due to obstruction, missing, absence, exclusion,
+   or a "not-present" child).
+
+   *OBSTRUCTED is set to TRUE when the node is not available because
+   it is obstructed/missing, otherwise to FALSE.
+
+   KIND and OBSTRUCTED can be NULL.
+
+   ### note: this function should go away when we move to a single
+   ### adminstrative area.  */
+static svn_error_t *
+adm_available(svn_boolean_t *available,
+              svn_wc__db_kind_t *kind,
+              svn_boolean_t *obstructed,
+              svn_wc__db_t *db,
+              const char *local_abspath,
+              apr_pool_t *scratch_pool)
 {
   svn_wc__db_status_t status;
-  svn_depth_t depth;
 
   if (kind)
     *kind = svn_wc__db_kind_unknown;
 
   SVN_ERR(svn_wc__db_read_info(&status, kind, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, &depth, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL,
                                db, local_abspath, scratch_pool, scratch_pool));
@@ -661,8 +672,7 @@ svn_wc__adm_available(svn_boolean_t *ava
                  status == svn_wc__db_status_obstructed_delete ||
                  status == svn_wc__db_status_absent ||
                  status == svn_wc__db_status_excluded ||
-                 status == svn_wc__db_status_not_present ||
-                 depth == svn_depth_exclude);
+                 status == svn_wc__db_status_not_present);
 
   return SVN_NO_ERROR;
 }
@@ -722,12 +732,12 @@ do_open(svn_wc_adm_access_t **adm_access
 
           node_abspath = svn_dirent_join(local_abspath, name, iterpool);
 
-          SVN_ERR(svn_wc__adm_available(&available,
-                                        &kind,
-                                        &obstructed,
-                                        db,
-                                        node_abspath,
-                                        scratch_pool));
+          SVN_ERR(adm_available(&available,
+                                &kind,
+                                &obstructed,
+                                db,
+                                node_abspath,
+                                scratch_pool));
 
           if (kind != svn_wc__db_kind_dir)
             continue;
@@ -1340,8 +1350,8 @@ open_anchor(svn_wc_adm_access_t **anchor
           svn_boolean_t available, obstructed;
           svn_wc__db_kind_t kind;
 
-          err = svn_wc__adm_available(&available, &kind, &obstructed,
-                                      db, local_abspath, pool);
+          err = adm_available(&available, &kind, &obstructed,
+                              db, local_abspath, pool);
 
           if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
             svn_error_clear(err);
@@ -1564,36 +1574,6 @@ svn_wc__adm_get_db(const svn_wc_adm_acce
   return adm_access->db;
 }
 
-
-svn_boolean_t
-svn_wc__adm_missing(svn_wc__db_t *db,
-                    const char *local_abspath,
-                    apr_pool_t *scratch_pool)
-{
-  const svn_wc_adm_access_t *look;
-  svn_boolean_t available, obstructed;
-  svn_wc__db_kind_t kind;
-
-  look = get_from_shared(local_abspath, db, scratch_pool);
-
-  if (look != NULL)
-    return IS_MISSING(look);
-
-  /* When we switch to a single database an access baton can't be
-     missing, but until then it can. But if there are no access batons we
-     would always return FALSE.
-     For this case we check if an access baton could be opened
-
-*/
-
-  /* This check must match the check in do_open() */
-  svn_error_clear(svn_wc__adm_available(&available, &kind, &obstructed,
-                                        db, local_abspath,
-                                        scratch_pool));
-
-  return (kind == svn_wc__db_kind_dir) && !available && obstructed;
-}
-
 #ifndef SVN_WC__SINGLE_DB
 static svn_error_t *
 acquire_locks_recursively(svn_wc_context_t *wc_ctx,
@@ -1776,13 +1756,14 @@ svn_wc__release_write_lock(svn_wc_contex
                            const char *local_abspath,
                            apr_pool_t *scratch_pool)
 {
-  svn_wc__db_kind_t kind;
-  apr_pool_t *iterpool;
-  const apr_array_header_t *children;
   apr_uint64_t id;
   svn_skel_t *work_item;
+#ifndef SVN_WC__SINGLE_DB
+  apr_pool_t *iterpool;
+  const apr_array_header_t *children;
   svn_boolean_t locked_here;
   int i;
+#endif
 
 #ifndef SVN_WC__SINGLE_DB
   SVN_ERR(svn_wc__db_wclock_owns_lock(&locked_here, wc_ctx->db, local_abspath,
@@ -1819,6 +1800,7 @@ svn_wc__release_write_lock(svn_wc_contex
     {
       const char *child_relpath = APR_ARRAY_IDX(children, i, const char *);
       const char *child_abspath;
+      svn_wc__db_kind_t kind;
 
       svn_pool_clear(iterpool);
       child_abspath = svn_dirent_join(local_abspath, child_relpath, iterpool);

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.h?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.h (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/lock.h Tue Aug 10 17:18:54 2010
@@ -49,39 +49,6 @@ void svn_wc__adm_access_set_entries(svn_
    be NULL.  */
 apr_hash_t *svn_wc__adm_access_entries(svn_wc_adm_access_t *adm_access);
 
-
-/* Returns TRUE if LOCAL_ABSPATH is a working copy directory that is obstructed
-   or missing such that an access baton is not available for LOCAL_ABSPATH.
-   This means DB must also include the parent of LOCAL_ABSPATH.
-
-   This function falls back to using svn_wc__adm_available() if no access batons
-   for LOCAL_ABSPATH are stored in DB. */
-svn_boolean_t svn_wc__adm_missing(svn_wc__db_t *db,
-                                  const char *local_abspath,
-                                  apr_pool_t *scratch_pool);
-
-/* Retrieves the KIND of LOCAL_ABSPATH and whether its administrative data is
-   available in the working copy.
-
-   *AVAILABLE is set to TRUE when the node and its metadata are available,
-   otherwise to FALSE (due to obstruction, missing, absence, exclusion,
-   or a "not-present" child).
-
-   *OBSTRUCTED is set to TRUE when the node is not available because
-   it is obstructed/missing, otherwise to FALSE.
-
-   KIND and OBSTRUCTED can be NULL.
-
-   ### note: this function should go away when we move to a single
-   ### adminstrative area.  */
-svn_error_t *
-svn_wc__adm_available(svn_boolean_t *available,
-                      svn_wc__db_kind_t *kind,
-                      svn_boolean_t *obstructed,
-                      svn_wc__db_t *db,
-                      const char *local_abspath,
-                      apr_pool_t *scratch_pool);
-
 /* Same as svn_wc__adm_retrieve_internal, but takes a DB and an absolute
    directory path.  */
 svn_wc_adm_access_t *
@@ -101,14 +68,6 @@ svn_wc__internal_check_wc(int *wc_format
                           svn_boolean_t check_path,
                           apr_pool_t *scratch_pool);
 
-
-/* Ensure LOCAL_ABSPATH is still locked in DB.  Returns the error
- * SVN_ERR_WC_NOT_LOCKED if this is not the case.
- */
-svn_error_t *svn_wc__write_check(svn_wc__db_t *db,
-                                 const char *local_abspath,
-                                 apr_pool_t *scratch_pool);
-
 /* Return the working copy database associated with this access baton. */
 svn_wc__db_t *
 svn_wc__adm_get_db(const svn_wc_adm_access_t *adm_access);

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/merge.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/merge.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/merge.c Tue Aug 10 17:18:54 2010
@@ -30,8 +30,6 @@
 #include "wc.h"
 #include "adm_files.h"
 #include "translate.h"
-#include "log.h"
-#include "lock.h"
 #include "workqueue.h"
 
 #include "private/svn_skel.h"

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/node.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/node.c Tue Aug 10 17:18:54 2010
@@ -47,7 +47,6 @@
 #include "wc.h"
 #include "props.h"
 #include "entries.h"
-#include "log.h"
 #include "wc_db.h"
 
 #include "svn_private_config.h"

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.c Tue Aug 10 17:18:54 2010
@@ -52,11 +52,8 @@
 #include "private/svn_skel.h"
 
 #include "wc.h"
-#include "log.h"
-#include "adm_files.h"
 #include "props.h"
 #include "translate.h"
-#include "lock.h"  /* for svn_wc__write_check()  */
 #include "workqueue.h"
 #include "conflicts.h"
 
@@ -166,77 +163,6 @@ svn_wc__get_prejfile_abspath(const char 
   return SVN_NO_ERROR;
 }
 
-
-/* See props.h  */
-#ifdef SVN__SUPPORT_BASE_MERGE
-
-/* Add a working queue item to install PROPS and, if INSTALL_PRISTINE_PROPS is
-   TRUE, BASE_PROPS for the LOCAL_ABSPATH in DB, updating the node to reflect
-   the changes.  PRISTINE_PROPS must be supplied even if INSTALL_PRISTINE_PROPS
-   is FALSE.
-
-   Use SCRATCH_POOL for temporary allocations. */
-static svn_error_t *
-queue_install_props(svn_wc__db_t *db,
-                    const char *local_abspath,
-                    svn_wc__db_kind_t kind,
-                    apr_hash_t *pristine_props,
-                    apr_hash_t *props,
-                    svn_boolean_t install_pristine_props,
-                    apr_pool_t *scratch_pool)
-{
-  apr_array_header_t *prop_diffs;
-  const char *prop_abspath;
-  svn_skel_t *work_item;
-
-  SVN_ERR_ASSERT(pristine_props != NULL);
-
-  /* Check if the props are modified. */
-  SVN_ERR(svn_prop_diffs(&prop_diffs, props, pristine_props, scratch_pool));
-
-  /* Save the actual properties file if it differs from base. */
-  if (prop_diffs->nelts == 0)
-    props = NULL; /* Remove actual properties*/
-
-  if (install_pristine_props)
-    {
-      /* Write out a new set of pristine properties.  */
-      SVN_ERR(svn_wc__prop_path(&prop_abspath, local_abspath, kind,
-                                svn_wc__props_base, scratch_pool));
-      SVN_ERR(svn_wc__wq_build_write_old_props(&work_item,
-                                               prop_abspath,
-                                               pristine_props,
-                                               scratch_pool));
-      SVN_ERR(svn_wc__db_wq_add(db, local_abspath, work_item, scratch_pool));
-    }
-
-  /* For the old school: write the properties into the "working" (aka ACTUAL)
-     location. Note that PROPS may be NULL, indicating a removal of the
-     props file.  */
-  SVN_ERR(svn_wc__prop_path(&prop_abspath, local_abspath, kind,
-                            svn_wc__props_working, scratch_pool));
-  SVN_ERR(svn_wc__wq_build_write_old_props(&work_item,
-                                           prop_abspath,
-                                           props,
-                                           scratch_pool));
-  SVN_ERR(svn_wc__db_wq_add(db, local_abspath, work_item, scratch_pool));
-
-  /* ### this is disappearing. for now, it is a delayed call to put
-     ### properties into wc_db.  */
-  if (!install_pristine_props)
-    pristine_props = NULL; /* Don't change the pristine properties */
-  SVN_ERR(svn_wc__wq_add_install_properties(db,
-                                            local_abspath,
-                                            pristine_props,
-                                            props,
-                                            scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-#endif /* SVN__SUPPORT_BASE_MERGE  */
-
-
 /* */
 static svn_error_t *
 immediate_install_props(svn_wc__db_t *db,
@@ -275,15 +201,6 @@ immediate_install_props(svn_wc__db_t *db
 }
 
 
-svn_error_t *
-svn_wc__working_props_committed(svn_wc__db_t *db,
-                                const char *local_abspath,
-                                apr_pool_t *scratch_pool)
-{
-  return SVN_NO_ERROR;
-}
-
-
 /*---------------------------------------------------------------------*/
 
 /*** Merging propchanges into the working copy ***/
@@ -458,9 +375,35 @@ svn_wc__perform_props_merge(svn_wc_notif
 
 /* See props.h  */
 #ifdef SVN__SUPPORT_BASE_MERGE
-      SVN_ERR(queue_install_props(db, local_abspath, kind,
-                                  new_base_props, new_actual_props,
-                                  base_merge, pool));
+      {
+        svn_wc__db_status_t status;
+        svn_boolean_t have_base;
+        apr_array_header_t *prop_diffs;
+
+        SVN_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,
+                                     &have_base, NULL, NULL, NULL,
+                                     db, local_abspath, pool, pool));
+
+        if (status == svn_wc__db_status_added)
+          SVN_ERR(svn_wc__db_temp_working_set_props(db, local_abspath,
+                                                    new_base_props, pool));
+        else
+          SVN_ERR(svn_wc__db_temp_base_set_props(db, local_abspath,
+                                                 new_base_props, pool));
+
+        /* Check if the props are modified. */
+        SVN_ERR(svn_prop_diffs(&prop_diffs, actual_props, new_base_props, pool));
+
+        /* Save the actual properties file if it differs from base. */
+        if (prop_diffs->nelts == 0)
+          SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, NULL, NULL, NULL,
+                                          pool));
+        else
+          SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, actual_props,
+                                          NULL, NULL, pool));
+      }
 #else
       if (base_merge)
         return svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, NULL,

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.h?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.h (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/props.h Tue Aug 10 17:18:54 2010
@@ -49,15 +49,6 @@ extern "C" {
 */
 #undef SVN__SUPPORT_BASE_MERGE
 
-
-typedef enum svn_wc__props_kind_t
-{
-  svn_wc__props_base = 0,
-  svn_wc__props_revert,
-  svn_wc__props_working
-} svn_wc__props_kind_t;
-
-
 /* Internal function for diffing props. See svn_wc_get_prop_diffs2(). */
 svn_error_t *
 svn_wc__internal_propdiff(apr_array_header_t **propchanges,
@@ -155,13 +146,6 @@ svn_wc__props_modified(svn_boolean_t *mo
                        const char *local_abspath,
                        apr_pool_t *scratch_pool);
 
-/* Install LOCAL_ABSPATHs working props as base props. */
-svn_error_t *
-svn_wc__working_props_committed(svn_wc__db_t *db,
-                                const char *local_abspath,
-                                apr_pool_t *scratch_pool);
-
-
 /* Internal version of svn_wc_get_pristine_props().  */
 svn_error_t *
 svn_wc__get_pristine_props(apr_hash_t **props,

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/translate.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/translate.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/translate.c Tue Aug 10 17:18:54 2010
@@ -43,7 +43,6 @@
 #include "adm_files.h"
 #include "translate.h"
 #include "props.h"
-#include "lock.h"
 
 #include "svn_private_config.h"
 #include "private/svn_wc_private.h"

Modified: subversion/branches/issue-2779-dev/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/issue-2779-dev/subversion/libsvn_wc/update_editor.c?rev=984136&r1=984135&r2=984136&view=diff
==============================================================================
--- subversion/branches/issue-2779-dev/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/issue-2779-dev/subversion/libsvn_wc/update_editor.c Tue Aug 10 17:18:54 2010
@@ -30,7 +30,6 @@
 #include <apr_hash.h>
 #include <apr_md5.h>
 #include <apr_tables.h>
-#include <apr_file_io.h>
 #include <apr_strings.h>
 
 #include "svn_types.h"
@@ -39,25 +38,20 @@
 #include "svn_string.h"
 #include "svn_dirent_uri.h"
 #include "svn_path.h"
-#include "svn_xml.h"
 #include "svn_error.h"
 #include "svn_io.h"
 #include "svn_private_config.h"
 #include "svn_time.h"
-#include "svn_config.h"
 #include "svn_iter.h"
 
 #include "wc.h"
-#include "log.h"
 #include "adm_files.h"
 #include "entries.h"
-#include "lock.h"
 #include "translate.h"
 #include "tree_conflicts.h"
 #include "workqueue.h"
 
 #include "private/svn_wc_private.h"
-
 /* Checks whether a svn_wc__db_status_t indicates whether a node is
    present in a working copy. Used by the editor implementation */
 #define IS_NODE_PRESENT(status)                             \
@@ -498,7 +492,7 @@ cleanup_dir_baton(void *dir_baton)
   apr_pool_t *pool = apr_pool_parent_get(db->pool);
 
   err = svn_wc__wq_run(eb->db, db->local_abspath,
-                       eb->cancel_func, eb->cancel_baton,
+                       NULL /* cancel_func */, NULL /* cancel_baton */,
                        pool);
 
   if (err)
@@ -888,10 +882,14 @@ complete_directory(struct edit_baton *eb
         }
 #ifndef SVN_WC__SINGLE_DB
       /* In Single-DB mode, administrative data is never reported as missing
-         by the adm crawler, and we should always remove nodes recursively */
+         by the adm crawler, and we should always remove nodes using normal
+         update handling.
+         In !Single-DB mode the nodes should have been re-added by now,
+         so we can assume that the repository doesn't know about them. */
       else if (kind == svn_wc__db_kind_dir
-               && svn_wc__adm_missing(eb->db, node_abspath, iterpool)
-               && status != svn_wc__db_status_absent)
+               && (status == svn_wc__db_status_obstructed
+                   || status == svn_wc__db_status_obstructed_delete
+                   || status == svn_wc__db_status_obstructed_add))
         {
           SVN_ERR(svn_wc__db_temp_op_remove_entry(eb->db, node_abspath,
                                                   iterpool));
@@ -1390,36 +1388,6 @@ open_root(void *edit_baton,
 }
 
 
-/* Helper for delete_entry() and do_entry_deletion().
-
-   If the error chain ERR contains evidence that a local mod was left
-   (an SVN_ERR_WC_LEFT_LOCAL_MOD error), clear ERR.  Otherwise, return ERR.
-*/
-static svn_error_t *
-leftmod_error_chain(svn_error_t *err)
-{
-  svn_error_t *tmp_err;
-
-  if (! err)
-    return SVN_NO_ERROR;
-
-  /* Advance TMP_ERR to the part of the error chain that reveals that
-     a local mod was left, or to the NULL end of the chain. */
-  for (tmp_err = err; tmp_err; tmp_err = tmp_err->child)
-    if (tmp_err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)
-      {
-        /* We just found a "left a local mod" error, so tolerate it
-           and clear the whole error. In that case we continue with
-           modified files left on the disk. */
-        svn_error_clear(err);
-        return SVN_NO_ERROR;
-      }
-
-  /* Otherwise, we just return our top-most error. */
-  return err;
-}
-
-
 /* ===================================================================== */
 /* Checking for local modifications. */
 
@@ -1871,7 +1839,7 @@ check_tree_conflict(svn_wc_conflict_desc
                * but the update editor will not visit the subdirectories
                * of a directory that it wants to delete.  Therefore, we
                * need to start a separate crawl here. */
-              if (!svn_wc__adm_missing(eb->db, local_abspath, pool))
+              if (status != svn_wc__db_status_obstructed)
                 SVN_ERR(tree_has_local_mods(&modified, &all_mods_are_deletes,
                                             eb->db, local_abspath,
                                             eb->cancel_func, eb->cancel_baton,
@@ -1969,58 +1937,55 @@ already_in_a_tree_conflict(svn_boolean_t
 
   while (TRUE)
     {
-      svn_wc__db_kind_t kind;
-      svn_boolean_t hidden;
-      svn_boolean_t is_wc_root;
+      svn_wc__db_status_t status;
+      svn_boolean_t is_wc_root, has_conflict;
       svn_error_t *err;
       const svn_wc_conflict_description2_t *conflict;
 
       svn_pool_clear(iterpool);
 
-      err = svn_wc__db_read_kind(&kind, db, ancestor_abspath, TRUE,
-                                 iterpool);
+      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, &has_conflict, NULL,
+                                 db, ancestor_abspath, iterpool, iterpool);
 
       if (err)
         {
-          if (! SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
+          if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
+              && !SVN_WC__ERR_IS_NOT_CURRENT_WC(err))
             return svn_error_return(err);
 
           svn_error_clear(err);
           break;
         }
 
-      if (kind == svn_wc__db_kind_unknown)
-        break;
-
-      SVN_ERR(svn_wc__db_node_hidden(&hidden, db, ancestor_abspath, iterpool));
-
-      if (hidden)
+      if (status == svn_wc__db_status_not_present
+          || status == svn_wc__db_status_absent
+          || status == svn_wc__db_status_excluded)
         break;
 
-      SVN_ERR(svn_wc__db_op_read_tree_conflict(&conflict, db, ancestor_abspath,
-                                               iterpool, iterpool));
-
-      if (conflict != NULL)
+      if (has_conflict)
         {
-          *conflicted = TRUE;
-          break;
+          SVN_ERR(svn_wc__db_op_read_tree_conflict(&conflict, db,
+                                                   ancestor_abspath,
+                                                   iterpool, iterpool));
+
+          if (conflict != NULL)
+            {
+              *conflicted = TRUE;
+              break;
+            }
         }
 
       if (svn_dirent_is_root(ancestor_abspath, strlen(ancestor_abspath)))
         break;
 
-      err = svn_wc__check_wc_root(&is_wc_root, NULL, NULL,
-                                  db, ancestor_abspath, iterpool);
+      SVN_ERR(svn_wc__db_is_wcroot(&is_wc_root, db, ancestor_abspath,
+                                   iterpool));
 
-      if (err
-          && (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND
-              || err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY))
-        {
-          svn_error_clear(err);
-          return SVN_NO_ERROR;
-        }
-      else
-        SVN_ERR(err);
+      if (is_wc_root)
+        break;
 
       ancestor_abspath = svn_dirent_dirname(ancestor_abspath, scratch_pool);
     }
@@ -2094,18 +2059,23 @@ do_entry_deletion(struct edit_baton *eb,
                   apr_pool_t *pool)
 {
   svn_wc__db_kind_t kind;
-  svn_boolean_t already_conflicted;
+  svn_boolean_t conflicted;
   svn_wc_conflict_description2_t *tree_conflict = NULL;
   const char *dir_abspath = svn_dirent_dirname(local_abspath, pool);
   svn_boolean_t hidden;
   svn_skel_t *work_item;
 
-  SVN_ERR(svn_wc__db_read_kind(&kind, eb->db, local_abspath, FALSE, pool));
+  SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL,
+                               &conflicted, NULL,
+                               eb->db, local_abspath, pool, pool));
 
   /* Is this path a conflict victim? */
-  SVN_ERR(node_already_conflicted(&already_conflicted, eb->db,
-                                  local_abspath, pool));
-  if (already_conflicted)
+  if (conflicted)
+    SVN_ERR(node_already_conflicted(&conflicted, eb->db,
+                                    local_abspath, pool));
+  if (conflicted)
     {
       SVN_ERR(remember_skipped_tree(eb, local_abspath));
 
@@ -2166,16 +2136,16 @@ do_entry_deletion(struct edit_baton *eb,
         {
           /* The item exists locally and has some sort of local mod.
            * It no longer exists in the repository at its target URL@REV.
-           * (### If its WC parent was not updated similarly, then it needs to
-           * be marked 'deleted' in its WC parent.)
+           *
            * To prepare the "accept mine" resolution for the tree conflict,
            * we must schedule the existing content for re-addition as a copy
            * of what it was, but with its local modifications preserved. */
 
-          SVN_ERR(svn_wc__db_temp_op_make_copy(eb->db, local_abspath, TRUE,
+          SVN_ERR(svn_wc__db_temp_op_make_copy(eb->db, local_abspath, FALSE,
                                                pool));
 
-          return SVN_NO_ERROR;
+          /* Fall through to remove the BASE_NODEs properly, with potentially
+             keeping a not-present marker */
         }
       else if (tree_conflict->reason == svn_wc_conflict_reason_deleted)
         {
@@ -2190,28 +2160,18 @@ do_entry_deletion(struct edit_baton *eb,
         {
           /* The item was locally replaced with something else. We should
            * remove the BASE node below the new working node, which turns
-           * the replacement in an addition.
-           */
-
-          /* ### This does something similar, but not exactly what is
-             ### required: Copy working to working and then delete
-             ### BASE_NODE. Not exactly right, but not
-             ### completely wrong as the result is the same.
-
-             ### It only misses the explicit target check for adding
-             ### back a not-present node. */
-          SVN_ERR(svn_wc__db_temp_op_make_copy(eb->db, local_abspath, TRUE,
-                                               pool));
-
-          return SVN_NO_ERROR;
+           * the replacement in an addition. */
+           
+           /* Fall through to the normal "delete" code path. */
         }
       else
         SVN_ERR_MALFUNCTION();  /* other reasons are not expected here */
     }
 
-  /* Issue a loggy command to delete the entry from version control and to
-     delete it from disk if unmodified, but leave any modified files on disk
-     unversioned.
+  /* Issue a wq operation to delete the BASE_NODE data and to delete actual
+     nodes based on that from disk, but leave any WORKING_NODEs on disk.
+
+     Local modifications are already turned into copies at this point.
 
      If the thing being deleted is the *target* of this update, then
      we need to recreate a 'deleted' entry, so that the parent can give
@@ -2219,58 +2179,21 @@ do_entry_deletion(struct edit_baton *eb,
   if (strcmp(local_abspath, eb->target_abspath) != 0)
     {
       /* Delete, and do not leave a not-present node.  */
-      SVN_ERR(svn_wc__loggy_delete_entry(&work_item,
-                                         eb->db, dir_abspath, local_abspath,
-                                         SVN_INVALID_REVNUM,
-                                         svn_wc__db_kind_unknown,
-                                         pool));
+      SVN_ERR(svn_wc__wq_build_base_remove(&work_item,
+                                           eb->db, local_abspath, FALSE,
+                                           pool, pool));
       SVN_ERR(svn_wc__db_wq_add(eb->db, dir_abspath, work_item, pool));
     }
   else
     {
       /* Delete, leaving a not-present node.  */
-      SVN_ERR(svn_wc__loggy_delete_entry(&work_item,
-                                         eb->db, dir_abspath, local_abspath,
-                                         *eb->target_revision,
-                                         kind,
-                                         pool));
+      SVN_ERR(svn_wc__wq_build_base_remove(&work_item,
+                                           eb->db, local_abspath, TRUE,
+                                           pool, pool));
       SVN_ERR(svn_wc__db_wq_add(eb->db, dir_abspath, work_item, pool));
       eb->target_deleted = TRUE;
     }
 
-  if (eb->switch_relpath)
-    {
-      /* The SVN_WC__LOG_DELETE_ENTRY log item will cause
-       * svn_wc_remove_from_revision_control() to be run.  But that
-       * function checks whether the deletion target's URL is child of
-       * its parent directory's URL, and if it's not, then the entry
-       * in parent won't be deleted (because presumably the child
-       * represents a disjoint working copy, i.e., it is a wc_root).
-       *
-       * However, during a switch this works against us, because by
-       * the time we get here, the parent's URL has already been
-       * changed.  So we manually remove the child from revision
-       * control after the delete-entry item has been written in the
-       * parent's log, but before it is run, so the only work left for
-       * the log item is to remove the entry in the parent directory.
-       */
-
-      if (kind == svn_wc__db_kind_dir)
-        {
-          SVN_ERR(leftmod_error_chain(
-                    svn_wc__internal_remove_from_revision_control(
-                      eb->db,
-                      local_abspath,
-                      TRUE, /* destroy */
-                      FALSE, /* instant error */
-                      eb->cancel_func,
-                      eb->cancel_baton,
-                      pool)));
-        }
-    }
-
-  /* Note: these two lines are duplicated in the tree-conflicts bail out
-   * above. */
   SVN_ERR(svn_wc__wq_run(eb->db, dir_abspath,
                          eb->cancel_func, eb->cancel_baton,
                          pool));
@@ -2332,7 +2255,7 @@ add_directory(const char *path,
   svn_node_kind_t kind;
   svn_wc__db_status_t status;
   svn_wc__db_kind_t wc_kind;
-  svn_boolean_t already_conflicted;
+  svn_boolean_t conflicted;
   svn_boolean_t versioned_locally_and_present;
   svn_wc_conflict_description2_t *tree_conflict = NULL;
   svn_error_t *err;
@@ -2422,8 +2345,8 @@ add_directory(const char *path,
 
   err = svn_wc__db_read_info(&status, &wc_kind, NULL, NULL, NULL, NULL, NULL,
                              NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL,
+                             NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                             &conflicted, NULL,
                              eb->db, db->local_abspath, db->pool, db->pool);
   if (err)
     {
@@ -2440,9 +2363,10 @@ add_directory(const char *path,
     versioned_locally_and_present = IS_NODE_PRESENT(status);
 
   /* Is this path a conflict victim? */
-  SVN_ERR(node_already_conflicted(&already_conflicted, eb->db,
-                                  db->local_abspath, pool));
-  if (already_conflicted
+  if (conflicted)
+    SVN_ERR(node_already_conflicted(&conflicted, eb->db,
+                                    db->local_abspath, pool));
+  if (conflicted
       && status == svn_wc__db_status_not_present
       && kind == svn_node_none)
     {
@@ -2467,12 +2391,12 @@ add_directory(const char *path,
                                                   db->local_abspath,
                                                   NULL, pool));
           /* Don't skip this path after all. */
-          already_conflicted = FALSE;
+          conflicted = FALSE;
         }
     }
 
   /* Now the "usual" behaviour if already conflicted. Skip it. */
-  if (already_conflicted)
+  if (conflicted)
     {
       /* Record this conflict so that its descendants are skipped silently. */
       SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
@@ -2675,17 +2599,10 @@ add_directory(const char *path,
 
   if (tree_conflict != NULL)
     {
-      svn_skel_t *work_item;
-
       /* Queue this conflict in the parent so that its descendants
          are skipped silently. */
-      SVN_ERR(svn_wc__loggy_add_tree_conflict(&work_item,
-                                              eb->db,
-                                              pb->local_abspath,
-                                              tree_conflict,
-                                              pool));
-      SVN_ERR(svn_wc__db_wq_add(eb->db, pb->local_abspath,
-                                work_item, pool));
+      SVN_ERR(svn_wc__db_op_set_tree_conflict(eb->db, db->local_abspath,
+                                              tree_conflict, pool));
 
       SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
 
@@ -2800,7 +2717,7 @@ open_directory(const char *path,
   struct dir_baton *db, *pb = parent_baton;
   struct edit_baton *eb = pb->edit_baton;
   svn_boolean_t have_work;
-  svn_boolean_t already_conflicted;
+  svn_boolean_t conflicted;
   svn_wc_conflict_description2_t *tree_conflict = NULL;
   svn_wc__db_status_t status, base_status;
 
@@ -2830,7 +2747,7 @@ open_directory(const char *path,
                                NULL, NULL, NULL, NULL, NULL,
                                &db->ambient_depth, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL,
-                               NULL, &have_work, NULL, NULL,
+                               NULL, &have_work, &conflicted, NULL,
                                eb->db, db->local_abspath, pool, pool));
 
   if (!have_work)
@@ -2845,9 +2762,10 @@ open_directory(const char *path,
   db->was_incomplete = (base_status == svn_wc__db_status_incomplete);
 
   /* Is this path a conflict victim? */
-  SVN_ERR(node_already_conflicted(&already_conflicted, eb->db,
-                                  db->local_abspath, pool));
-  if (already_conflicted)
+  if (conflicted)
+    SVN_ERR(node_already_conflicted(&conflicted, eb->db,
+                                    db->local_abspath, pool));
+  if (conflicted)
     {
       SVN_ERR(remember_skipped_tree(eb, db->local_abspath));
 
@@ -2874,13 +2792,9 @@ open_directory(const char *path,
   /* Remember the roots of any locally deleted trees. */
   if (tree_conflict != NULL)
     {
-      svn_skel_t *work_item;
-
       /* Place a tree conflict into the parent work queue.  */
-      SVN_ERR(svn_wc__loggy_add_tree_conflict(&work_item,
-                                              eb->db, pb->local_abspath,
+      SVN_ERR(svn_wc__db_op_set_tree_conflict(eb->db, db->local_abspath,
                                               tree_conflict, pool));
-      SVN_ERR(svn_wc__db_wq_add(eb->db, pb->local_abspath, work_item, pool));
 
       do_notification(eb, db->local_abspath, svn_node_dir,
                       svn_wc_notify_tree_conflict, pool);
@@ -3833,7 +3747,7 @@ add_file(const char *path,
   svn_wc__db_kind_t wc_kind;
   svn_wc__db_status_t status;
   apr_pool_t *subpool;
-  svn_boolean_t already_conflicted;
+  svn_boolean_t conflicted;
   svn_boolean_t versioned_locally_and_present;
   svn_error_t *err;
   svn_wc_conflict_description2_t *tree_conflict = NULL;
@@ -3883,8 +3797,8 @@ add_file(const char *path,
 
   err = svn_wc__db_read_info(&status, &wc_kind, NULL, NULL, NULL, NULL, NULL,
                              NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                             NULL,
+                             NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                             &conflicted, NULL,
                              eb->db, fb->local_abspath, subpool, subpool);
 
   if (err)
@@ -3903,9 +3817,10 @@ add_file(const char *path,
 
 
   /* Is this path a conflict victim? */
-  SVN_ERR(node_already_conflicted(&already_conflicted, eb->db,
-                                  fb->local_abspath, subpool));
-  if (already_conflicted)
+  if (conflicted)
+    SVN_ERR(node_already_conflicted(&conflicted, eb->db,
+                                    fb->local_abspath, subpool));
+  if (conflicted)
     {
       svn_boolean_t do_skip = TRUE;
 
@@ -4165,17 +4080,12 @@ add_file(const char *path,
 
   if (tree_conflict != NULL)
     {
-      svn_skel_t *work_item;
-
       fb->obstruction_found = TRUE;
 
-      SVN_ERR(svn_wc__loggy_add_tree_conflict(&work_item,
-                                              eb->db,
-                                              pb->local_abspath,
+      SVN_ERR(svn_wc__db_op_set_tree_conflict(eb->db,
+                                              fb->local_abspath,
                                               tree_conflict,
                                               subpool));
-      SVN_ERR(svn_wc__db_wq_add(eb->db, pb->local_abspath,
-                                work_item, pool));
 
       fb->already_notified = TRUE;
       do_notification(eb, fb->local_abspath, svn_node_unknown,
@@ -4207,7 +4117,7 @@ open_file(const char *path,
   struct edit_baton *eb = pb->edit_baton;
   struct file_baton *fb;
   svn_node_kind_t kind;
-  svn_boolean_t already_conflicted;
+  svn_boolean_t conflicted;
   svn_wc_conflict_description2_t *tree_conflict = NULL;
 
   /* the file_pool can stick around for a *long* time, so we want to use
@@ -4238,13 +4148,14 @@ open_file(const char *path,
   SVN_ERR(svn_wc__db_read_info(NULL, NULL, &fb->old_revision, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, &conflicted, NULL,
                                eb->db, fb->local_abspath, subpool, subpool));
 
   /* Is this path a conflict victim? */
-  SVN_ERR(node_already_conflicted(&already_conflicted, eb->db,
-                                  fb->local_abspath, pool));
-  if (already_conflicted)
+  if (conflicted)
+    SVN_ERR(node_already_conflicted(&conflicted, eb->db,
+                                    fb->local_abspath, pool));
+  if (conflicted)
     {
       SVN_ERR(remember_skipped_tree(eb, fb->local_abspath));
 
@@ -4266,17 +4177,14 @@ open_file(const char *path,
   if (!pb->in_deleted_and_tree_conflicted_subtree)
     SVN_ERR(check_tree_conflict(&tree_conflict, eb, fb->local_abspath,
                                 svn_wc_conflict_action_edit, svn_node_file,
-                                fb->new_relpath, pool));
+                                fb->new_relpath, subpool));
 
   /* Is this path the victim of a newly-discovered tree conflict? */
   if (tree_conflict)
     {
-      svn_skel_t *work_item;
-
-      SVN_ERR(svn_wc__loggy_add_tree_conflict(&work_item,
-                                              eb->db, pb->local_abspath,
-                                              tree_conflict, pool));
-      SVN_ERR(svn_wc__db_wq_add(eb->db, pb->local_abspath, work_item, pool));
+      SVN_ERR(svn_wc__db_op_set_tree_conflict(eb->db,
+                                              fb->local_abspath,
+                                              tree_conflict, subpool));
 
       if (tree_conflict->reason == svn_wc_conflict_reason_deleted ||
           tree_conflict->reason == svn_wc_conflict_reason_replaced)
@@ -4291,7 +4199,7 @@ open_file(const char *path,
 
       fb->already_notified = TRUE;
       do_notification(eb, fb->local_abspath, svn_node_unknown,
-                      svn_wc_notify_tree_conflict, pool);
+                      svn_wc_notify_tree_conflict, subpool);
     }
 
   svn_pool_destroy(subpool);
@@ -5178,13 +5086,10 @@ close_file(void *file_baton,
                                       svn_wc_conflict_action_add, svn_node_file,
                                       fb->new_relpath, pool));
           SVN_ERR_ASSERT(tree_conflict != NULL);
-          SVN_ERR(svn_wc__loggy_add_tree_conflict(&work_item,
-                                                  eb->db,
-                                                  fb->dir_baton->local_abspath,
+          SVN_ERR(svn_wc__db_op_set_tree_conflict(eb->db,
+                                                  fb->local_abspath,
                                                   tree_conflict,
-                                                  pool));
-          SVN_ERR(svn_wc__db_wq_add(eb->db, fb->dir_baton->local_abspath,
-                                    work_item, pool));
+                                                  scratch_pool));
 
           fb->already_notified = TRUE;
           do_notification(eb, fb->local_abspath, svn_node_unknown,
@@ -5660,6 +5565,9 @@ tweak_entries(svn_wc__db_t *db,
       excluded = (apr_hash_get(exclude_paths, child_abspath,
                                APR_HASH_KEY_STRING) != NULL);
 
+      if (excluded)
+        continue;
+
       SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -5675,8 +5583,7 @@ tweak_entries(svn_wc__db_t *db,
             || status == svn_wc__db_status_absent
             || status == svn_wc__db_status_excluded)
         {
-          if (excluded)
-            continue;
+          
 
           if (kind == svn_wc__db_kind_dir)
             SVN_ERR(tweak_node(db, child_abspath, svn_wc__db_kind_dir, TRUE,
@@ -5705,39 +5612,35 @@ tweak_entries(svn_wc__db_t *db,
              long as this function is only called as a helper to
              svn_wc__do_update_cleanup, since the update will already have
              restored any missing items that it didn't want to delete. */
-          if (svn_wc__adm_missing(db, child_abspath, iterpool))
+          if (status == svn_wc__db_status_obstructed_add
+              || status == svn_wc__db_status_obstructed)
             {
-              if ( (status == svn_wc__db_status_added
-                    || status == svn_wc__db_status_obstructed_add)
-                  && !excluded)
-                {
-                  SVN_ERR(svn_wc__db_temp_op_remove_entry(db, child_abspath,
-                                                          iterpool));
+              SVN_ERR(svn_wc__db_temp_op_remove_entry(db, child_abspath,
+                                                      iterpool));
 
-                  if (notify_func)
-                    {
-                      svn_wc_notify_t *notify;
+              if (notify_func)
+                {
+                  svn_wc_notify_t *notify;
 
-                      notify = svn_wc_create_notify(child_abspath,
-                                                    svn_wc_notify_delete,
-                                                    iterpool);
-
-                      if (kind == svn_wc__db_kind_dir)
-                        notify->kind = svn_node_dir;
-                      else if (kind == svn_wc__db_kind_file)
-                        notify->kind = svn_node_file;
-                      else
-                        notify->kind = svn_node_unknown;
+                  notify = svn_wc_create_notify(child_abspath,
+                                                svn_wc_notify_delete,
+                                                iterpool);
+
+                  if (kind == svn_wc__db_kind_dir)
+                    notify->kind = svn_node_dir;
+                  else if (kind == svn_wc__db_kind_file)
+                    notify->kind = svn_node_file;
+                  else
+                    notify->kind = svn_node_unknown;
 
-                      (* notify_func)(notify_baton, notify, iterpool);
-                    }
+                  notify_func(notify_baton, notify, iterpool);
                 }
-              /* Else if missing item is schedule-add, do nothing. */
             }
 
-          /* Not missing, deleted, or absent, so recurse. */
+          /* Not missing or hidden, so recurse. */
           else
 #endif
+
             {
               SVN_ERR(tweak_entries(db, child_abspath, child_repos_relpath,
                                     new_repos_root_url, new_repos_uuid,
@@ -5869,19 +5772,42 @@ close_edit(void *edit_baton,
 {
   struct edit_baton *eb = edit_baton;
 
-  #ifndef SVN_WC__SINGLE_DB
+#ifndef SVN_WC__SINGLE_DB
   /* If the explicit target still misses its administrative data, then it
      apparently wasn't re-added by the update process, so we'll
      pretend that the editor deleted the entry.  The helper function
      do_entry_deletion() will take care of the necessary steps.  */
-  if ((*eb->target_basename) &&
-      svn_wc__adm_missing(eb->db, eb->target_abspath, pool))
+  if (!eb->target_deleted
+      && (*eb->target_basename))
     {
-      /* Still passing NULL for THEIR_URL. A case where THEIR_URL
-       * is needed in this call is rare or even non-existant.
-       * ### TODO: Construct a proper THEIR_URL anyway. See also
-       * NULL handling code in do_entry_deletion(). */
-      SVN_ERR(do_entry_deletion(eb, eb->target_abspath, NULL, FALSE, pool));
+      svn_wc__db_status_t status;
+      svn_wc__db_kind_t kind;
+      svn_error_t *err;
+
+      err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                 NULL, NULL, NULL, NULL,
+                                 eb->db, eb->target_abspath,
+                                 pool, pool);
+
+      if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+        svn_error_clear(err);
+      else
+        SVN_ERR(err);
+
+      if (!err && kind == svn_wc__db_kind_dir
+          && (status == svn_wc__db_status_obstructed
+              || status == svn_wc__db_status_obstructed_add
+              || status == svn_wc__db_status_obstructed_delete))
+        {
+          /* Still passing NULL for THEIR_URL. A case where THEIR_URL
+           * is needed in this call is rare or even non-existant.
+           * ### TODO: Construct a proper THEIR_URL anyway. See also
+           * NULL handling code in do_entry_deletion(). */
+          SVN_ERR(do_entry_deletion(eb, eb->target_abspath, NULL, FALSE,
+                                    pool));
+        }
     }
 #endif