You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/12/08 21:30:55 UTC

svn commit: r1418751 - in /subversion/branches/in-repo-authz: ./ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_ra_serf/ subversion/libsvn_subr/ subversion/libsvn_wc/ subversion/mod_dav_svn/ subversion/mod_d...

Author: breser
Date: Sat Dec  8 20:30:52 2012
New Revision: 1418751

URL: http://svn.apache.org/viewvc?rev=1418751&view=rev
Log:
Sync the 'in-repo-authz' branch with recent trunk changes.
(Merged /subversion/trunk:r1418054-r1418750.)


Modified:
    subversion/branches/in-repo-authz/   (props changed)
    subversion/branches/in-repo-authz/subversion/include/private/svn_wc_private.h
    subversion/branches/in-repo-authz/subversion/include/svn_dav.h
    subversion/branches/in-repo-authz/subversion/include/svn_wc.h
    subversion/branches/in-repo-authz/subversion/libsvn_client/add.c
    subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/options.c
    subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/replay.c
    subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/update.c
    subversion/branches/in-repo-authz/subversion/libsvn_subr/config_file.c
    subversion/branches/in-repo-authz/subversion/libsvn_wc/cleanup.c
    subversion/branches/in-repo-authz/subversion/libsvn_wc/props.h
    subversion/branches/in-repo-authz/subversion/libsvn_wc/upgrade.c
    subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql
    subversion/branches/in-repo-authz/subversion/libsvn_wc/wc.h
    subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c
    subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h
    subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h
    subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c
    subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h
    subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c
    subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c
    subversion/branches/in-repo-authz/subversion/mod_dav_svn/version.c
    subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py
    subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.c
    subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.h
    subversion/branches/in-repo-authz/tools/dist/backport.pl

Propchange: subversion/branches/in-repo-authz/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1418054-1418750

