
* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_op_add_symlink): 

* subversion/libsvn_wc/wc_db_update_move.c
  (check_shadowed_node): 
  (update_working_file): 
  (tc_editor_alter_file): 
  (update_moved_away_file): 

--This line, and those below, will be ignored--

Index: subversion/libsvn_wc/wc_db.h
===================================================================
--- subversion/libsvn_wc/wc_db.h	(revision 1418174)
+++ subversion/libsvn_wc/wc_db.h	(working copy)
@@ -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.
Index: subversion/libsvn_wc/wc_db_update_move.c
===================================================================
--- subversion/libsvn_wc/wc_db_update_move.c	(revision 1418174)
+++ subversion/libsvn_wc/wc_db_update_move.c	(working copy)
@@ -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"
@@ -194,6 +196,14 @@ check_shadowed_node(svn_boolean_t *is_sh
   return SVN_NO_ERROR;
 }
 
+/* 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;
+
 /* Update text and prop contents of the working file at LOCAL_RELPATH.
  *
  * The term 'old' refers to the pre-update state, which is the state of
@@ -204,8 +214,8 @@ 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.
+ * Merge the difference between OLD_VERSION and NEW_VERSION into
+ * ### .
  *
  * Use NOTIFY_FUNC and NOTIFY_BATON for notifications.
  * Add any required work items to *WORK_ITEMS, allocated in RESULT_POOL.
@@ -214,10 +224,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,
@@ -228,14 +236,71 @@ update_working_file(svn_skel_t **work_it
   const char *local_abspath = svn_dirent_join(wcroot->abspath,
                                                  local_relpath,
                                                  scratch_pool);
+  apr_array_header_t *propchanges;
   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;
   enum svn_wc_merge_outcome_t merge_outcome;
-  svn_wc_notify_state_t content_state;
+  svn_wc_notify_state_t prop_state, content_state;
   svn_wc_notify_t *notify;
 
   /*
+   * 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, new_version->props,
+                              actual_props, propchanges,
+                              scratch_pool, scratch_pool));
+  /* ### TODO: Make a WQ item to set new_actual_props ... */
+
+  if (prop_state == svn_wc_notify_state_conflicted)
+    {
+      if (conflict_skel)
+        {
+          svn_skel_t *work_item;
+          svn_wc_conflict_version_t *original_version;
+
+          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));
+          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);
+        }
+    }
+  else
+    {
+      svn_boolean_t is_locally_modified = (propchanges->nelts > 0);
+
+      if (is_locally_modified)
+        prop_state = svn_wc_notify_state_merged;
+      else
+        prop_state = svn_wc_notify_state_changed;
+    }
+
+  /*
    * Run a 3-way merge to update the file, using the pre-update
    * pristine text as the merge base, the post-update pristine
    * text as the merge-left version, and the current content of the
@@ -243,11 +308,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,29 +321,31 @@ 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)
     {
-      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);
+          svn_skel_t *work_item;
+          svn_wc_conflict_version_t *original_version;
+
+          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));
+          /* ### Huh? This func's doc says "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,
@@ -302,14 +369,25 @@ update_working_file(svn_skel_t **work_it
         content_state = svn_wc_notify_state_changed;
     }
 
+  /* ### Is this how we should set the new props, or should it be via
+   * WORK_ITEMS? */
+  if (new_actual_props)
+    {
+      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));
+    }
+
   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->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 +407,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 props is null that means no change; similarly checksum. */
+  new_version.props = new_props ? new_props : old_version.props;
+  new_version.checksum = new_checksum ? new_checksum : old_version.checksum;
+
   /* ### 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 +450,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));
@@ -610,11 +694,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 +717,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));
