You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/08/04 23:01:28 UTC

svn commit: r982403 - in /subversion/branches/atomic-revprop: ./ subversion/bindings/swig/python/tests/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_fs/ subversion/libsvn_ra_serf/ subversion/libsvn_wc/ ...

Author: danielsh
Date: Wed Aug  4 21:01:27 2010
New Revision: 982403

URL: http://svn.apache.org/viewvc?rev=982403&view=rev
Log:
On the 'atomic-revprop' branch, merge r982006 through r982400 from trunk.

Modified:
    subversion/branches/atomic-revprop/   (props changed)
    subversion/branches/atomic-revprop/subversion/bindings/swig/python/tests/delta.py
    subversion/branches/atomic-revprop/subversion/include/private/svn_wc_private.h
    subversion/branches/atomic-revprop/subversion/include/svn_wc.h
    subversion/branches/atomic-revprop/subversion/libsvn_client/merge.c
    subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c
    subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c
    subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c
    subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c
    subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c
    subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c
    subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c
    subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c
    subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h
    subversion/branches/atomic-revprop/subversion/svn/log-cmd.c
    subversion/branches/atomic-revprop/subversion/tests/cmdline/diff_tests.py
    subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c

Propchange: subversion/branches/atomic-revprop/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug  4 21:01:27 2010
@@ -34,4 +34,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:965046-982005
+/subversion/trunk:965046-982400

Modified: subversion/branches/atomic-revprop/subversion/bindings/swig/python/tests/delta.py
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/bindings/swig/python/tests/delta.py?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/bindings/swig/python/tests/delta.py (original)
+++ subversion/branches/atomic-revprop/subversion/bindings/swig/python/tests/delta.py Wed Aug  4 21:01:27 2010
@@ -46,6 +46,21 @@ class DeltaTestCase(unittest.TestCase):
     window_handler, baton = \
        svn.delta.tx_apply(src_stream, target_stream, None)
     window_handler(None, baton)
+    
+  def testTxdeltaWindowT(self):
+    """Test the svn_txdelta_window_t wrapper."""
+    a = StringIO("abc\ndef\n")
+    b = StringIO("def\nghi\n")
+    
+    delta_stream = svn.delta.svn_txdelta(a, b)
+    window = svn.delta.svn_txdelta_next_window(delta_stream)
+    
+    self.assert_(window.sview_offset + window.sview_len <= len(a.getvalue()))
+    self.assert_(window.tview_len <= len(b.getvalue()))
+    self.assert_(len(window.new_data) > 0)
+    self.assertEqual(window.num_ops, len(window.ops))
+    self.assertEqual(window.src_ops, len([op for op in window.ops
+      if op.action_code == svn.delta.svn_txdelta_source]))
 
 def suite():
   return unittest.defaultTestLoader.loadTestsFromTestCase(DeltaTestCase)