Modified: subversion/branches/in-repo-authz/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/private/svn_wc_private.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/private/svn_wc_private.h Sat Dec  8 20:30:52 2012
@@ -1629,6 +1629,25 @@ svn_wc__get_switch_editor(const svn_delt
  * the ambient depth filtering, so this doesn't have to be handled in the
  * editor.
  *
+ *
+ * A diagram illustrating how this function is used.
+ *
+ *   Steps 1 and 2 create the chain; step 3 drives it.
+ *
+ *   1.                    svn_wc__get_diff_editor(diff_cbs)
+ *                                       |           ^
+ *   2.         svn_ra_do_diff3(editor)  |           |
+ *                    |           ^      |           |
+ *                    v           |      v           |
+ *           +----------+       +----------+       +----------+
+ *           |          |       |          |       |          |
+ *      +--> | reporter | ----> |  editor  | ----> | diff_cbs | ----> text
+ *      |    |          |       |          |       |          |       out
+ *      |    +----------+       +----------+       +----------+
+ *      |
+ *   3. svn_wc_crawl_revisions5(WC,reporter)
+ *
+ *
  * @since New in 1.8.
  */
 svn_error_t *

Modified: subversion/branches/in-repo-authz/subversion/include/svn_dav.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_dav.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_dav.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_dav.h Sat Dec  8 20:30:52 2012
@@ -192,6 +192,11 @@ extern "C" {
  * @since New in 1.8.   */
 #define SVN_DAV_SUPPORTED_POSTS_HEADER "SVN-Supported-Posts"
 
+/** This header is used in the OPTIONS response to indicate if the server
+ * wants bulk update requests (Prefer) or only accepts skelta requests (Off).
+ * If this value is On both options are allowed.
+ * @since New in 1.8.   */
+#define SVN_DAV_ALLOW_BULK_UPDATES "SVN-Allow-Bulk-Updates"
 
 /**
  * @name Fulltext MD5 headers

Modified: subversion/branches/in-repo-authz/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/include/svn_wc.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/include/svn_wc.h (original)
+++ subversion/branches/in-repo-authz/subversion/include/svn_wc.h Sat Dec  8 20:30:52 2012
@@ -1662,10 +1662,10 @@ typedef struct svn_wc_conflict_version_t
   const char *path_in_repos;
   /** @} */
 
-  /** Info about this node */
-  svn_node_kind_t node_kind;  /* note that 'none' is a legitimate value */
+  /** The node kind.  Can be any kind, even 'none' or 'unknown'. */
+  svn_node_kind_t node_kind;
 
-  /** UUID of the repository
+  /** UUID of the repository. Can be NULL meaning unknown.
    * @since New in 1.8. */
   const char *repos_uuid;
 
@@ -1680,11 +1680,15 @@ typedef struct svn_wc_conflict_version_t
  * Allocate an #svn_wc_conflict_version_t structure in @a pool,
  * initialize to contain a conflict origin, and return it.
  *
- * Set the @c repos_url field of the created struct to @a repos_url, the
- * @c path_in_repos field to @a path_in_repos, the @c peg_rev field to
- * @a peg_rev and the @c node_kind to @c node_kind. Make only shallow
+ * Set the @c repos_url field of the created struct to @a repos_root_url,
+ * the @c path_in_repos field to @a repos_relpath, the @c peg_rev field to
+ * @a revision and the @c node_kind to @a kind. Make only shallow
  * copies of the pointer arguments.
  *
+ * @a repos_root_url, @a repos_relpath and @a revision must be valid,
+ * non-null values. @a repos_uuid should be a valid UUID, but can be
+ * NULL if unknown. @a kind can be any kind, even 'none' or 'unknown'.
+ *
  * @since New in 1.8.
  */
 svn_wc_conflict_version_t *

Modified: subversion/branches/in-repo-authz/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_client/add.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_client/add.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_client/add.c Sat Dec  8 20:30:52 2012
@@ -421,7 +421,6 @@ add_dir_recursive(const char *dir_abspat
   apr_hash_t *dirents;
   apr_hash_index_t *hi;
   svn_boolean_t entry_exists = FALSE;
-  svn_boolean_t found_unversioned_root = FALSE;
 
   /* Check cancellation; note that this catches recursive calls too. */
   if (ctx->cancel_func)
@@ -466,7 +465,6 @@ add_dir_recursive(const char *dir_abspat
     {
       SVN_ERR(svn_client__get_all_auto_props(&config_autoprops, dir_abspath,
                                              ctx, scratch_pool, iterpool));
-      found_unversioned_root = TRUE;
     }
 
   SVN_ERR(svn_io_get_dirents3(&dirents, dir_abspath, TRUE, scratch_pool,

Modified: subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/options.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/options.c Sat Dec  8 20:30:52 2012
@@ -280,6 +280,10 @@ capabilities_headers_iterator_callback(v
         {
           opt_ctx->youngest_rev = SVN_STR_TO_REV(val);
         }
+      else if (svn_cstring_casecmp(key, SVN_DAV_ALLOW_BULK_UPDATES) == 0)
+        {
+          session->server_allows_bulk = apr_pstrdup(session->pool, val);
+        }
       else if (svn_cstring_casecmp(key, SVN_DAV_SUPPORTED_POSTS_HEADER) == 0)
         {
           /* May contain multiple values, separated by commas. */

Modified: subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/ra_serf.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/ra_serf.h Sat Dec  8 20:30:52 2012
@@ -228,6 +228,11 @@ struct svn_ra_serf__session_t {
      all the properties and content in the update-report response. If FALSE,
      request a skelta update-report with inlined properties. */
   svn_boolean_t bulk_updates;
+
+  /* Indicates if the server wants bulk update requests (Prefer) or only
+     accepts skelta requests (Off). If this value is On both options are 
+     allowed. */
+  const char *server_allows_bulk;
 };
 
 #define SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(sess) ((sess)->me_resource != NULL)

Modified: subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/replay.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/replay.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/replay.c Sat Dec  8 20:30:52 2012
@@ -655,7 +655,7 @@ svn_ra_serf__replay(svn_ra_session_t *ra
 
   handler->handler_pool = pool;
   handler->method = "REPORT";
-  handler->path = session->session_url_str;
+  handler->path = session->session_url.path;
   handler->body_delegate = create_replay_body;
   handler->body_delegate_baton = replay_ctx;
   handler->body_type = "text/xml";
@@ -798,7 +798,7 @@ svn_ra_serf__replay_range(svn_ra_session
 
           handler->handler_pool = replay_ctx->src_rev_pool;
           handler->method = "REPORT";
-          handler->path = session->session_url_str;
+          handler->path = session->session_url.path;
           handler->body_delegate = create_replay_body;
           handler->body_delegate_baton = replay_ctx;
           handler->conn = session->conns[0];

Modified: subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/update.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_ra_serf/update.c Sat Dec  8 20:30:52 2012
@@ -3161,6 +3161,30 @@ make_update_reporter(svn_ra_session_t *r
                                    svn_io_file_del_on_pool_cleanup,
                                    report->pool, scratch_pool));
 
+  if (sess->server_allows_bulk)
+    {
+      if (apr_strnatcasecmp(sess->server_allows_bulk, "off") == 0)
+        {
+          /* Server doesn't want bulk updates */
+          sess->bulk_updates = FALSE;
+        }
+      else if (apr_strnatcasecmp(sess->server_allows_bulk, "prefer") == 0)
+        {
+          /* Server prefers bulk updates, and we respect that */
+          sess->bulk_updates = TRUE;
+        }
+      else
+        {
+          /* Server allows bulk updates, but doesn't dictate its use. Do
+             whatever is the default or what the user defined in the config. */
+        }
+    }
+  else
+    {
+      /* Pre-1.8 server didn't send the bulk_updates header. Do
+         whatever is the default or what the user defined in the config. */
+    }
+
   if (sess->bulk_updates)
     {
       svn_xml_make_open_tag(&buf, scratch_pool, svn_xml_normal,

Modified: subversion/branches/in-repo-authz/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_subr/config_file.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_subr/config_file.c Sat Dec  8 20:30:52 2012
@@ -814,7 +814,7 @@ svn_config_ensure(const char *config_dir
         "###   http-library               Which library to use for http/https"
                                                                              NL
         "###                              connections."                      NL
-        "###   bulk_updates               Whether to request bulk update" NL
+        "###   bulk-updates               Whether to request bulk update" NL
         "###                              responses, or fetch each file in "
                                                                              NL
         "###                              an individual request. "           NL

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/cleanup.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/cleanup.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/cleanup.c Sat Dec  8 20:30:52 2012
@@ -217,6 +217,8 @@ svn_wc_cleanup3(svn_wc_context_t *wc_ctx
   SVN_ERR(svn_wc__db_base_clear_dav_cache_recursive(db, local_abspath,
                                                     scratch_pool));
 
+  SVN_ERR(svn_wc__db_vacuum(db, local_abspath, scratch_pool));
+
   /* We're done with this DB, so proactively close it.  */
   SVN_ERR(svn_wc__db_close(db));
 

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/props.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/props.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/props.h Sat Dec  8 20:30:52 2012
@@ -84,9 +84,10 @@ svn_wc__internal_propget(const svn_strin
    PRISTINE_PROPS and return the new set of pristine properties in
    *NEW_PRISTINE_PROPS.
 
-   Return any conflicts of the actual props in *CONFLICT_SKEL.  (Changes
-   made to the pristine properties, if BASE_MERGE is TRUE, do not
-   generate conficts.)
+   Append any conflicts of the actual props to *CONFLICT_SKEL.  (First
+   allocate *CONFLICT_SKEL from RESULT_POOL if it is initially NULL.
+   CONFLICT_SKEL itself must not be NULL.)  (Changes made to the pristine
+   properties, if BASE_MERGE is TRUE, do not generate conficts.)
 
    If STATE is non-null, set *STATE to the state of the local properties
    after the merge.  */

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/upgrade.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/upgrade.c Sat Dec  8 20:30:52 2012
@@ -1753,16 +1753,8 @@ upgrade_to_wcng(void **dir_baton,
   return SVN_NO_ERROR;
 }
 
-
-/* Return a string indicating the released version (or versions) of
- * Subversion that used WC format number WC_FORMAT, or some other
- * suitable string if no released version used WC_FORMAT.
- *
- * ### It's not ideal to encode this sort of knowledge in this low-level
- * library.  On the other hand, it doesn't need to be updated often and
- * should be easily found when it does need to be updated.  */
-static const char *
-version_string_from_format(int wc_format)
+const char *
+svn_wc__version_string_from_format(int wc_format)
 {
   switch (wc_format)
     {
@@ -1770,6 +1762,7 @@ version_string_from_format(int wc_format
       case 8: return "1.4";
       case 9: return "1.5";
       case 10: return "1.6";
+      case SVN_WC__WC_NG_VERSION: return "1.7";
     }
   return _("(unreleased development version)");
 }
@@ -1792,7 +1785,7 @@ svn_wc__upgrade_sdb(int *result_format,
                              svn_dirent_local_style(wcroot_abspath,
                                                     scratch_pool),
                              start_format,
-                             version_string_from_format(start_format));
+                             svn_wc__version_string_from_format(start_format));
 
   /* Early WCNG formats no longer supported. */
   if (start_format < 19)

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc-queries.sql Sat Dec  8 20:30:52 2012
@@ -766,6 +766,9 @@ WHERE refcount = 0
 DELETE FROM pristine
 WHERE checksum = ?1 AND refcount = 0
 
+-- STMT_VACUUM
+VACUUM
+
 -- STMT_SELECT_CONFLICT_VICTIMS
 SELECT local_relpath, conflict_data
 FROM actual_node
@@ -827,15 +830,6 @@ VALUES (?1, ?2, 0,
             AND local_relpath = ?2
             AND op_depth = 0))
 
--- STMT_INSTALL_WORKING_NODE_FOR_DELETE_FROM_BASE
-INSERT OR REPLACE INTO nodes (
-    wc_id, local_relpath, op_depth,
-    parent_relpath, presence, kind)
-SELECT wc_id, local_relpath, ?3 /*op_depth*/,
-       parent_relpath, 'base-deleted', kind
-FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = 0
-
 -- STMT_INSTALL_WORKING_NODE_FOR_DELETE
 INSERT OR REPLACE INTO nodes (
     wc_id, local_relpath, op_depth,

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc.h Sat Dec  8 20:30:52 2012
@@ -188,6 +188,16 @@ extern "C" {
 /* A version < this has no work queue (see workqueue.h).  */
 #define SVN_WC__HAS_WORK_QUEUE 13
 
+/* Return a string indicating the released version (or versions) of
+ * Subversion that used WC format number WC_FORMAT, or some other
+ * suitable string if no released version used WC_FORMAT.
+ *
+ * ### It's not ideal to encode this sort of knowledge in this low-level
+ * library.  On the other hand, it doesn't need to be updated often and
+ * should be easily found when it does need to be updated.  */
+const char *
+svn_wc__version_string_from_format(int wc_format);
+
 /* Return true iff error E indicates an "is not a working copy" type
    of error, either because something wasn't a working copy at all, or
    because it's a working copy from a previous version (in need of
@@ -378,17 +388,24 @@ svn_wc__internal_file_modified_p(svn_boo
                                  apr_pool_t *scratch_pool);
 
 
-/* Merge the difference between LEFT_ABSPATH and RIGHT_ABSPATH into
-   TARGET_ABSPATH, return the appropriate work queue operations in
-   *WORK_ITEMS.
-
-   Note that, in the case of updating, the update can have sent new
-   properties, which could affect the way the wc target is
-   detranslated and compared with LEFT and RIGHT for merging.
-
-   The merge result is stored in *MERGE_OUTCOME and merge conflicts
-   are marked in MERGE_RESULT using LEFT_LABEL, RIGHT_LABEL and
-   TARGET_LABEL.
+/* Prepare to merge a file content change into the working copy.  This
+   does not merge properties; see svn_wc__merge_props() for that.  This
+   ### [does | does not]
+   change the working file on disk as well as returning work items.
+
+   Merge the difference between LEFT_ABSPATH and RIGHT_ABSPATH into
+   TARGET_ABSPATH.
+
+   Set *WORK_ITEMS to the appropriate work queue operations.
+
+   If there are any conflicts, append a conflict description to
+   *CONFLICT_SKEL.  (First allocate *CONFLICT_SKEL from RESULT_POOL if
+   it is initially NULL.  CONFLICT_SKEL itself must not be NULL.)
+   Also, unless it is considered to be a 'binary' file, mark any
+   conflicts in the text of the file TARGET_ABSPATH using LEFT_LABEL,
+   RIGHT_LABEL and TARGET_LABEL.
+
+   Set *MERGE_OUTCOME to indicate the result.
 
    When DRY_RUN is true, no actual changes are made to the working copy.
 
@@ -402,11 +419,17 @@ svn_wc__internal_file_modified_p(svn_boo
    retrieved. (Interesting for merging file externals).
 
    ACTUAL_PROPS is the set of actual properties before merging; used for
-   detranslating the file before merging.
+   detranslating the file before merging.  This is necessary because, in
+   the case of updating, the update can have sent new properties, so we
+   cannot simply fetch and use the current actual properties.
+
+     ### Is ACTUAL_PROPS still necessary, now that we first prepare the
+         content change and property change and then apply them both to
+         the WC together?
 
    Property changes sent by the update are provided in PROP_DIFF.
 
-   For a complete description, see svn_wc_merge3() for which this is
+   For a complete description, see svn_wc_merge5() for which this is
    the (loggy) implementation.
 
    *WORK_ITEMS will be allocated in RESULT_POOL. All temporary allocations

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c Sat Dec  8 20:30:52 2012
@@ -641,17 +641,19 @@ blank_ibb(insert_base_baton_t *pibb)
    A/B/C/D    normal              base-del            normal
    A/B/C/D/E  normal              base-del
 
-   When adding a base node if the parent has a working node then the
-   parent base is deleted and this must be extended to cover new base
-   node.
+   When adding a node if the parent has a higher working node then the
+   parent node is deleted (or replaced) and the delete must be extended
+   to cover new node.
 
    In the example above A/B/C/D and A/B/C/D/E are the nodes that get
    the extended delete, A/B/C is already deleted.
  */
-static svn_error_t *
-extend_parent_delete(svn_wc__db_wcroot_t *wcroot,
-                     const char *local_relpath,
-                     apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__db_extend_parent_delete(svn_wc__db_wcroot_t *wcroot,
+                                const char *local_relpath,
+                                svn_kind_t kind,
+                                int op_depth,
+                                apr_pool_t *scratch_pool)
 {
   svn_boolean_t have_row;
   svn_sqlite__stmt_t *stmt;
@@ -662,26 +664,29 @@ extend_parent_delete(svn_wc__db_wcroot_t
 
   SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
                                     STMT_SELECT_LOWEST_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, parent_relpath, 0));
+  SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, parent_relpath,
+                            op_depth));
   SVN_ERR(svn_sqlite__step(&have_row, stmt));
   if (have_row)
     parent_op_depth = svn_sqlite__column_int(stmt, 0);
   SVN_ERR(svn_sqlite__reset(stmt));
   if (have_row)
     {
-      int op_depth;
+      int existing_op_depth;
 
-      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath, 0));
+      SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id, local_relpath,
+                                op_depth));
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
       if (have_row)
-        op_depth = svn_sqlite__column_int(stmt, 0);
+        existing_op_depth = svn_sqlite__column_int(stmt, 0);
       SVN_ERR(svn_sqlite__reset(stmt));
-      if (!have_row || parent_op_depth < op_depth)
+      if (!have_row || parent_op_depth < existing_op_depth)
         {
           SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
-                              STMT_INSTALL_WORKING_NODE_FOR_DELETE_FROM_BASE));
-          SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
-                                    local_relpath, parent_op_depth));
+                              STMT_INSTALL_WORKING_NODE_FOR_DELETE));
+          SVN_ERR(svn_sqlite__bindf(stmt, "isdst", wcroot->wc_id,
+                                    local_relpath, parent_op_depth,
+                                    parent_relpath, kind_map, kind));
           SVN_ERR(svn_sqlite__update(NULL, stmt));
         }
     }
@@ -690,11 +695,11 @@ extend_parent_delete(svn_wc__db_wcroot_t
 }
 
 
-/* This is the reverse of extend_parent_delete.
+/* This is the reverse of svn_wc__db_extend_parent_delete.
 
-   When removing a base node if the parent has a working node then the
-   parent base and this node are both deleted and so the delete of
-   this node must be removed.
+   When removing a node if the parent has a higher working node then
+   the parent node and this node are both deleted or replaced and any
+   delete over this node must be removed.
  */
 svn_error_t *
 svn_wc__db_retract_parent_delete(svn_wc__db_wcroot_t *wcroot,
@@ -856,7 +861,9 @@ insert_base_node(void *baton,
               || (pibb->status == svn_wc__db_status_incomplete))
           && ! pibb->file_external)
         {
-          SVN_ERR(extend_parent_delete(wcroot, local_relpath, scratch_pool));
+          SVN_ERR(svn_wc__db_extend_parent_delete(wcroot, local_relpath,
+                                                  pibb->kind, 0,
+                                                  scratch_pool));
         }
       else if (pibb->status == svn_wc__db_status_not_present
                || pibb->status == svn_wc__db_status_server_excluded
@@ -14611,29 +14618,62 @@ svn_wc__db_bump_format(int *result_forma
                        svn_wc__db_t *db,
                        apr_pool_t *scratch_pool)
 {
+  svn_sqlite__db_t *sdb;
+  svn_error_t *err;
+  int format;
+
+  /* Do not scan upwards for a working copy root here to prevent accidental
+   * upgrades of any working copies the WCROOT might be nested in.
+   * Just try to open a DB at the specified path instead. */
+  err = svn_wc__db_util_open_db(&sdb, wcroot_abspath, SDB_FILE,
+                                svn_sqlite__mode_readwrite,
+                                TRUE, /* exclusive */
+                                NULL, /* my statements */
+                                scratch_pool, scratch_pool);
+  if (err)
+    {
+      svn_error_t *err2;
+      apr_hash_t *entries;
 
+      /* Could not open an sdb. Check for an entries file instead. */
+      err2 = svn_wc__read_entries_old(&entries, wcroot_abspath,
+                                      scratch_pool, scratch_pool);
+      if (err2 || apr_hash_count(entries) == 0)
+        return svn_error_createf(SVN_ERR_WC_INVALID_OP_ON_CWD,
+                  svn_error_compose_create(err, err2),
+                  _("Can't upgrade '%s' as it is not a working copy root"),
+                  svn_dirent_local_style(wcroot_abspath, scratch_pool));
+
+      /* An entries file was found. This is a pre-wc-ng working copy
+       * so suggest an upgrade. */
+      return svn_error_createf(SVN_ERR_WC_UPGRADE_REQUIRED, err,
+                _("Working copy '%s' is too old and must be upgraded to "
+                  "at least format %d, as created by Subversion %s"),
+                svn_dirent_local_style(wcroot_abspath, scratch_pool),
+                SVN_WC__WC_NG_VERSION,
+                svn_wc__version_string_from_format(SVN_WC__WC_NG_VERSION));
+    }
+
+  SVN_ERR(svn_sqlite__read_schema_version(&format, sdb, scratch_pool));
+  SVN_ERR(svn_wc__upgrade_sdb(result_format, wcroot_abspath,
+                              sdb, format, scratch_pool));
+  SVN_ERR(svn_sqlite__close(sdb));
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_wc__db_vacuum(svn_wc__db_t *db,
+                  const char *local_abspath,
+                  apr_pool_t *scratch_pool)
+{
   svn_wc__db_wcroot_t *wcroot;
   const char *local_relpath;
 
   SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
-                                                db, wcroot_abspath,
+                                                db, local_abspath,
                                                 scratch_pool, scratch_pool));
+  SVN_ERR(svn_sqlite__exec_statements(wcroot->sdb, STMT_VACUUM));
 
-  /* This function is indirectly called from the upgrade code, so we
-     can't verify the wcroot here. Just check that it is not NULL */
-  SVN_ERR_ASSERT(wcroot != NULL);
-
-  /* Reject attempts to upgrade subdirectories of a working copy. */
-  if (strcmp(wcroot_abspath, wcroot->abspath) != 0)
-    return svn_error_createf(
-             SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
-              _("Can't upgrade '%s' as it is not a working copy root,"
-                " the root is '%s'"),
-              svn_dirent_local_style(wcroot_abspath, scratch_pool),
-              svn_dirent_local_style(wcroot->abspath, scratch_pool));
-
-  SVN_ERR(svn_wc__upgrade_sdb(result_format, wcroot->abspath,
-                              wcroot->sdb, wcroot->format,
-                              scratch_pool));
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h Sat Dec  8 20:30:52 2012
@@ -1416,8 +1416,8 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
    If PROPS is NULL, set the properties to be the same as the pristine
    properties.
 
-   CONFLICT is used to register a conflict on this node at the same time
-   the properties are changed.
+   If CONFLICT is not NULL, it is used to register a conflict on this
+   node at the same time the properties are changed.
 
    WORK_ITEMS are inserted into the work queue, as additional things that
    need to be completed before the working copy is stable.
@@ -3274,6 +3274,13 @@ svn_wc__db_update_moved_away_conflict_vi
                                              apr_pool_t *result_pool,
                                              apr_pool_t *scratch_pool);
 
+/* Recover space from the database file for LOCAL_ABSPATH by running
+ * the "vacuum" command. */
+svn_error_t *
+svn_wc__db_vacuum(svn_wc__db_t *db,
+                  const char *local_abspath,
+                  apr_pool_t *scratch_pool);
+
 /* @} */
 
 

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h Sat Dec  8 20:30:52 2012
@@ -337,6 +337,13 @@ svn_wc__db_get_children_op_depth(apr_has
 
 
 svn_error_t *
+svn_wc__db_extend_parent_delete(svn_wc__db_wcroot_t *wcroot,
+                                const char *local_relpath,
+                                svn_kind_t kind,
+                                int op_depth,
+                                apr_pool_t *scratch_pool);
+
+svn_error_t *
 svn_wc__db_retract_parent_delete(svn_wc__db_wcroot_t *wcroot,
                                  const char *local_relpath,
                                  int op_depth,

Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c Sat Dec  8 20:30:52 2012
@@ -39,6 +39,7 @@
 #include "svn_editor.h"
 #include "svn_error.h"
 #include "svn_wc.h"
+#include "svn_props.h"
 #include "svn_pools.h"
 
 #include "private/svn_skel.h"
@@ -46,6 +47,7 @@
 #include "private/svn_wc_private.h"
 
 #include "wc.h"
+#include "props.h"
 #include "wc_db_private.h"
 #include "wc-queries.h"
 #include "conflicts.h"
@@ -93,31 +95,10 @@ tc_editor_add_file(void *baton,
                    apr_pool_t *scratch_pool)
 {
   struct tc_editor_baton *b = baton;
-  int parent_op_depth, op_depth = relpath_depth(b->move_root_dst_relpath);
-  const char *parent_relpath = svn_relpath_dirname(relpath, scratch_pool);
-  svn_boolean_t have_row;
-  svn_sqlite__stmt_t *stmt;
+  int op_depth = relpath_depth(b->move_root_dst_relpath);
 
-  /* Extend base-delete. */
-  SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
-                                    STMT_SELECT_LOWEST_WORKING_NODE));
-  SVN_ERR(svn_sqlite__bindf(stmt, "isd", b->wcroot->wc_id, parent_relpath,
-                            op_depth));
-  SVN_ERR(svn_sqlite__step(&have_row, stmt));
-  if (have_row)
-    parent_op_depth = svn_sqlite__column_int(stmt, 0);
-  SVN_ERR(svn_sqlite__reset(stmt));
-  if (have_row)
-    {
-      /* Adding this deleted NODES row is valid if we add the
-         underlying normal row before completing the transaction. */
-      SVN_ERR(svn_sqlite__get_statement(&stmt, b->wcroot->sdb,
-                                        STMT_INSTALL_WORKING_NODE_FOR_DELETE));
-      SVN_ERR(svn_sqlite__bindf(stmt, "isdss", b->wcroot->wc_id, relpath,
-                                parent_op_depth, parent_relpath,
-                                "file" /* ### TODO use kind_map */ ));
-      SVN_ERR(svn_sqlite__update(NULL, stmt));
-    }
+  SVN_ERR(svn_wc__db_extend_parent_delete(b->wcroot, relpath, svn_kind_file,
+                                          op_depth, scratch_pool));
 
   /* ### TODO check for, and flag, tree conflict */
 
@@ -194,7 +175,16 @@ check_shadowed_node(svn_boolean_t *is_sh
   return SVN_NO_ERROR;
 }
 
-/* Update text and prop contents of the working file at LOCAL_RELPATH.
+/* All the info we need about one version of a file node. */
+typedef struct file_version_t
+{
+  svn_wc_conflict_version_t *location_and_kind;
+  apr_hash_t *props;
+  const svn_checksum_t *checksum;
+} file_version_t;
+
+/* Merge the difference between OLD_VERSION and NEW_VERSION into
+ * the working file at LOCAL_RELPATH.
  *
  * The term 'old' refers to the pre-update state, which is the state of
  * (some layer of) LOCAL_RELPATH while this function runs; and 'new'
@@ -204,9 +194,6 @@ check_shadowed_node(svn_boolean_t *is_sh
  * LOCAL_RELPATH is a file in the working copy at WCROOT in DB, and
  * REPOS_RELPATH is the repository path it would be committed to.
  *
- * Merge the changes between OLD_VERSION to NEW_VERSION, whose pristine
- * contents are identified by OLD_CHECKSUM and NEW_CHECKSUM.
- *
  * Use NOTIFY_FUNC and NOTIFY_BATON for notifications.
  * Add any required work items to *WORK_ITEMS, allocated in RESULT_POOL.
  * Use SCRATCH_POOL for temporary allocations. */
@@ -214,10 +201,8 @@ static svn_error_t *
 update_working_file(svn_skel_t **work_items,
                     const char *local_relpath,
                     const char *repos_relpath,
-                    const svn_checksum_t *old_checksum,
-                    const svn_checksum_t *new_checksum,
-                    svn_wc_conflict_version_t *old_version,
-                    svn_wc_conflict_version_t *new_version,
+                    const file_version_t *old_version,
+                    const file_version_t *new_version,
                     svn_wc__db_wcroot_t *wcroot,
                     svn_wc__db_t *db,
                     svn_wc_notify_func2_t notify_func,
@@ -230,10 +215,37 @@ update_working_file(svn_skel_t **work_it
                                                  scratch_pool);
   const char *old_pristine_abspath;
   const char *new_pristine_abspath;
-  svn_skel_t *conflict_skel;
+  svn_skel_t *conflict_skel = NULL;
+  apr_hash_t *actual_props, *new_actual_props;
+  apr_array_header_t *propchanges;
   enum svn_wc_merge_outcome_t merge_outcome;
-  svn_wc_notify_state_t content_state;
-  svn_wc_notify_t *notify;
+  svn_wc_notify_state_t prop_state, content_state;
+
+  /*
+   * Run a 3-way prop merge to update the props, using the pre-update
+   * props as the merge base, the post-update props as the
+   * merge-left version, and the current props of the
+   * moved-here working file as the merge-right version.
+   */
+  SVN_ERR(svn_wc__db_read_props(&actual_props,
+                                db, local_abspath,
+                                scratch_pool, scratch_pool));
+  SVN_ERR(svn_prop_diffs(&propchanges,
+                         new_version->props, old_version->props,
+                         scratch_pool));
+  SVN_ERR(svn_wc__merge_props(&conflict_skel, &prop_state,
+                              NULL, &new_actual_props,
+                              db, local_abspath,
+                              old_version->props, old_version->props,
+                              actual_props, propchanges,
+                              scratch_pool, scratch_pool));
+  /* ### TODO: Make a WQ item in WORK_ITEMS to set new_actual_props ... */
+  /* ### Not a direct DB op like this... */
+  SVN_ERR(svn_wc__db_op_set_props(db, local_abspath,
+                                  new_actual_props,
+                                  svn_wc__has_magic_property(propchanges),
+                                  NULL/*conflict_skel*/, NULL/*work_items*/,
+                                  scratch_pool));
 
   /*
    * Run a 3-way merge to update the file, using the pre-update
@@ -243,11 +255,11 @@ update_working_file(svn_skel_t **work_it
    */
   SVN_ERR(svn_wc__db_pristine_get_path(&old_pristine_abspath,
                                        db, wcroot->abspath,
-                                       old_checksum,
+                                       old_version->checksum,
                                        scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__db_pristine_get_path(&new_pristine_abspath,
                                        db, wcroot->abspath,
-                                       new_checksum,
+                                       new_version->checksum,
                                        scratch_pool, scratch_pool));
   SVN_ERR(svn_wc__internal_merge(work_items, &conflict_skel,
                                  &merge_outcome, db,
@@ -256,36 +268,40 @@ update_working_file(svn_skel_t **work_it
                                  local_abspath,
                                  local_abspath,
                                  NULL, NULL, NULL, /* diff labels */
-                                 NULL, /* actual props */
+                                 actual_props,
                                  FALSE, /* dry-run */
                                  NULL, /* diff3-cmd */
                                  NULL, /* merge options */
-                                 NULL, /* prop_diff */
+                                 propchanges,
                                  NULL, NULL, /* cancel_func + baton */
                                  result_pool, scratch_pool));
 
-  if (merge_outcome == svn_wc_merge_conflict)
+  /* If there are any conflicts to be stored, convert them into work items
+   * too. */
+  if (conflict_skel)
     {
       svn_skel_t *work_item;
       svn_wc_conflict_version_t *original_version;
 
-      if (conflict_skel)
-        {
-          original_version = svn_wc_conflict_version_dup(old_version,
-                                                         scratch_pool);
-          original_version->path_in_repos = repos_relpath;
-          original_version->node_kind = svn_node_file;
-          SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict_skel,
-                                                      original_version,
-                                                      scratch_pool,
-                                                      scratch_pool));
-          SVN_ERR(svn_wc__conflict_create_markers(&work_item, db,
-                                                  local_abspath,
-                                                  conflict_skel,
+      original_version = svn_wc_conflict_version_dup(
+                           old_version->location_and_kind, scratch_pool);
+      original_version->path_in_repos = repos_relpath;
+      original_version->node_kind = svn_node_file;
+      SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict_skel,
+                                                  original_version,
                                                   scratch_pool,
                                                   scratch_pool));
-          *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
-        }
+      /* According to this func's doc string, it is "Currently only used for
+       * property conflicts as text conflict markers are just in-wc files." */
+      SVN_ERR(svn_wc__conflict_create_markers(&work_item, db,
+                                              local_abspath,
+                                              conflict_skel,
+                                              scratch_pool,
+                                              scratch_pool));
+      *work_items = svn_wc__wq_merge(*work_items, work_item, result_pool);
+    }
+  if (merge_outcome == svn_wc_merge_conflict)
+    {
       content_state = svn_wc_notify_state_conflicted;
     }
   else
@@ -302,15 +318,20 @@ update_working_file(svn_skel_t **work_it
         content_state = svn_wc_notify_state_changed;
     }
 
-  notify = svn_wc_create_notify(local_abspath,
-                                svn_wc_notify_update_update,
-                                scratch_pool);
-  notify->kind = svn_node_file;
-  notify->content_state = content_state;
-  notify->prop_state = svn_wc_notify_state_unknown; /* ### TODO */
-  notify->old_revision = old_version->peg_rev;
-  notify->revision = new_version->peg_rev;
-  notify_func(notify_baton, notify, scratch_pool);
+  if (notify_func)
+    {
+      svn_wc_notify_t *notify;
+
+      notify = svn_wc_create_notify(local_abspath,
+                                    svn_wc_notify_update_update,
+                                    scratch_pool);
+      notify->kind = svn_node_file;
+      notify->content_state = content_state;
+      notify->prop_state = prop_state;
+      notify->old_revision = old_version->location_and_kind->peg_rev;
+      notify->revision = new_version->location_and_kind->peg_rev;
+      notify_func(notify_baton, notify, scratch_pool);
+    }
 
   return SVN_NO_ERROR;
 }
@@ -329,26 +350,33 @@ tc_editor_alter_file(void *baton,
                      apr_pool_t *scratch_pool)
 {
   struct tc_editor_baton *b = baton;
-  const svn_checksum_t *move_dst_checksum;
   const char *move_dst_repos_relpath;
   svn_revnum_t move_dst_revision;
   svn_kind_t move_dst_kind;
+  file_version_t old_version, new_version;
 
   /* Get kind, revision, and checksum of the moved-here node. */
   SVN_ERR(svn_wc__db_depth_get_info(NULL, &move_dst_kind, &move_dst_revision,
                                     &move_dst_repos_relpath, NULL, NULL, NULL,
-                                    NULL, NULL, &move_dst_checksum, NULL,
-                                    NULL, NULL,
+                                    NULL, NULL, &old_version.checksum, NULL,
+                                    NULL, &old_version.props,
                                     b->wcroot, dst_relpath,
                                     relpath_depth(b->move_root_dst_relpath),
                                     scratch_pool, scratch_pool));
   SVN_ERR_ASSERT(move_dst_revision == expected_move_dst_revision);
   SVN_ERR_ASSERT(move_dst_kind == svn_kind_file);
 
+  old_version.location_and_kind = b->old_version;
+  new_version.location_and_kind = b->new_version;
+
+  /* If new checksum is null that means no change; similarly props. */
+  new_version.checksum = new_checksum ? new_checksum : old_version.checksum;
+  new_version.props = new_props ? new_props : old_version.props;
+
   /* ### TODO update revision etc. in NODES table */
 
   /* Update file and prop contents if the update has changed them. */
-  if (!svn_checksum_match(new_checksum, move_dst_checksum)
+  if (!svn_checksum_match(new_checksum, old_version.checksum)
       /* ### || props have changed */)
     {
       svn_boolean_t is_shadowed;
@@ -365,8 +393,7 @@ tc_editor_alter_file(void *baton,
       else
         SVN_ERR(update_working_file(b->work_items, dst_relpath,
                                     move_dst_repos_relpath,
-                                    move_dst_checksum, new_checksum,
-                                    b->old_version, b->new_version,
+                                    &old_version, &new_version,
                                     b->wcroot, b->db,
                                     b->notify_func, b->notify_baton,
                                     b->result_pool, scratch_pool));
@@ -447,18 +474,22 @@ tc_editor_complete(void *baton,
                    apr_pool_t *scratch_pool)
 {
   struct tc_editor_baton *b = baton;
-  svn_wc_notify_t *notify;
 
-  notify = svn_wc_create_notify(svn_dirent_join(b->wcroot->abspath,
-                                                b->move_root_dst_relpath,
-                                                scratch_pool),
-                                svn_wc_notify_update_completed,
-                                scratch_pool);
-  notify->kind = svn_node_none;
-  notify->content_state = svn_wc_notify_state_inapplicable;
-  notify->prop_state = svn_wc_notify_state_inapplicable;
-  notify->revision = b->new_version->peg_rev;
-  b->notify_func(b->notify_baton, notify, scratch_pool);
+  if (b->notify_func)
+    {
+      svn_wc_notify_t *notify;
+
+      notify = svn_wc_create_notify(svn_dirent_join(b->wcroot->abspath,
+                                                    b->move_root_dst_relpath,
+                                                    scratch_pool),
+                                    svn_wc_notify_update_completed,
+                                    scratch_pool);
+      notify->kind = svn_node_none;
+      notify->content_state = svn_wc_notify_state_inapplicable;
+      notify->prop_state = svn_wc_notify_state_inapplicable;
+      notify->revision = b->new_version->peg_rev;
+      b->notify_func(b->notify_baton, notify, scratch_pool);
+    }
 
   return SVN_NO_ERROR;
 }
@@ -610,11 +641,12 @@ update_moved_away_file(svn_editor_t *tc_
   svn_kind_t kind;
   svn_stream_t *new_contents;
   const svn_checksum_t *new_checksum;
+  apr_hash_t *new_props;
 
   /* Read post-update contents from the updated moved-away file and tell
    * the editor to merge them into the moved-here file. */
   SVN_ERR(svn_wc__db_read_pristine_info(NULL, &kind, NULL, NULL, NULL, NULL,
-                                        &new_checksum, NULL, NULL, NULL,
+                                        &new_checksum, NULL, NULL, &new_props,
                                         db, svn_dirent_join(wcroot->abspath,
                                                             src_relpath,
                                                             scratch_pool),
@@ -632,8 +664,7 @@ update_moved_away_file(svn_editor_t *tc_
   else
     SVN_ERR(svn_editor_alter_file(tc_editor, dst_relpath,
                                   move_root_dst_revision,
-                                  NULL, /* ### TODO props */
-                                  new_checksum,
+                                  new_props, new_checksum,
                                   new_contents));
 
   SVN_ERR(svn_stream_close(new_contents));
@@ -809,9 +840,6 @@ replace_moved_layer(const char *src_relp
     }
   SVN_ERR(svn_sqlite__reset(stmt));
 
-  /* TODO: extend/retract any base-deleted layers to account for
-     added/removed nodes in the replaced layer. */
-
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h Sat Dec  8 20:30:52 2012
@@ -56,7 +56,7 @@ extern "C" {
 typedef enum dav_svn__bulk_upd_conf {
     CONF_BULKUPD_ON,
     CONF_BULKUPD_OFF,
-    CONF_BULKUPD_FORCE
+    CONF_BULKUPD_PREFER
 } dav_svn__bulk_upd_conf;
 
 /* dav_svn_repos

Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c Sat Dec  8 20:30:52 2012
@@ -369,9 +369,9 @@ SVNAllowBulkUpdates_cmd(cmd_parms *cmd, 
     {
       conf->bulk_updates = CONF_BULKUPD_OFF;
     }
-  else if (apr_strnatcasecmp("force", arg1) == 0)
+  else if (apr_strnatcasecmp("prefer", arg1) == 0)
     {
-      conf->bulk_updates = CONF_BULKUPD_FORCE;
+      conf->bulk_updates = CONF_BULKUPD_PREFER;
     }
   else
     {
@@ -1160,8 +1160,8 @@ static const command_rec cmds[] =
                 ACCESS_CONF|RSRC_CONF,
                 "enables support for bulk update-style requests (On, default), "
                 "as opposed to only skeletal reports that require additional "
-                "per-file downloads (Off). Use Force to always use bulk update "
-                "responses, regardless of what the client requested."),
+                "per-file downloads (Off). Use Prefer to tell the svn client "
+                "to always use bulk update requests, if supported."),
 
   /* per directory/location */
   AP_INIT_FLAG("SVNAdvertiseV2Protocol", SVNAdvertiseV2Protocol_cmd, NULL,

Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c Sat Dec  8 20:30:52 2012
@@ -1016,17 +1016,15 @@ dav_svn__update_report(const dav_resourc
                                     SVN_DAV_ERROR_TAG);
     }
 
-  /* SVNAllowBulkUpdates On: server configuration permits bulk updates (a report
-     with props and textdeltas inline, rather than placeholder tags that tell
-     the client to do further fetches), look to see if client requested as
-     much.
-   
-     SVNAllowBulkUpdates Force: always use bulk updates, no matter what the
-     client requested.
-   
+  /* SVNAllowBulkUpdates On/Prefer: server configuration permits bulk updates
+     (a report with props and textdeltas inline, rather than placeholder tags
+     that tell the client to do further fetches), look to see if client
+     requested as much.
+      
      SVNAllowBulkUpdates Off: no bulk updates allowed, force skelta mode.
    */
-  if (repos->bulk_updates == CONF_BULKUPD_ON)
+  if (repos->bulk_updates == CONF_BULKUPD_ON ||
+      repos->bulk_updates == CONF_BULKUPD_PREFER)
     {
       apr_xml_attr *this_attr;
 
@@ -1041,11 +1039,6 @@ dav_svn__update_report(const dav_resourc
             }
         }
     }
-  else if (repos->bulk_updates == CONF_BULKUPD_FORCE)
-    {
-      uc.send_all = TRUE;
-      uc.include_props = TRUE;
-    }
 
   /* Ask the repository about its youngest revision (which we'll need
      for some input validation later). */

Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/version.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/version.c Sat Dec  8 20:30:52 2012
@@ -247,7 +247,8 @@ get_option(const dav_resource *resource,
     {
       int i;
       svn_version_t *master_version = dav_svn__get_master_version(r);
-
+      dav_svn__bulk_upd_conf bulk_upd_conf = dav_svn__get_bulk_updates_flag(r);
+      
       /* The list of Subversion's custom POSTs and which versions of
          Subversion support them.  We need this latter information
          when acting as a WebDAV slave -- we don't want to claim
@@ -286,6 +287,9 @@ get_option(const dav_resource *resource,
       apr_table_set(r->headers_out, SVN_DAV_VTXN_STUB_HEADER,
                     apr_pstrcat(resource->pool, repos_root_uri, "/",
                                 dav_svn__get_vtxn_stub(r), (char *)NULL));
+      apr_table_set(r->headers_out, SVN_DAV_ALLOW_BULK_UPDATES,
+                    bulk_upd_conf == CONF_BULKUPD_ON ? "On" :
+                      bulk_upd_conf == CONF_BULKUPD_OFF ? "Off" : "Prefer");
 
       /* Report the supported POST types. */
       for (i = 0; i < sizeof(posts_versions)/sizeof(posts_versions[0]); ++i)

Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py Sat Dec  8 20:30:52 2012
@@ -804,21 +804,12 @@ def subtree_to_and_fro(sbox):
   # not considered a merge.  So the changes which exist on A/D and were
   # merged to A_COPY/D, are merged *back* to A, resulting in a conflict:
   #
-  #   C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\
-  #     working_copies\merge_automatic_tests-18>svn merge ^^/A_COPY A
-  #   DBG: merge.c:11461: base on source: file:///C:/SVN/src-trunk/Debug/
-  #     subversion/tests/cmdline/svn-test-work/repositories/
-  #     merge_automatic_tests-18/A@1
-  #   DBG: merge.c:11462: base on target: file:///C:/SVN/src-trunk/Debug/
-  #     subversion/tests/cmdline/svn-test-work/repositories/
-  #     merge_automatic_tests-18/A@1
-  #   DBG: merge.c:11567: yca   file:///C:/SVN/src-trunk/Debug/subversion/
-  #     tests/cmdline/svn-test-work/repositories/merge_automatic_tests-18/A@1
-  #   DBG: merge.c:11568: base  file:///C:/SVN/src-trunk/Debug/subversion/
-  #     tests/cmdline/svn-test-work/repositories/merge_automatic_tests-18/A@1
-  #   DBG: merge.c:11571: right file:///C:/SVN/src-trunk/Debug/subversion/
-  #     tests/cmdline/svn-test-work/repositories/merge_automatic_tests-18/
-  #     A_COPY@8
+  #   C:\...\working_copies\merge_automatic_tests-18>svn merge ^^/A_COPY A
+  #   DBG: merge.c:11461: base on source: ^/A@1
+  #   DBG: merge.c:11462: base on target: ^/A@1
+  #   DBG: merge.c:11567: yca   ^/A@1
+  #   DBG: merge.c:11568: base  ^/A@1
+  #   DBG: merge.c:11571: right ^/A_COPY@8
   #   Conflict discovered in file 'A\D\H\psi'.
   #   Select: (p) postpone, (df) diff-full, (e) edit,
   #           (mc) mine-conflict, (tc) theirs-conflict,

Modified: subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/op-depth-test.c Sat Dec  8 20:30:52 2012
@@ -35,6 +35,7 @@
 #include "svn_wc.h"
 #include "svn_client.h"
 #include "svn_hash.h"
+#include "svn_sorts.h"
 
 #include "utils.h"
 
@@ -98,19 +99,49 @@ typedef struct nodes_row_t {
     svn_boolean_t file_external;
     const char *moved_to;
     svn_boolean_t moved_here;
+    const char *props;  /* comma-separated list of prop names */
 } nodes_row_t;
 
 /* Macro for filling in the REPO_* fields of a non-base NODES_ROW_T
  * that has no copy-from info. */
 #define NO_COPY_FROM SVN_INVALID_REVNUM, NULL, FALSE
 #define MOVED_HERE FALSE, NULL, TRUE
+#define NOT_MOVED  FALSE, NULL, FALSE
+
+/* Return a comma-separated list of the prop names in PROPS, in lexically
+ * ascending order, or NULL if PROPS is empty or NULL.  (Here, we don't
+ * care about the difference between 'has no props' and 'can't have props',
+ * and we choose to represent both of those as NULL.) */
+static const char *
+props_hash_to_text(apr_hash_t *props, apr_pool_t *pool)
+{
+  apr_array_header_t *props_sorted;
+  svn_stringbuf_t *str;
+  int i;
+
+  if (! props)
+    return NULL;
+
+  str = svn_stringbuf_create_empty(pool);
+  props_sorted = svn_sort__hash(props, svn_sort_compare_items_lexically, pool);
+  for (i = 0; i < props_sorted->nelts; i++)
+    {
+      const svn_sort__item_t *item
+        = &APR_ARRAY_IDX(props_sorted, i, svn_sort__item_t);
+
+      if (str->len)
+        svn_stringbuf_appendbyte(str, ',');
+      svn_stringbuf_appendcstr(str, item->key);
+    }
+  return str->len ? str->data : NULL;
+}
 
 /* Return a human-readable string representing ROW. */
 static const char *
 print_row(const nodes_row_t *row,
           apr_pool_t *result_pool)
 {
-  const char *file_external_str, *moved_here_str, *moved_to_str;
+  const char *file_external_str, *moved_here_str, *moved_to_str, *props;
 
   if (row == NULL)
     return "(null)";
@@ -130,18 +161,23 @@ print_row(const nodes_row_t *row,
   else
     file_external_str = "";
 
+  if (row->props)
+    props = apr_psprintf(result_pool, ", p=(%s)", row->props);
+  else
+    props = "";
+
   if (row->repo_revnum == SVN_INVALID_REVNUM)
-    return apr_psprintf(result_pool, "%d, %s, %s%s%s%s",
+    return apr_psprintf(result_pool, "%d, %s, %s%s%s%s%s",
                         row->op_depth, row->local_relpath, row->presence,
                         moved_here_str, moved_to_str,
-                        file_external_str);
+                        file_external_str, props);
   else
-    return apr_psprintf(result_pool, "%d, %s, %s, %s ^/%s@%d%s%s%s",
+    return apr_psprintf(result_pool, "%d, %s, %s, %s ^/%s@%d%s%s%s%s",
                         row->op_depth, row->local_relpath, row->presence,
                         row->op_depth == 0 ? "base" : "copyfrom",
                         row->repo_relpath, (int)row->repo_revnum,
                         moved_here_str, moved_to_str,
-                        file_external_str);
+                        file_external_str, props);
 }
 
 /* A baton to pass through svn_hash_diff() to compare_nodes_rows(). */
@@ -188,7 +224,9 @@ compare_nodes_rows(const void *key, apr_
            || (expected->moved_to && !found->moved_to)
            || (!expected->moved_to && found->moved_to)
            || (expected->moved_to
-               && strcmp(expected->moved_to, found->moved_to)))
+               && strcmp(expected->moved_to, found->moved_to))
+           || (expected->props != NULL
+               && strcmp_null(expected->props, found->props) != 0))
     {
       b->errors = svn_error_createf(
                     SVN_ERR_TEST_FAILED, b->errors,
@@ -218,7 +256,8 @@ check_db_rows(svn_test__sandbox_t *b,
   svn_sqlite__stmt_t *stmt;
   static const char *const statements[] = {
     "SELECT op_depth, nodes.presence, nodes.local_relpath, revision,"
-    "       repos_path, file_external, def_local_relpath, moved_to, moved_here"
+    "       repos_path, file_external, def_local_relpath, moved_to, moved_here,"
+    "       properties"
     " FROM nodes "
     " LEFT OUTER JOIN externals"
     "             ON nodes.local_relpath = externals.local_relpath"
@@ -248,6 +287,7 @@ check_db_rows(svn_test__sandbox_t *b,
     {
       const char *key;
       nodes_row_t *row = apr_palloc(b->pool, sizeof(*row));
+      apr_hash_t *props_hash;
 
       row->op_depth = svn_sqlite__column_int(stmt, 0);
       row->presence = svn_sqlite__column_text(stmt, 1, b->pool);
@@ -261,6 +301,9 @@ check_db_rows(svn_test__sandbox_t *b,
                               "incomplete {%s}", print_row(row, b->pool));
       row->moved_to = svn_sqlite__column_text(stmt, 7, b->pool);
       row->moved_here = svn_sqlite__column_boolean(stmt, 8);
+      SVN_ERR(svn_sqlite__column_properties(&props_hash, stmt, 9,
+                                            b->pool, b->pool));
+      row->props = props_hash_to_text(props_hash, b->pool);
 
       key = apr_psprintf(b->pool, "%d %s", row->op_depth, row->local_relpath);
       apr_hash_set(found_hash, key, APR_HASH_KEY_STRING, row);
@@ -4284,6 +4327,8 @@ move_added(const svn_test_opts_t *opts, 
   return SVN_NO_ERROR;
 }
 
+/* Test the result of 'update' when the incoming changes are inside a
+ * directory that is locally moved. */
 static svn_error_t *
 move_update(const svn_test_opts_t *opts, apr_pool_t *pool)
 {
@@ -4291,6 +4336,7 @@ move_update(const svn_test_opts_t *opts,
 
   SVN_ERR(svn_test__sandbox_create(&b, "move_update", opts, pool));
 
+  /* r1: Create files 'f', 'h' */
   SVN_ERR(sbox_wc_mkdir(&b, "A"));
   SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
   sbox_file_write(&b, "A/B/f", "r1 content\n");
@@ -4298,12 +4344,27 @@ move_update(const svn_test_opts_t *opts,
   SVN_ERR(sbox_wc_add(&b, "A/B/f"));
   SVN_ERR(sbox_wc_add(&b, "A/B/h"));
   SVN_ERR(sbox_wc_commit(&b, ""));
+
+  /* r2: Modify 'f' */
   sbox_file_write(&b, "A/B/f", "r1 content\nr2 content\n");
   SVN_ERR(sbox_wc_commit(&b, ""));
+
+  /* r3: Delete 'h', add 'g' */
   sbox_file_write(&b, "A/B/g", "r3 content\n");
   SVN_ERR(sbox_wc_add(&b, "A/B/g"));
   SVN_ERR(sbox_wc_delete(&b, "A/B/h"));
   SVN_ERR(sbox_wc_commit(&b, ""));
+
+  /* r4: Add a new subtree 'X' */
+  SVN_ERR(sbox_wc_mkdir(&b, "X"));
+  sbox_file_write(&b, "X/f", "r4 content\n");
+  sbox_file_write(&b, "X/g", "r4 content\n");
+  sbox_file_write(&b, "X/h", "r4 content\n");
+  SVN_ERR(sbox_wc_add(&b, "X/f"));
+  SVN_ERR(sbox_wc_add(&b, "X/g"));
+  SVN_ERR(sbox_wc_add(&b, "X/h"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
   SVN_ERR(sbox_wc_update(&b, "", 1));
 
   /* A is single-revision so A2 is a single-revision copy */
@@ -4351,7 +4412,7 @@ move_update(const svn_test_opts_t *opts,
   }
 
   /* Resolve should update the move. */
-  SVN_ERR(sbox_wc_resolve(&b, "A"));
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_wc_conflict_choose_mine_conflict));
   {
     nodes_row_t nodes[] = {
       {0, "",         "normal",       2, ""},
@@ -4394,7 +4455,7 @@ move_update(const svn_test_opts_t *opts,
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
-  SVN_ERR(sbox_wc_resolve(&b, "A"));
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_wc_conflict_choose_mine_conflict));
   {
     nodes_row_t nodes[] = {
       {0, "",         "normal",       3, ""},
@@ -4440,7 +4501,7 @@ move_update(const svn_test_opts_t *opts,
   }
 
   SVN_ERR(sbox_wc_update(&b, "", 2));
-  SVN_ERR(sbox_wc_resolve(&b, "A"));
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_wc_conflict_choose_mine_conflict));
   {
     nodes_row_t nodes[] = {
       {0, "",         "normal",       2, ""},
@@ -4464,6 +4525,66 @@ move_update(const svn_test_opts_t *opts,
     SVN_ERR(check_db_rows(&b, "", nodes));
   }
 
+  SVN_ERR(sbox_wc_update(&b, "X", 4));
+  SVN_ERR(sbox_wc_copy(&b, "X", "A2/B"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       2, ""},
+      {0, "A",        "normal",       2, "A"},
+      {0, "A/B",      "normal",       2, "A/B"},
+      {0, "A/B/f",    "normal",       2, "A/B/f"},
+      {0, "A/B/h",    "normal",       2, "A/B/h"},
+      {0, "X",        "normal",       4, "X"},
+      {0, "X/f",      "normal",       4, "X/f"},
+      {0, "X/g",      "normal",       4, "X/g"},
+      {0, "X/h",      "normal",       4, "X/h"},
+      {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A/B/f",    "base-deleted", NO_COPY_FROM},
+      {1, "A/B/h",    "base-deleted", NO_COPY_FROM},
+      {1, "A2",       "normal",       2, "A", MOVED_HERE},
+      {1, "A2/B",     "normal",       2, "A/B", MOVED_HERE},
+      {1, "A2/B/f",   "normal",       2, "A/B/f", MOVED_HERE},
+      {1, "A2/B/h",   "normal",       2, "A/B/h", MOVED_HERE},
+      {2, "A2/B",     "normal",       4, "X"},
+      {2, "A2/B/f",   "normal",       4, "X/f"},
+      {2, "A2/B/g",   "normal",       4, "X/g"},
+      {2, "A2/B/h",   "normal",       4, "X/h"},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  SVN_ERR(sbox_wc_update(&b, "", 4));
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       4, ""},
+      {0, "A",        "normal",       4, "A"},
+      {0, "A/B",      "normal",       4, "A/B"},
+      {0, "A/B/f",    "normal",       4, "A/B/f"},
+      {0, "A/B/g",    "normal",       4, "A/B/g"},
+      {0, "X",        "normal",       4, "X"},
+      {0, "X/f",      "normal",       4, "X/f"},
+      {0, "X/g",      "normal",       4, "X/g"},
+      {0, "X/h",      "normal",       4, "X/h"},
+      {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A/B/f",    "base-deleted", NO_COPY_FROM},
+      {1, "A/B/g",    "base-deleted", NO_COPY_FROM},
+      {1, "A2",       "normal",       4, "A", MOVED_HERE},
+      {1, "A2/B",     "normal",       4, "A/B", MOVED_HERE},
+      {1, "A2/B/f",   "normal",       4, "A/B/f", MOVED_HERE},
+      {1, "A2/B/g",   "normal",       4, "A/B/g", MOVED_HERE},
+      {2, "A2/B",     "normal",       4, "X"},
+      {2, "A2/B/f",   "normal",       4, "X/f"},
+      {2, "A2/B/g",   "normal",       4, "X/g"},
+      {2, "A2/B/h",   "normal",       4, "X/h"},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
   return SVN_NO_ERROR;
 }
 
@@ -4866,6 +4987,125 @@ mixed_rev_move(const svn_test_opts_t *op
   return SVN_NO_ERROR;
 }
 
+/* Test the result of 'update' when the incoming changes are inside a
+ * directory that is locally moved. */
+static svn_error_t *
+update_prop_mod_into_moved(const svn_test_opts_t *opts, apr_pool_t *pool)
+{
+  svn_test__sandbox_t b;
+
+  SVN_ERR(svn_test__sandbox_create(&b, "update_prop_mod_into_moved", opts, pool));
+
+  /* r1: Create files 'f', 'h' */
+  SVN_ERR(sbox_wc_mkdir(&b, "A"));
+  SVN_ERR(sbox_wc_mkdir(&b, "A/B"));
+  sbox_file_write(&b, "A/B/f", "r1 content\n");
+  sbox_file_write(&b, "A/B/h", "r1 content\n");
+  SVN_ERR(sbox_wc_add(&b, "A/B/f"));
+  SVN_ERR(sbox_wc_add(&b, "A/B/h"));
+  SVN_ERR(sbox_wc_propset(&b, "pd", "f1", "A/B/f"));
+  SVN_ERR(sbox_wc_propset(&b, "pn", "f1", "A/B/f"));
+  SVN_ERR(sbox_wc_propset(&b, "pm", "f1", "A/B/f"));
+  SVN_ERR(sbox_wc_propset(&b, "p", "h1", "A/B/h"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
+  /* r2: Modify 'f'. Delete prop 'pd', modify prop 'pm', add prop 'pa',
+   * leave prop 'pn' unchanged. */
+  sbox_file_write(&b, "A/B/f", "r1 content\nr2 content\n");
+  SVN_ERR(sbox_wc_propset(&b, "pd", NULL, "A/B/f"));
+  SVN_ERR(sbox_wc_propset(&b, "pm", "f2", "A/B/f"));
+  SVN_ERR(sbox_wc_propset(&b, "pa", "f2", "A/B/f"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
+  /* r3: Delete 'h', add 'g' */
+  sbox_file_write(&b, "A/B/g", "r3 content\n");
+  SVN_ERR(sbox_wc_add(&b, "A/B/g"));
+  SVN_ERR(sbox_wc_propset(&b, "p", "g3", "A/B/g"));
+  SVN_ERR(sbox_wc_delete(&b, "A/B/h"));
+  SVN_ERR(sbox_wc_commit(&b, ""));
+
+  SVN_ERR(sbox_wc_update(&b, "", 1));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       1, "A"},
+      {0, "A/B",      "normal",       1, "A/B"},
+      {0, "A/B/f",    "normal",       1, "A/B/f", NOT_MOVED,  "pd,pm,pn"},
+      {0, "A/B/h",    "normal",       1, "A/B/h", NOT_MOVED,  "p"},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* A is single-revision so A2 is a single-revision copy */
+  SVN_ERR(sbox_wc_move(&b, "A", "A2"));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       1, ""},
+      {0, "A",        "normal",       1, "A"},
+      {0, "A/B",      "normal",       1, "A/B"},
+      {0, "A/B/f",    "normal",       1, "A/B/f", NOT_MOVED,  "pd,pm,pn"},
+      {0, "A/B/h",    "normal",       1, "A/B/h", NOT_MOVED,  "p"},
+      {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A/B/f",    "base-deleted", NO_COPY_FROM},
+      {1, "A/B/h",    "base-deleted", NO_COPY_FROM},
+      {1, "A2",       "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B",     "normal",       1, "A/B", MOVED_HERE},
+      {1, "A2/B/f",   "normal",       1, "A/B/f", MOVED_HERE, "pd,pm,pn"},
+      {1, "A2/B/h",   "normal",       1, "A/B/h", MOVED_HERE, "p"},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Update causes a tree-conflict on A due to incoming text-change. */
+  SVN_ERR(sbox_wc_update(&b, "", 2));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       2, ""},
+      {0, "A",        "normal",       2, "A"},
+      {0, "A/B",      "normal",       2, "A/B"},
+      {0, "A/B/f",    "normal",       2, "A/B/f", NOT_MOVED,  "pa,pm,pn"},
+      {0, "A/B/h",    "normal",       2, "A/B/h", NOT_MOVED,  "p"},
+      {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A/B/f",    "base-deleted", NO_COPY_FROM},
+      {1, "A/B/h",    "base-deleted", NO_COPY_FROM},
+      {1, "A2",       "normal",       1, "A", MOVED_HERE},
+      {1, "A2/B",     "normal",       1, "A/B", MOVED_HERE},
+      {1, "A2/B/f",   "normal",       1, "A/B/f", MOVED_HERE, "pd,pm,pn"},
+      {1, "A2/B/h",   "normal",       1, "A/B/h", MOVED_HERE, "p"},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  /* Resolve should update the move. */
+  SVN_ERR(sbox_wc_resolve(&b, "A", svn_wc_conflict_choose_mine_conflict));
+  {
+    nodes_row_t nodes[] = {
+      {0, "",         "normal",       2, ""},
+      {0, "A",        "normal",       2, "A"},
+      {0, "A/B",      "normal",       2, "A/B"},
+      {0, "A/B/f",    "normal",       2, "A/B/f", NOT_MOVED,  "pa,pm,pn"},
+      {0, "A/B/h",    "normal",       2, "A/B/h", NOT_MOVED,  "p"},
+      {1, "A",        "base-deleted", NO_COPY_FROM, "A2"},
+      {1, "A/B",      "base-deleted", NO_COPY_FROM},
+      {1, "A/B/f",    "base-deleted", NO_COPY_FROM},
+      {1, "A/B/h",    "base-deleted", NO_COPY_FROM},
+      {1, "A2",       "normal",       2, "A", MOVED_HERE},
+      {1, "A2/B",     "normal",       2, "A/B", MOVED_HERE},
+      {1, "A2/B/f",   "normal",       2, "A/B/f", MOVED_HERE, "pa,pm,pn"},
+      {1, "A2/B/h",   "normal",       2, "A/B/h", MOVED_HERE, "p"},
+      {0}
+    };
+    SVN_ERR(check_db_rows(&b, "", nodes));
+  }
+
+  return SVN_NO_ERROR;
+}
+
 
 /* ---------------------------------------------------------------------- */
 /* The list of test functions */
@@ -4963,5 +5203,7 @@ struct svn_test_descriptor_t test_funcs[
                        "follow_moved_to"),
     SVN_TEST_OPTS_PASS(mixed_rev_move,
                        "mixed_rev_move"),
+    SVN_TEST_OPTS_PASS(update_prop_mod_into_moved,
+                       "update_prop_mod_into_moved"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.c?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.c Sat Dec  8 20:30:52 2012
@@ -321,22 +321,24 @@ sbox_wc_update(svn_test__sandbox_t *b, c
 svn_error_t *
 sbox_wc_resolved(svn_test__sandbox_t *b, const char *path)
 {
-  svn_client_ctx_t *ctx;
-
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
-  return svn_client_resolve(sbox_wc_path(b, path), svn_depth_infinity,
-                            svn_wc_conflict_choose_merged, ctx, b->pool);
+  return sbox_wc_resolve(b, path, svn_wc_conflict_choose_merged);
 }
 
 svn_error_t *
-sbox_wc_resolve(svn_test__sandbox_t *b, const char *path)
+sbox_wc_resolve(svn_test__sandbox_t *b, const char *path,
+                svn_wc_conflict_choice_t conflict_choice)
 {
-  svn_client_ctx_t *ctx;
-
-  SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
-  return svn_client_resolve(sbox_wc_path(b, path), svn_depth_infinity,
-                            svn_wc_conflict_choose_mine_conflict,
-                            ctx, b->pool);
+  SVN_ERR(svn_wc__resolve_conflicts(b->wc_ctx, sbox_wc_path(b, path),
+                                    svn_depth_infinity,
+                                    TRUE /* resolve_text */,
+                                    "" /* resolve_prop (ALL props) */,
+                                    TRUE /* resolve_tree */,
+                                    conflict_choice,
+                                    NULL, NULL, /* conflict func */
+                                    NULL, NULL, /* cancellation */
+                                    NULL, NULL, /* notification */
+                                    b->pool));
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *
@@ -361,12 +363,13 @@ sbox_wc_propset(svn_test__sandbox_t *b,
   svn_client_ctx_t *ctx;
   apr_array_header_t *paths = apr_array_make(b->pool, 1,
                                              sizeof(const char *));
+  svn_string_t *pval = value ? svn_string_create(value, b->pool) : NULL;
 
   SVN_ERR(svn_client_create_context2(&ctx, NULL, b->pool));
   APR_ARRAY_PUSH(paths, const char *) = sbox_wc_path(b, path);
-  return svn_client_propset_local(name, svn_string_create(value, b->pool),
-                                  paths, svn_depth_empty, TRUE, NULL, ctx,
-                                  b->pool);
+  return svn_client_propset_local(name, pval, paths, svn_depth_empty,
+                                  TRUE /* skip_checks */,
+                                  NULL, ctx, b->pool);
 }
 
 svn_error_t *

Modified: subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.h?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.h (original)
+++ subversion/branches/in-repo-authz/subversion/tests/libsvn_wc/utils.h Sat Dec  8 20:30:52 2012
@@ -130,13 +130,14 @@ sbox_wc_resolved(svn_test__sandbox_t *b,
 
 /* */
 svn_error_t *
-sbox_wc_resolve(svn_test__sandbox_t *b, const char *path);
+sbox_wc_resolve(svn_test__sandbox_t *b, const char *path,
+                svn_wc_conflict_choice_t conflict_choice);
 
 /* */
 svn_error_t *
 sbox_wc_move(svn_test__sandbox_t *b, const char *src, const char *dst);
 
-/* */
+/* Set property NAME to VALUE on PATH. If VALUE=NULL, delete the property. */
 svn_error_t *
 sbox_wc_propset(svn_test__sandbox_t *b,
            const char *name,

Modified: subversion/branches/in-repo-authz/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/tools/dist/backport.pl?rev=1418751&r1=1418750&r2=1418751&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/tools/dist/backport.pl (original)
+++ subversion/branches/in-repo-authz/tools/dist/backport.pl Sat Dec  8 20:30:52 2012
@@ -233,6 +233,9 @@ sub main {
   die "A vim with the +ex_extra feature is required"
       if `${VIM} --version` !~ /[+]ex_extra/;
 
+  # ### TODO: need to run 'revert' here
+  # ### TODO: both here and in merge(), unlink files that previous merges added
+  die "Local mods to STATUS file $STATUS" if `$SVN status -q $STATUS`;
   @ARGV = $STATUS;
 
   # Skip most of the file