Modified: subversion/branches/atomic-revprop/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/include/private/svn_wc_private.h?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/atomic-revprop/subversion/include/private/svn_wc_private.h Wed Aug  4 21:01:27 2010
@@ -375,8 +375,10 @@ svn_wc__node_get_copyfrom_info(const cha
                                apr_pool_t *scratch_pool);
 
 /**
- * Recursively call @a walk_callback for all nodes underneath
- * @a local_abspath, restricted by @a walk_depth.
+ * Call @a walk_callback with @a walk_baton for @a local_abspath and all
+ * nodes underneath it, restricted by @a walk_depth.
+ *
+ * If @a show_hidden is true, include hidden nodes, else ignore them.
  */
 svn_error_t *
 svn_wc__node_walk_children(svn_wc_context_t *wc_ctx,

Modified: subversion/branches/atomic-revprop/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/include/svn_wc.h?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/include/svn_wc.h (original)
+++ subversion/branches/atomic-revprop/subversion/include/svn_wc.h Wed Aug  4 21:01:27 2010
@@ -2709,13 +2709,20 @@ svn_wc_text_modified_p(svn_boolean_t *mo
                        svn_wc_adm_access_t *adm_access,
                        apr_pool_t *pool);
 
-
 /** Set @a *modified_p to non-zero if @a path's properties are modified
  * with regard to the base revision, else set @a modified_p to zero.
  * @a adm_access must be an access baton for @a path.
  *
- * If you want to use this with a post-wc-ng working copy, just call
- * svn_wc_get_prop_diffs2() and examine the output.
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_wc_props_modified_p2(svn_boolean_t *modified_p,
+                         svn_wc_context_t* wc_ctx,
+                         const char *local_abspath,
+                          apr_pool_t *scratch_pool);
+
+/** Similar to svn_wc_props_modified_p2(), but with a relative path and
+ * adm_access baton.
  *
  * @deprecated Provided for backward compatibility with the 1.6 API.
  */
@@ -4238,7 +4245,7 @@ svn_wc_status_set_repos_locks(void *set_
  * @par Important:
  * This is a variant of svn_wc_add4().  No changes will happen
  * to the repository until a commit occurs.  This scheduling can be
- * removed with svn_client_revert2().
+ * removed with svn_client_revert4().
  *
  * @since New in 1.7.
  */
@@ -6952,6 +6959,23 @@ svn_wc_revert(const char *path,
               void *notify_baton,
               apr_pool_t *pool);
 
+/**
+ * Restores a missing node, @a local_abspath using the @a wc_ctx. Records
+ * the new last modified time of the file for status processing.
+ *
+ * If @a use_commit_times is TRUE, then set restored files' timestamps
+ * to their last-commit-times.
+ *
+ * ### Before Single-DB this function can only restore missing files.
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_wc_restore(svn_wc_context_t *wc_ctx,
+               const char *local_abspath,
+               svn_boolean_t use_commit_times,
+               apr_pool_t *scratch_pool);
+
 
 /* Tmp files */
 

Modified: subversion/branches/atomic-revprop/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_client/merge.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_client/merge.c Wed Aug  4 21:01:27 2010
@@ -378,8 +378,9 @@ is_path_conflicted_by_merge(merge_cmd_ba
  *     different kind is expected, or if the disk node cannot be read.
  *   - Return 'missing' if there is no node on disk but one is expected.
  *     Also return 'missing' for absent nodes (not here due to authz).*/
-static svn_wc_notify_state_t
-obstructed_or_missing(const char *local_abspath,
+static svn_error_t *
+obstructed_or_missing(svn_wc_notify_state_t *obstr_state,
+                      const char *local_abspath,
                       const char *local_dir_abspath,
                       const merge_cmd_baton_t *merge_b,
                       apr_pool_t *pool)
@@ -391,20 +392,14 @@ obstructed_or_missing(const char *local_
 
   /* In a dry run, make as if nodes "deleted" by the dry run appear so. */
   if (merge_b->dry_run && dry_run_deleted_p(merge_b, local_abspath))
-    return svn_wc_notify_state_inapplicable;
-
-  /* Since this function returns no svn_error_t, we make all errors look like
-   * no node found in the wc. */
-
-  err = svn_wc_read_kind(&kind_expected, merge_b->ctx->wc_ctx,
-                         local_abspath, FALSE, pool);
-
-  if (err)
     {
-      svn_error_clear(err);
-      kind_expected = svn_node_none;
+      *obstr_state = svn_wc_notify_state_inapplicable;
+      return SVN_NO_ERROR;
     }
 
+  SVN_ERR(svn_wc_read_kind(&kind_expected, merge_b->ctx->wc_ctx,
+                           local_abspath, FALSE, pool));
+
   /* Report absent nodes as 'missing'. First of all, they count as 'hidden',
    * and since we pass show_hidden == FALSE above, they will show up as
    * 'none' here. */
@@ -413,44 +408,66 @@ obstructed_or_missing(const char *local_
       svn_boolean_t is_absent;
       err = svn_wc__node_is_status_absent(&is_absent, merge_b->ctx->wc_ctx,
                                           local_abspath, pool);
-      if (err)
-        svn_error_clear(err);
-      else if (is_absent)
-        return svn_wc_notify_state_missing;
+      if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+        return svn_error_return(err);
+      else if (!err && is_absent)
+        {
+          *obstr_state = svn_wc_notify_state_missing;
+          return SVN_NO_ERROR;
+        }
+
+      svn_error_clear(err);
     }
 
-  /* If a node is deleted, we will still get its kind from the working copy.
+  SVN_ERR(svn_io_check_path(local_abspath, &kind_on_disk, pool));
+
+  /* If a node is deleted, the node might be gone in the working copy (and
+   * it probably is gone after we switch to single-db
+   *
    * But to compare with disk state, we want to consider deleted nodes as
-   * svn_node_none instead of their original kind.
-   * ### Not necessary with central DB:
-   * Because deleted directories are expected to remain on disk until commit
-   * to keep the metadata available, we only do this for files, not dirs. */
-  if (kind_expected == svn_node_file)
+   * svn_node_none instead of their original kind. */
+
+  if (kind_expected == svn_node_file
+      || kind_expected == svn_node_dir)
     {
       svn_boolean_t is_deleted;
-      err = svn_wc__node_is_status_deleted(&is_deleted,
-                                           merge_b->ctx->wc_ctx,
-                                           local_abspath,
-                                           pool);
-      if (err)
-        svn_error_clear(err);
-      else if (is_deleted)
-        kind_expected = svn_node_none;
-    }
 
-  err = svn_io_check_path(local_abspath, &kind_on_disk, pool);
-  if (err)
-    {
-      svn_error_clear(err);
-      kind_on_disk = svn_node_unknown;
+      SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted,
+                                             merge_b->ctx->wc_ctx,
+                                             local_abspath,
+                                             pool));
+      if (is_deleted)
+        {
+          /* ### While we are not at single-db: detect missing .svn dirs.
+             ### Once we switch to single db expected kind should be always
+             ### none, just like for files */
+          if (kind_expected == svn_node_dir)
+            {
+              if (kind_on_disk == svn_node_none)
+                {
+                  svn_boolean_t is_obstructed;
+                  
+                  SVN_ERR(svn_wc__node_is_status_obstructed(&is_obstructed,
+                                                            merge_b->ctx->wc_ctx,
+                                                            local_abspath,
+                                                            pool));
+                  if (!is_obstructed)
+                    kind_expected = svn_node_none; 
+                }
+            }
+          else
+            kind_expected = svn_node_none;
+        }
     }
 
   if (kind_expected == kind_on_disk)
-    return svn_wc_notify_state_inapplicable;
+    *obstr_state = svn_wc_notify_state_inapplicable;
   else if (kind_on_disk == svn_node_none)
-    return svn_wc_notify_state_missing;
+    *obstr_state = svn_wc_notify_state_missing;
   else
-    return svn_wc_notify_state_obstructed;
+    *obstr_state = svn_wc_notify_state_obstructed;
+
+  return SVN_NO_ERROR;
 }
 
 /* Create *LEFT and *RIGHT conflict versions for conflict victim
@@ -1083,8 +1100,9 @@ merge_props_changed(const char *local_di
   {
     svn_wc_notify_state_t obstr_state;
 
-    obstr_state = obstructed_or_missing(local_abspath, local_dir_abspath,
-                                        merge_b, subpool);
+    SVN_ERR(obstructed_or_missing(&obstr_state,
+                                  local_abspath, local_dir_abspath,
+                                  merge_b, subpool));
     if (obstr_state != svn_wc_notify_state_inapplicable)
       {
         if (state)
@@ -1319,8 +1337,9 @@ merge_file_changed(const char *local_dir
   {
     svn_wc_notify_state_t obstr_state;
 
-    obstr_state = obstructed_or_missing(mine_abspath, local_dir_abspath,
-                                        merge_b, subpool);
+    SVN_ERR(obstructed_or_missing(&obstr_state,
+                                  mine_abspath, local_dir_abspath,
+                                  merge_b, subpool));
     if (obstr_state != svn_wc_notify_state_inapplicable)
       {
         if (content_state)
@@ -1349,7 +1368,9 @@ merge_file_changed(const char *local_dir
     SVN_ERR(svn_wc__node_get_depth(&parent_depth, merge_b->ctx->wc_ctx,
                                    svn_dirent_dirname(mine_abspath, subpool),
                                    subpool));
-    if (wc_kind == svn_node_none && parent_depth < svn_depth_files)
+    if (wc_kind == svn_node_none
+        && parent_depth < svn_depth_files
+        && parent_depth != svn_depth_unknown)
       {
         if (content_state)
           *content_state = svn_wc_notify_state_missing;
@@ -1635,8 +1656,9 @@ merge_file_added(const char *local_dir_a
   {
     svn_wc_notify_state_t obstr_state;
 
-    obstr_state = obstructed_or_missing(mine_abspath, local_dir_abspath,
-                                        merge_b, subpool);
+    SVN_ERR(obstructed_or_missing(&obstr_state,
+                                  mine_abspath, local_dir_abspath,
+                                  merge_b, subpool));
     if (obstr_state != svn_wc_notify_state_inapplicable)
       {
         if (content_state)
@@ -1921,8 +1943,9 @@ merge_file_deleted(const char *local_dir
   {
     svn_wc_notify_state_t obstr_state;
 
-    obstr_state = obstructed_or_missing(mine_abspath, local_dir_abspath,
-                                        merge_b, subpool);
+    SVN_ERR(obstructed_or_missing(&obstr_state,
+                                  mine_abspath, local_dir_abspath,
+                                  merge_b, subpool));
     if (obstr_state != svn_wc_notify_state_inapplicable)
       {
         if (state)
@@ -2109,8 +2132,9 @@ merge_dir_added(const char *local_dir_ab
   {
     svn_wc_notify_state_t obstr_state;
 
-    obstr_state = obstructed_or_missing(local_abspath, local_dir_abspath,
-                                        merge_b, subpool);
+    SVN_ERR(obstructed_or_missing(&obstr_state,
+                                  local_abspath, local_dir_abspath,
+                                  merge_b, subpool));
 
     /* In this case of adding a directory, we have an exception to the usual
      * "skip if it's inconsistent" rule. If the directory exists on disk
@@ -2138,7 +2162,7 @@ merge_dir_added(const char *local_dir_ab
         merge_b->added_path = apr_pstrdup(merge_b->pool, local_abspath);
       else
         {
-          SVN_ERR(svn_io_make_dir_recursively(local_abspath, subpool));
+          SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, subpool));
           SVN_ERR(svn_wc_add4(merge_b->ctx->wc_ctx, local_abspath,
                               svn_depth_infinity,
                               copyfrom_url, copyfrom_rev,
@@ -2298,8 +2322,9 @@ merge_dir_deleted(const char *local_dir_
   {
     svn_wc_notify_state_t obstr_state;
 
-    obstr_state = obstructed_or_missing(local_abspath, local_dir_abspath,
-                                        merge_b, subpool);
+    SVN_ERR(obstructed_or_missing(&obstr_state,
+                                  local_abspath, local_dir_abspath,
+                                  merge_b, subpool));
     if (obstr_state != svn_wc_notify_state_inapplicable)
       {
         if (state)
@@ -2430,8 +2455,9 @@ merge_dir_opened(const char *local_dir_a
     }
 
   /* Check for an obstructed or missing node on disk. */
-  obstr_state = obstructed_or_missing(path, local_dir_abspath, merge_b,
-                                      subpool);
+  SVN_ERR(obstructed_or_missing(&obstr_state,
+                                path, local_dir_abspath,
+                                merge_b, subpool));
   if (obstr_state != svn_wc_notify_state_inapplicable)
     {
       if (skip_children)

Modified: subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/fs_fs.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_fs_fs/fs_fs.c Wed Aug  4 21:01:27 2010
@@ -6626,7 +6626,7 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
 {
   apr_hash_t *headers;
   char *value;
-  node_revision_t noderev;
+  representation_t *data_rep;
   struct rep_args *ra;
   struct recover_read_from_file_baton baton;
   svn_stream_t *stream;
@@ -6639,10 +6639,6 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
                                                                pool),
                             pool));
 
-  /* We're going to populate a skeletal noderev - just the id and data_rep. */
-  value = apr_hash_get(headers, HEADER_ID, APR_HASH_KEY_STRING);
-  noderev.id = svn_fs_fs__id_parse(value, strlen(value), pool);
-
   /* Check that this is a directory.  It should be. */
   value = apr_hash_get(headers, HEADER_TYPE, APR_HASH_KEY_STRING);
   if (value == NULL || strcmp(value, KIND_DIR) != 0)
@@ -6653,18 +6649,18 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
   value = apr_hash_get(headers, HEADER_TEXT, APR_HASH_KEY_STRING);
   if (!value)
     return SVN_NO_ERROR;
-  SVN_ERR(read_rep_offsets(&noderev.data_rep, value, NULL, FALSE, pool));
+  SVN_ERR(read_rep_offsets(&data_rep, value, NULL, FALSE, pool));
 
   /* If the directory's data representation wasn't changed in this revision,
      we've already scanned the directory's contents for noderevs, so we don't
      need to again.  This will occur if a property is changed on a directory
      without changing the directory's contents. */
-  if (noderev.data_rep->revision != rev)
+  if (data_rep->revision != rev)
     return SVN_NO_ERROR;
 
   /* We could use get_dir_contents(), but this is much cheaper.  It does
      rely on directory entries being stored as PLAIN reps, though. */
-  offset = noderev.data_rep->offset;
+  offset = data_rep->offset;
   SVN_ERR(svn_io_file_seek(rev_file, APR_SET, &offset, pool));
   SVN_ERR(read_rep_line(&ra, rev_file, pool));
   if (ra->is_delta)
@@ -6676,7 +6672,7 @@ recover_find_max_ids(svn_fs_t *fs, svn_r
      stored in the representation. */
   baton.file = rev_file;
   baton.pool = pool;
-  baton.remaining = noderev.data_rep->expanded_size;
+  baton.remaining = data_rep->expanded_size;
   stream = svn_stream_create(&baton, pool);
   svn_stream_set_read(stream, read_handler_recover);
 

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/property.c Wed Aug  4 21:01:27 2010
@@ -736,7 +736,7 @@ svn_ra_serf__retrieve_props(apr_hash_t *
   return SVN_NO_ERROR;
 }
 
-void
+svn_error_t *
 svn_ra_serf__walk_all_props(apr_hash_t *props,
                             const char *name,
                             svn_revnum_t rev,
@@ -751,14 +751,14 @@ svn_ra_serf__walk_all_props(apr_hash_t *
 
   if (!ver_props)
     {
-      return;
+      return SVN_NO_ERROR;
     }
 
   path_props = apr_hash_get(ver_props, name, strlen(name));
 
   if (!path_props)
     {
-      return;
+      return SVN_NO_ERROR;
     }
 
   for (ns_hi = apr_hash_first(pool, path_props); ns_hi;
@@ -778,9 +778,12 @@ svn_ra_serf__walk_all_props(apr_hash_t *
 
           apr_hash_this(name_hi, &prop_name, &prop_len, &prop_val);
           /* use a subpool? */
-          walker(baton, ns_name, ns_len, prop_name, prop_len, prop_val, pool);
+          SVN_ERR(walker(baton, ns_name, ns_len, prop_name, prop_len,
+                         prop_val, pool));
         }
     }
+
+  return SVN_NO_ERROR;
 }
 
 void

Modified: subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_ra_serf/ra_serf.h Wed Aug  4 21:01:27 2010
@@ -978,7 +978,7 @@ typedef svn_error_t *
                                  const svn_string_t *val,
                                  apr_pool_t *pool);
 
-void
+svn_error_t *
 svn_ra_serf__walk_all_props(apr_hash_t *props,
                             const char *name,
                             svn_revnum_t rev,

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_crawler.c Wed Aug  4 21:01:27 2010
@@ -60,12 +60,16 @@
    last-commit-time.  Either way, set entry-timestamp to match that of
    the working file when all is finished.
 
+   If REMOVE_TEXT_CONFLICT is TRUE, remove an existing text conflict
+   from LOCAL_ABSPATH.
+
    Not that a valid access baton with a write lock to the directory of
    LOCAL_ABSPATH must be available in DB.*/
 static svn_error_t *
 restore_file(svn_wc__db_t *db,
              const char *local_abspath,
              svn_boolean_t use_commit_times,
+             svn_boolean_t remove_text_conflicts,
              apr_pool_t *scratch_pool)
 {
   svn_skel_t *work_item;
@@ -87,8 +91,77 @@ restore_file(svn_wc__db_t *db,
                          scratch_pool));
 
   /* Remove any text conflict */
-  return svn_error_return(svn_wc__resolve_text_conflict(db, local_abspath,
+  if (remove_text_conflicts)
+    SVN_ERR(svn_wc__resolve_text_conflict(db, local_abspath, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc_restore(svn_wc_context_t *wc_ctx,
+               const char *local_abspath,
+               svn_boolean_t use_commit_times,
+               apr_pool_t *scratch_pool)
+{
+  svn_wc__db_status_t status;
+  svn_wc__db_kind_t kind;
+  svn_node_kind_t disk_kind;
+
+  SVN_ERR(svn_io_check_path(local_abspath, &disk_kind, scratch_pool));
+
+  if (disk_kind != svn_node_none)
+    return svn_error_createf(SVN_ERR_WC_PATH_FOUND, NULL,
+                             _("The existing node '%s' can not be restored."),
+                             svn_dirent_local_style(local_abspath,
+                                                    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,
+                               wc_ctx->db, local_abspath,
+                               scratch_pool, scratch_pool));
+
+  switch (status)
+    {
+      case svn_wc__db_status_added:
+        SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL, NULL,
+                                         NULL, NULL, NULL,
+                                         wc_ctx->db, local_abspath,
+                                         scratch_pool, scratch_pool));
+        if (status != svn_wc__db_status_added)
+          break; /* Has pristine version */
+      case svn_wc__db_status_deleted:
+      case svn_wc__db_status_not_present:
+      case svn_wc__db_status_absent:
+      case svn_wc__db_status_excluded:
+#ifndef SVN_WC__SINGLE_DB
+      case svn_wc__db_status_obstructed:
+      case svn_wc__db_status_obstructed_add:
+      case svn_wc__db_status_obstructed_delete:
+#endif
+        return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                 _("The node '%s' can not be restored."),
+                                 svn_dirent_local_style(local_abspath,
                                                         scratch_pool));
+    }
+
+  if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
+    SVN_ERR(restore_file(wc_ctx->db, local_abspath, use_commit_times, FALSE,
+                         scratch_pool));
+  else
+#ifdef SVN_WC__SINGLE_DB
+    SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
+#else
+     return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+                                 _("The node '%s' can not be restored."),
+                                 svn_dirent_local_style(local_abspath,
+                                                        scratch_pool));
+#endif
+
+  return SVN_NO_ERROR;
 }
 
 /* Try to restore LOCAL_ABSPATH of node type KIND and if successfull,
@@ -116,7 +189,7 @@ restore_node(svn_boolean_t *restored,
   if (kind == svn_wc__db_kind_file || kind == svn_wc__db_kind_symlink)
     {
       /* Recreate file from text-base */
-      SVN_ERR(restore_file(db, local_abspath, use_commit_times,
+      SVN_ERR(restore_file(db, local_abspath, use_commit_times, TRUE,
                            scratch_pool));
 
       *restored = TRUE;

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/adm_ops.c Wed Aug  4 21:01:27 2010
@@ -1021,7 +1021,7 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
       {
         return
           svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, err,
-                            _("Can't find parent directory's entry while"
+                            _("Can't find parent directory's node while"
                               " trying to add '%s'"),
                             svn_dirent_local_style(local_abspath,
                                                    scratch_pool));
@@ -1534,6 +1534,9 @@ revert_entry(svn_depth_t *depth,
         }
       else if (kind == svn_wc__db_kind_dir)
         {
+#ifndef SVN_WC__SINGLE_DB
+          /* 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))
             {
@@ -1547,6 +1550,7 @@ revert_entry(svn_depth_t *depth,
                                                       pool));
             }
           else
+#endif
             {
               SVN_ERR(svn_wc__internal_remove_from_revision_control(
                                            db,
@@ -2045,15 +2049,16 @@ 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))
     {
-      /* The directory is missing  so don't try to recurse,
-         just delete the entry in the parent directory.
-
-         ### This case disappears after we move to one DB. */
+      /* The directory is missing  so don't try to recurse, in
+         not existing administrative data, just delete the
+         entry in the parent directory. */
       SVN_ERR(svn_wc__db_temp_op_remove_entry(db, local_abspath,
                                               scratch_pool));
     }
+#endif
   else /* looking at THIS_DIR */
     {
       apr_pool_t *iterpool = svn_pool_create(scratch_pool);
@@ -2076,7 +2081,10 @@ svn_wc__internal_remove_from_revision_co
 
           entry_abspath = svn_dirent_join(local_abspath, entry_name, iterpool);
 
-          /* ### where did the adm_missing and depth_exclude test go?!?  */
+          /* ### where did the adm_missing and depth_exclude test go?!? 
+
+             ### BH: depth exclude is handled by hidden and missing is ok
+                     for this temp_op. */
 
           SVN_ERR(svn_wc__db_node_hidden(&hidden, db, entry_abspath,
                                          iterpool));

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/deprecated.c Wed Aug  4 21:01:27 2010
@@ -2330,12 +2330,26 @@ svn_wc_props_modified_p(svn_boolean_t *m
                         svn_wc_adm_access_t *adm_access,
                         apr_pool_t *pool)
 {
-  svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
+  svn_wc_context_t *wc_ctx;
   const char *local_abspath;
+  svn_error_t *err;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+  SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL /* config */,
+                                         svn_wc__adm_get_db(adm_access), pool));
+
+  err = svn_wc_props_modified_p2(modified_p,
+                                 wc_ctx,
+                                 local_abspath,
+                                 pool);
 
-  return svn_wc__props_modified(modified_p, db, local_abspath, pool);
+  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      *modified_p = FALSE;
+    }
+
+  return svn_error_return(svn_wc_context_destroy(wc_ctx));
 }
 
 

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/node.c Wed Aug  4 21:01:27 2010
@@ -673,6 +673,7 @@ walker_helper(svn_wc__db_t *db,
     {
       const char *child_abspath;
       svn_wc__db_kind_t child_kind;
+      svn_wc__db_status_t child_status;
 
       svn_pool_clear(iterpool);
 
@@ -685,27 +686,31 @@ walker_helper(svn_wc__db_t *db,
                                                     const char *),
                                       iterpool);
 
-      if (!show_hidden)
-        {
-          svn_boolean_t hidden;
-
-          SVN_ERR(svn_wc__db_node_hidden(&hidden, db, child_abspath, iterpool));
-          if (hidden)
-            continue;
-        }
-
-      SVN_ERR(svn_wc__db_read_info(NULL, &child_kind, NULL, NULL, NULL, NULL,
+      SVN_ERR(svn_wc__db_read_info(&child_status, &child_kind, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL, NULL,
                                    NULL, NULL, NULL, NULL, NULL,
-                                   NULL,
+                                   NULL, NULL, NULL,
                                    db, child_abspath, iterpool, iterpool));
 
+      if (!show_hidden)
+        switch (child_status)
+          {
+            case svn_wc__db_status_not_present:
+            case svn_wc__db_status_absent:
+            case svn_wc__db_status_excluded:
+              continue;
+            default:
+              break;
+          }
+
       /* Return the child, if appropriate.  (For a directory,
        * this is the first visit: as a child.) */
       if (child_kind == svn_wc__db_kind_file
             || depth >= svn_depth_immediates)
         {
+          /* ### Maybe we should pass kind to the callback?.
+             ### almost every callee starts by asking for this */
           SVN_ERR(walk_callback(child_abspath, walk_baton, iterpool));
         }
 
@@ -1246,9 +1251,9 @@ svn_wc__temp_get_keep_local(svn_boolean_
                             const char *local_abspath,
                             apr_pool_t *scratch_pool)
 {
+#ifndef SVN_WC__SINGLE_DB
   svn_boolean_t is_deleted;
 
-#ifndef SVN_WC__SINGLE_DB
   SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, wc_ctx, local_abspath,
                                          scratch_pool));
   if (is_deleted)

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/props.c Wed Aug  4 21:01:27 2010
@@ -2458,77 +2458,28 @@ svn_wc__props_modified(svn_boolean_t *mo
                        const char *local_abspath,
                        apr_pool_t *scratch_pool)
 {
-  apr_array_header_t *local_propchanges;
-  apr_hash_t *localprops;
-  apr_hash_t *baseprops;
-  svn_wc__db_status_t status;
-  svn_error_t *err;
-
-  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, NULL, NULL,
-                             db, local_abspath,
-                             scratch_pool, scratch_pool);
-
-  /* If we have no entry, we can't have any prop mods. */
-  if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-    {
-      *modified_p = FALSE;
-      svn_error_clear(err);
-      return SVN_NO_ERROR;
-    }
-  else if (err)
-    return err;
-
-  SVN_ERR(load_actual_props(&localprops, db, local_abspath,
-                            scratch_pool, scratch_pool));
-  SVN_ERR_ASSERT(localprops != NULL);
-
-  /* ### this should not apply nowadays. especially if
-                            (SVN_WC__VERSION >= SVN_WC__PROPS_IN_DB)  */
-#if 0
-  {
-    svn_boolean_t replaced;
-
-    /* If something is scheduled for replacement, we do *not* want to
-       pay attention to any base-props;  they might be residual from the
-       old deleted file. */
-    /* ### in modern WC formats, they should be the replaced file's
-       ### base props. hard to know on old WCs tho? (given the above
-       ### comment). just declare propmods if the node has any working
-       ### properties. */
-    SVN_ERR(svn_wc__internal_is_replaced(&replaced, db, local_abspath,
-                                         scratch_pool));
-    if (replaced)
-      {
-        *modified_p = apr_hash_count(localprops) > 0;
-        return SVN_NO_ERROR;
-      }
-  }
-#endif
-
-  /* The WORKING props are present, so let's dig in and see what the
-     differences are. On really old WCs, they might be the same. On
-     newer WCs, the file would have been removed if there was no delta. */
-  SVN_ERR(load_pristine_props(&baseprops, db, local_abspath,
-                              scratch_pool, scratch_pool));
-  if (baseprops == NULL)
-    {
-      /* No pristines are defined. Let's say mods exist if there are any
-         ACTUAL props on this node.  */
-      *modified_p = apr_hash_count(localprops) > 0;
-      return SVN_NO_ERROR;
-    }
-
-  SVN_ERR(svn_prop_diffs(&local_propchanges, localprops, baseprops,
-                         scratch_pool));
-
-  *modified_p = (local_propchanges->nelts > 0);
+  SVN_ERR(svn_wc__db_read_info(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, NULL, modified_p,
+                               NULL, NULL, NULL, NULL,
+                               db, local_abspath,
+                               scratch_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_wc_props_modified_p2(svn_boolean_t *modified_p,
+                         svn_wc_context_t* wc_ctx,
+                         const char *local_abspath,
+                         apr_pool_t *scratch_pool)
+{
+  return svn_error_return(
+             svn_wc__props_modified(modified_p,
+                                    wc_ctx->db,
+                                    local_abspath,
+                                    scratch_pool));
+}
 
 svn_error_t *
 svn_wc__internal_propdiff(apr_array_header_t **propchanges,

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/update_editor.c Wed Aug  4 21:01:27 2010
@@ -708,15 +708,10 @@ complete_directory(struct edit_baton *eb
   int i;
   apr_pool_t *iterpool;
 
-  /* If this is the root directory and there is a target, we can't
+  /* If this is the root directory and there is a target, we don't have to
      mark this directory complete. */
   if (is_root_dir && *eb->target_basename != '\0')
     {
-      /* ### obsolete comment?
-         Before we can finish, we may need to clear the exclude flag for
-         target. Also give a chance to the target that is explicitly pulled
-         in. */
-      svn_wc__db_kind_t kind;
       svn_wc__db_status_t status;
       svn_error_t *err;
 
@@ -731,38 +726,26 @@ complete_directory(struct edit_baton *eb
 
          If there is no BASE node for the target, then we certainly don't
          have to worry about removing it.  */
-      err = svn_wc__db_base_get_info(&status, &kind, NULL,
-                                     NULL, NULL, NULL,
-                                     NULL, NULL, NULL,
-                                     NULL, NULL, NULL, NULL, NULL, NULL,
-                                     eb->db, eb->target_abspath,
-                                     pool, pool);
+      err = svn_wc__db_base_get_info(&status, NULL, NULL, NULL, NULL, NULL,
+                                     NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                     NULL, NULL,
+                                     eb->db, eb->target_abspath, pool, pool);
       if (err)
         {
           if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
             return svn_error_return(err);
 
           svn_error_clear(err);
-          return SVN_NO_ERROR;
         }
 
-      if (status == svn_wc__db_status_excluded)
+      if (!err && status == svn_wc__db_status_excluded)
         {
-          /* ### obsolete comment?
-             There is a small chance that the target is gone in the
-             repository.  If so, we should get rid of the entry now. */
+          /* There is a small chance that the explicit target of an update/
+             switch is gone in the repository, in that specific case the node
+             hasn't been re-added to the BASE tree by this update. If so, we
+             should get rid of this excluded node now. */
 
-          if (kind == svn_wc__db_kind_dir &&
-              svn_wc__adm_missing(eb->db, eb->target_abspath, pool))
-            {
-              /* ### obsolete comment?
-               * 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_ERR(do_entry_deletion(eb, eb->target_abspath, NULL, FALSE, pool));
         }
 
       return SVN_NO_ERROR;
@@ -903,6 +886,9 @@ complete_directory(struct edit_baton *eb
         {
           SVN_ERR(svn_wc__db_base_remove(eb->db, node_abspath, iterpool));
         }
+#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 */
       else if (kind == svn_wc__db_kind_dir
                && svn_wc__adm_missing(eb->db, node_abspath, iterpool)
                && status != svn_wc__db_status_absent)
@@ -916,6 +902,7 @@ complete_directory(struct edit_baton *eb
                             : svn_node_file,
                           iterpool);
         }
+#endif
     }
 
   svn_pool_destroy(iterpool);
@@ -1498,7 +1485,9 @@ modcheck_found_node(const char *local_ab
 
   if (status != svn_wc__db_status_normal)
     modified = TRUE;
-  else
+  /* No need to check if we already have at least one non-delete
+     modification */
+  else if (!baton->found_mod || baton->all_edits_are_deletes)
     SVN_ERR(entry_has_local_mods(&modified, baton->db, local_abspath,
                                  kind, scratch_pool));
 
@@ -3179,7 +3168,7 @@ close_directory(void *dir_baton,
       if (new_changed_author != NULL)
         changed_author = new_changed_author;
 
-#ifdef SINGLE_DB
+#ifdef SVN_WC__SINGLE_DB
       /* If no depth is set yet, set to infinity. */
       if (depth == svn_depth_unknown)
         depth = svn_depth_infinity;
@@ -5629,7 +5618,6 @@ tweak_entries(svn_wc__db_t *db,
               apr_pool_t *pool)
 {
   apr_pool_t *iterpool;
-  svn_wc_notify_t *notify;
   const apr_array_header_t *children;
   int i;
 
@@ -5714,6 +5702,7 @@ tweak_entries(svn_wc__db_t *db,
           if (depth == svn_depth_immediates)
             depth_below_here = svn_depth_empty;
 
+#ifndef SVN_WC__SINGLE_DB
           /* If the directory is 'missing', remove it.  This is safe as
              long as this function is only called as a helper to
              svn_wc__do_update_cleanup, since the update will already have
@@ -5729,6 +5718,8 @@ tweak_entries(svn_wc__db_t *db,
 
                   if (notify_func)
                     {
+                      svn_wc_notify_t *notify;
+
                       notify = svn_wc_create_notify(child_abspath,
                                                     svn_wc_notify_delete,
                                                     iterpool);
@@ -5748,6 +5739,7 @@ tweak_entries(svn_wc__db_t *db,
 
           /* Not missing, deleted, or absent, so recurse. */
           else
+#endif
             {
               SVN_ERR(tweak_entries(db, child_abspath, child_repos_relpath,
                                     new_repos_root_url, new_repos_uuid,
@@ -5879,7 +5871,8 @@ close_edit(void *edit_baton,
 {
   struct edit_baton *eb = edit_baton;
 
-  /* If there is a target and that target is missing, then it
+  #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.  */
@@ -5892,6 +5885,7 @@ close_edit(void *edit_baton,
        * NULL handling code in do_entry_deletion(). */
       SVN_ERR(do_entry_deletion(eb, eb->target_abspath, NULL, FALSE, pool));
     }
+#endif
 
   /* The editor didn't even open the root; we have to take care of
      some cleanup stuffs. */
@@ -6507,10 +6501,12 @@ svn_wc_add_repos_file4(svn_wc_context_t 
                        void *cancel_baton,
                        svn_wc_notify_func2_t notify_func,
                        void *notify_baton,
-                       apr_pool_t *pool)
+                       apr_pool_t *scratch_pool)
 {
   svn_wc__db_t *db = wc_ctx->db;
-  const char *dir_abspath = svn_dirent_dirname(local_abspath, pool);
+  const char *dir_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+  svn_wc__db_status_t status;
+  svn_wc__db_kind_t kind;
   const char *tmp_text_base_abspath;
   svn_checksum_t *new_text_base_md5_checksum;
   svn_checksum_t *new_text_base_sha1_checksum;
@@ -6524,6 +6520,8 @@ svn_wc_add_repos_file4(svn_wc_context_t 
   svn_revnum_t changed_rev;
   apr_time_t changed_date;
   const char *changed_author;
+  svn_error_t *err;
+  apr_pool_t *pool = scratch_pool;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR_ASSERT(new_base_contents != NULL);
@@ -6532,6 +6530,60 @@ svn_wc_add_repos_file4(svn_wc_context_t 
   /* We should have a write lock on this file's parent directory.  */
   SVN_ERR(svn_wc__write_check(db, dir_abspath, pool));
 
+  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, NULL, NULL,
+                             db, local_abspath, scratch_pool, scratch_pool);
+
+  if (err && err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+    return svn_error_return(err);
+  else if(err)
+    svn_error_clear(err);
+  else
+    switch (status)
+      {
+        case svn_wc__db_status_not_present:
+        case svn_wc__db_status_deleted:
+          break;
+        default:
+          return svn_error_createf(SVN_ERR_ENTRY_EXISTS, NULL,
+                                   _("Node '%s' exists."),
+                                   svn_dirent_local_style(local_abspath,
+                                                          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, dir_abspath, scratch_pool, scratch_pool));
+
+  switch (status)
+    {
+      case svn_wc__db_status_normal:
+      case svn_wc__db_status_added:
+        break;
+      case svn_wc__db_status_deleted:
+        return
+          svn_error_createf(SVN_ERR_WC_SCHEDULE_CONFLICT, NULL,
+                            _("Can't add '%s' to a parent directory"
+                              " scheduled for deletion"),
+                            svn_dirent_local_style(local_abspath,
+                                                   scratch_pool));
+      default:
+        return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, err,
+                                 _("Can't find parent directory's node while"
+                                   " trying to add '%s'"),
+                                 svn_dirent_local_style(local_abspath,
+                                                        scratch_pool));
+    }
+  if (kind != svn_wc__db_kind_dir)
+    return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
+                             _("Can't schedule an addition of '%s'"
+                               " below a not-directory node"),
+                             svn_dirent_local_style(local_abspath,
+                                                    scratch_pool));
+
   /* Fabricate the anticipated new URL of the target and check the
      copyfrom URL to be in the same repository. */
   if (copyfrom_url != NULL)
@@ -6565,30 +6617,6 @@ svn_wc_add_repos_file4(svn_wc_context_t 
       copyfrom_rev = SVN_INVALID_REVNUM;  /* Just to be sure.  */
     }
 
-  /* If we're replacing the file then we need to save the destination file's
-     original text base and prop base before replacing it. This allows us to
-     revert the entire change.
-
-     Note: We don't do this when the file was already replaced before because
-     the revert-base is already present and has the original text base.
-
-     ### This block can be removed once the new pristine store is in place */
-  {
-    svn_error_t *err;
-    svn_wc__db_status_t status;
-
-    err = svn_wc__db_base_get_info(&status, NULL, NULL, NULL, NULL, NULL, NULL,
-                                   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                   NULL, db, local_abspath, pool, pool);
-    if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
-      {
-        /* There is no BASE node. Thus, we'll have nothing to save.  */
-        svn_error_clear(err);
-      }
-    else if (err)
-      return svn_error_return(err);
-  }
-
   /* Set CHANGED_* to reflect the entry props in NEW_BASE_PROPS, and
      filter NEW_BASE_PROPS so it contains only regular props. */
   {

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.c Wed Aug  4 21:01:27 2010
@@ -802,7 +802,7 @@ insert_incomplete_working_children(svn_s
                                 svn_relpath_join(local_relpath, name,
                                                  scratch_pool),
 #ifndef SINGLE_DB
-				(apr_int64_t) 2, /* non-THIS_DIR working */
+                                (apr_int64_t) 2, /* non-THIS_DIR working */
 #endif
                                 local_relpath));
       SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
@@ -840,8 +840,8 @@ insert_working_node(void *baton,
   SVN_ERR(svn_sqlite__bindf(stmt, "isstt",
                             piwb->wc_id, piwb->local_relpath,
                             parent_relpath,
-			    presence_map, piwb->presence,
-			    kind_map, piwb->kind));
+                            presence_map, piwb->presence,
+                            kind_map, piwb->kind));
 
   if (piwb->original_repos_relpath != NULL)
     {
@@ -899,11 +899,11 @@ insert_working_node(void *baton,
 #endif
   SVN_ERR(svn_sqlite__get_statement(&stmt_node, sdb, STMT_INSERT_NODE_DATA));
   SVN_ERR(svn_sqlite__bindf(stmt_node, "isistt",
-			    piwb->wc_id, piwb->local_relpath,
-			    op_depth,
-			    parent_relpath,
-			    presence_map, piwb->presence,
-			    kind_map, piwb->kind));
+                            piwb->wc_id, piwb->local_relpath,
+                            op_depth,
+                            parent_relpath,
+                            presence_map, piwb->presence,
+                            kind_map, piwb->kind));
 
   if (SVN_IS_VALID_REVNUM(piwb->changed_rev))
     SVN_ERR(svn_sqlite__bind_int64(stmt_node, 7, piwb->changed_rev));
@@ -915,7 +915,7 @@ insert_working_node(void *baton,
   if (piwb->kind == svn_wc__db_kind_dir)
     {
       SVN_ERR(svn_sqlite__bind_text(stmt_node, 10,
-				    svn_depth_to_word(piwb->depth)));
+                                    svn_depth_to_word(piwb->depth)));
     }
   else if (piwb->kind == svn_wc__db_kind_file)
     {
@@ -933,7 +933,7 @@ insert_working_node(void *baton,
     {
       SVN_ERR(svn_sqlite__bind_int64(stmt_node, 13, piwb->original_repos_id));
       SVN_ERR(svn_sqlite__bind_text(stmt_node, 14,
-				    piwb->original_repos_relpath));
+                    piwb->original_repos_relpath));
       SVN_ERR(svn_sqlite__bind_int64(stmt_node, 15, piwb->original_revnum));
     }
 
@@ -942,7 +942,7 @@ insert_working_node(void *baton,
 
 
   SVN_ERR(svn_sqlite__bind_properties(stmt_node, 16, piwb->props,
-				      scratch_pool));
+                      scratch_pool));
 
   SVN_ERR(svn_sqlite__insert(NULL, stmt_node));
 #endif
@@ -3806,6 +3806,7 @@ set_properties(svn_wc__db_t *db,
   return SVN_NO_ERROR;
 }
 
+#ifdef SVN__SUPPORT_BASE_MERGE
 
 svn_error_t *
 svn_wc__db_temp_base_set_props(svn_wc__db_t *db,
@@ -3815,8 +3816,8 @@ svn_wc__db_temp_base_set_props(svn_wc__d
 {
 #ifdef SVN_WC__NODE_DATA
   SVN_ERR(set_properties(db, local_abspath, props,
-			 STMT_UPDATE_NODE_DATA_BASE_PROPS, "base node",
-			 scratch_pool));
+                         STMT_UPDATE_NODE_DATA_BASE_PROPS,
+                         "base node", scratch_pool));
 #endif
   return svn_error_return(set_properties(db, local_abspath, props,
                                          STMT_UPDATE_BASE_PROPS,
@@ -3833,8 +3834,8 @@ svn_wc__db_temp_working_set_props(svn_wc
 {
 #ifdef SVN_WC__NODE_DATA
   SVN_ERR(set_properties(db, local_abspath, props,
-			 STMT_UPDATE_NODE_DATA_WORKING_PROPS, "working node",
-			 scratch_pool));
+                         STMT_UPDATE_NODE_DATA_WORKING_PROPS,
+                         "working node", scratch_pool));
 #endif
   return svn_error_return(set_properties(db, local_abspath, props,
                                          STMT_UPDATE_WORKING_PROPS,
@@ -3842,6 +3843,7 @@ svn_wc__db_temp_working_set_props(svn_wc
                                          scratch_pool));
 }
 
+#endif /* SVN__SUPPORT_BASE_MERGE  */
 
 svn_error_t *
 svn_wc__db_op_delete(svn_wc__db_t *db,
@@ -4300,9 +4302,9 @@ svn_wc__db_temp_op_remove_entry(svn_wc__
 
 #ifdef SVN_WC__NODE_DATA
       SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
-					STMT_DELETE_NODE_DATA_LAYERS));
+                                        STMT_DELETE_NODE_DATA_LAYERS));
       SVN_ERR(svn_sqlite__bindf(stmt, "isi",
-				wc_id, local_relpath, (apr_int64_t)0));
+                                wc_id, local_relpath, (apr_int64_t)0));
       SVN_ERR(svn_sqlite__step_done(stmt));
 #endif
 
@@ -5523,9 +5525,9 @@ relocate_txn(void *baton, svn_sqlite__db
   SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                STMT_UPDATE_NODE_DATA_RECURSIVE_ORIGINAL_REPO));
   SVN_ERR(svn_sqlite__bindf(stmt, "issii",
-			    rb->wc_id, rb->local_relpath,
+                            rb->wc_id, rb->local_relpath,
                             like_arg, rb->old_repos_id,
-			    new_repos_id));
+                            new_repos_id));
   SVN_ERR(svn_sqlite__step_done(stmt));
 #endif
 
@@ -9657,8 +9659,8 @@ set_new_dir_to_incomplete_baton_txn(void
   SVN_ERR(svn_sqlite__get_statement(&stmt, dtb->pdh->wcroot->sdb,
                                     STMT_DELETE_NODE_DATA_LAYERS));
   SVN_ERR(svn_sqlite__bindf(stmt, "isi", dtb->pdh->wcroot->wc_id,
-			    dtb->local_relpath,
-			    (apr_int64_t)0));
+                            dtb->local_relpath,
+                            (apr_int64_t)0));
   SVN_ERR(svn_sqlite__step_done(stmt));
 #endif
 
@@ -9674,8 +9676,8 @@ set_new_dir_to_incomplete_baton_txn(void
                                             parent_relpath,
                                             (apr_int64_t)dtb->revision));
 
-  /* If depth not unknown or infinity: record depth */
-  if (dtb->depth >= svn_depth_empty && dtb->depth < svn_depth_infinity)
+  /* If depth is not unknown: record depth */
+  if (dtb->depth >= svn_depth_empty && dtb->depth <= svn_depth_infinity)
     SVN_ERR(svn_sqlite__bind_text(stmt, 7, svn_depth_to_word(dtb->depth)));
 
   SVN_ERR(svn_sqlite__step_done(stmt));

Modified: subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/atomic-revprop/subversion/libsvn_wc/wc_db.h Wed Aug  4 21:01:27 2010
@@ -1211,6 +1211,8 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
                         const svn_skel_t *work_items,
                         apr_pool_t *scratch_pool);
 
+/* See props.h  */
+#ifdef SVN__SUPPORT_BASE_MERGE
 /* ### Set the properties of the node LOCAL_ABSPATH in the BASE tree to PROPS.
    ###
    ### This function should not exist because properties should be stored
@@ -1243,7 +1245,7 @@ svn_wc__db_temp_working_set_props(svn_wc
                                   const char *local_abspath,
                                   const apr_hash_t *props,
                                   apr_pool_t *scratch_pool);
-
+#endif
 
 /* ### KFF: This handles files, dirs, symlinks, anything else? */
 /* ### dlr: Does this support recursive dir deletes (e.g. _revert)? Document. */

Modified: subversion/branches/atomic-revprop/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/svn/log-cmd.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/svn/log-cmd.c (original)
+++ subversion/branches/atomic-revprop/subversion/svn/log-cmd.c Wed Aug  4 21:01:27 2010
@@ -648,7 +648,7 @@ svn_cl__log(apr_getopt_t *os,
         {
           target = APR_ARRAY_IDX(targets, i, const char *);
 
-          if (svn_path_is_url(target) || svn_dirent_is_absolute(target))
+          if (svn_path_is_url(target) || target[0] == '/')
             return svn_error_return(svn_error_createf(
                                       SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                       _("Only relative paths can be specified"

Modified: subversion/branches/atomic-revprop/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/cmdline/diff_tests.py?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/atomic-revprop/subversion/tests/cmdline/diff_tests.py Wed Aug  4 21:01:27 2010
@@ -53,8 +53,8 @@ def make_diff_header(path, old_tag, new_
     ]
 
 def make_git_diff_header(path, old_tag, new_tag, add=False, src_label=None,
-                         dst_label=None, delete=False, cp=False, mv=False, 
-                         copyfrom=None):
+                         dst_label=None, delete=False, text_changes=True,
+                         cp=False, mv=False, copyfrom=None):
   """ Generate the expected 'git diff' header for file PATH, with its old
   and new versions described in parentheses by OLD_TAG and NEW_TAG.
   SRC_LABEL and DST_LABEL are paths or urls that are added to the diff
@@ -78,31 +78,42 @@ def make_git_diff_header(path, old_tag, 
     dst_label = ''
 
   if add:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
       "new file mode 10644\n",
-      "--- /dev/null\t(" + old_tag + ")\n",
-      "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- /dev/null\t(" + old_tag + ")\n",
+        "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n"
+      ])
   elif delete:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
       "deleted file mode 10644\n",
-      "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
-      "+++ /dev/null\t(" + new_tag + ")\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
+        "+++ /dev/null\t(" + new_tag + ")\n"
+      ])
   elif cp:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + copyfrom_as_shown + " b/" + path_as_shown + "\n",
       "copy from " + copyfrom_as_shown + "\n",
       "copy to " + path_as_shown + "\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- a/" + copyfrom_as_shown + src_label + "\t(" + old_tag + ")\n",
+        "+++ b/" + path_as_shown + "\t(" + new_tag + ")\n"
+      ])
   elif mv:
     return [
       "Index: " + path_as_shown + "\n",
@@ -111,14 +122,20 @@ def make_git_diff_header(path, old_tag, 
       "rename from " + copyfrom_as_shown + "\n",
       "rename to " + path_as_shown + "\n",
     ]
+    if text_changes:
+      output.extend([
+        "--- a/" + copyfrom_as_shown + src_label + "\t(" + old_tag + ")\n",
+        "+++ b/" + path_as_shown + "\t(" + new_tag + ")\n"
+      ])
   else:
-    return [
+    output = [
       "Index: " + path_as_shown + "\n",
       "===================================================================\n",
       "diff --git a/" + path_as_shown + " b/" + path_as_shown + "\n",
       "--- a/" + path_as_shown + src_label + "\t(" + old_tag + ")\n",
       "+++ b/" + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
     ]
+  return output
 
 
 ######################################################################
@@ -3499,6 +3516,40 @@ def diff_prop_multiple_hunks(sbox):
 
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'diff', iota_path)
+def diff_git_empty_files(sbox):
+  "create a diff in git format for empty files"
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  iota_path = os.path.join(wc_dir, 'iota')
+  new_path = os.path.join(wc_dir, 'new')
+  svntest.main.file_write(iota_path, "")
+
+  # Now commit the local mod, creating rev 2.
+  expected_output = svntest.wc.State(wc_dir, {
+    'iota' : Item(verb='Sending'),
+    })
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'iota' : Item(status='  ', wc_rev=2),
+    })
+
+  svntest.actions.run_and_verify_commit(wc_dir, expected_output,
+                                        expected_status, None, wc_dir)
+
+  svntest.main.file_write(new_path, "")
+  svntest.main.run_svn(None, 'add', new_path)
+  svntest.main.run_svn(None, 'rm', iota_path)
+
+  expected_output = make_git_diff_header(new_path, "revision 0", 
+                                         "working copy", 
+                                         add=True, text_changes=False) + [
+  ] + make_git_diff_header(new_path, "revision 2", "working copy", 
+                           delete=True, text_changes=False)
+
+  svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', 
+                                     '--git-diff', wc_dir)
+
 
 ########################################################################
 #Run the tests
@@ -3561,6 +3612,7 @@ test_list = [ None,
               diff_git_format_url_url,
               diff_prop_missing_context,
               diff_prop_multiple_hunks,
+              XFail(diff_git_empty_files),
               ]
 
 if __name__ == '__main__':

Modified: subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c?rev=982403&r1=982402&r2=982403&view=diff
==============================================================================
--- subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c (original)
+++ subversion/branches/atomic-revprop/subversion/tests/libsvn_diff/parse-diff-test.c Wed Aug  4 21:01:27 2010
@@ -214,6 +214,17 @@ static const char *bad_git_diff_header =
   "+## -1,2 +1,4 ##"                                                    NL
   ""                                                                    NL;
 
+  /* A unidiff containing paths with spaces. */
+  static const char *path_with_spaces_unidiff =
+  "git --diff a/path 1 b/path 1"                                        NL
+  "new file mode 100644"                                                NL
+  "git --diff a/path one 1 b/path one 1"                                NL
+  "new file mode 100644"                                                NL
+  "git --diff a/dir/b/path b/dir/b/path"                                NL
+  "new file mode 100644"                                                NL
+  "git --diff a/b/path 1 b/b/path 1"                                    NL
+  "new file mode 100644"                                                NL;
+
 
 /* Create a PATCH_FILE with name FNAME containing the contents of DIFF. */
 static svn_error_t *
@@ -788,6 +799,58 @@ test_parse_diff_symbols_in_prop_unidiff(
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_git_diffs_with_spaces_diff(apr_pool_t *pool)
+{
+  apr_file_t *patch_file;
+  svn_patch_t *patch;
+  const char *fname = "test_git_diffs_with_spaces_diff.patch";
+
+  SVN_ERR(create_patch_file(&patch_file, fname, path_with_spaces_unidiff,
+                            pool));
+
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "path 1"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "path 1"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+  
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "path one 1"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "path one 1"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "dir/b/path"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "dir/b/path"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+
+  SVN_ERR(svn_diff_parse_next_patch(&patch, patch_file, 
+                                    FALSE, /* reverse */
+                                    FALSE, /* ignore_whitespace */ 
+                                    pool, pool));
+  SVN_TEST_ASSERT(patch);
+  SVN_TEST_ASSERT(! strcmp(patch->old_filename, "b/path 1"));
+  SVN_TEST_ASSERT(! strcmp(patch->new_filename, "b/path 1"));
+  SVN_TEST_ASSERT(patch->operation == svn_diff_op_added);
+  SVN_TEST_ASSERT(patch->hunks->nelts == 0);
+
+  return SVN_NO_ERROR;
+}
 /* ========================================================================== */
 
 struct svn_test_descriptor_t test_funcs[] =
@@ -807,5 +870,7 @@ struct svn_test_descriptor_t test_funcs[
                    "test property and text unidiff parsing"),
     SVN_TEST_PASS2(test_parse_diff_symbols_in_prop_unidiff,
                    "test property diffs with odd symbols"),
+    SVN_TEST_XFAIL2(test_git_diffs_with_spaces_diff,
+                   "test git diffs with spaces in paths"),
     SVN_TEST_NULL
   };