Author: rhuijben
Date: Thu Jun 17 21:40:20 2010
New Revision: 955755

URL: http://svn.apache.org/viewvc?rev=955755&view=rev
Log:
Reorder fields in svn_wc_status3_t and remove some values
that aren't needed for users of libsvn_wc and can be just as
cheaply obtained from libsvn_client. Remove pristine_* fields
in preparation for introducing a node_status.

* subversion/include/svn_wc.h
  (svn_wc_status3_t): Reorder fields and remove file_external and locked
    booleans. Consolidate locked values to a svn_lock_t

* subversion/libsvn_client/status.c
  (create_client_status): Update arguments to take wc_ctx.
  (tweak_status): Update caller.
  (create_client_status): Update user.

* subversion/libsvn_wc/status.c
  (dir_baton, file_baton):
    Rename fields to match their svn_wc_status3_t cousins.
  (assemble_status): Remove unused argument. Optimize repos_relpath
    calculations and remove file_externals and lock obtain code.
  (assemble_unversioned): Update user.
  (send_status_structure, handle_dir_entry,
   get_dir_status): Update caller.
  (tweak_statushash): Update field references.
  (make_file_baton): Update struct usages.
  (svn_wc__is_sendable_status): Remove checks for locked+file external.
  (change_dir_prop, close_directory,
   change_file_prop): Update struct usages.
  (internal_status): Update caller.
  (svn_wc_dup_status3): Duplicate as svn_lock_t.

* subversion/libsvn_wc/util.c
  (svn_wc__status2_from_3): Obtain lock and file_external information, and
    set the pristine status appropriately in preparation for node_status
    introduction.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_client/status.c
    subversion/trunk/subversion/libsvn_wc/status.c
    subversion/trunk/subversion/libsvn_wc/util.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=955755&r1=955754&r2=955755&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Thu Jun 17 21:40:20 2010
@@ -3537,33 +3537,31 @@ typedef struct svn_wc_status3_t
    * FALSE. */
   svn_boolean_t versioned;
 
+  /** Set to TRUE if the item is the victim of a conflict. */
+  svn_boolean_t conflicted;
+
   /** The status of the entry itself, including its text if it is a file. */
   enum svn_wc_status_kind text_status;
 
   /** The status of the entry's properties. */
   enum svn_wc_status_kind prop_status;
 
-  /** a directory can be 'locked' if a working copy update was interrupted. */
-  svn_boolean_t locked;
-
   /** a file or directory can be 'copied' if it's scheduled for
    * addition-with-history (or part of a subtree that is scheduled as such.).
    */
   svn_boolean_t copied;
 
-  /** a file or directory can be 'switched' if the switch command has been
-   * used.  If this is TRUE, then file_external will be FALSE.
-   */
-  svn_boolean_t switched;
+  /** Base revision. */
+  svn_revnum_t revision;
 
-  /** The entry's text status in the repository. */
-  enum svn_wc_status_kind repos_text_status;
+  /** Last revision this was changed */
+  svn_revnum_t changed_rev;
 
-  /** The entry's property status in the repository. */
-  enum svn_wc_status_kind repos_prop_status;
+  /** Date of last commit. */
+  apr_time_t changed_date;
 
-  /** The entry's lock in the repository, if any. */
-  const svn_lock_t *repos_lock;
+  /** Last commit author of this item */
+  const char *changed_author;
 
   /** The URL of the repository */
   const char *repos_root_url;
@@ -3574,6 +3572,18 @@ typedef struct svn_wc_status3_t
    */
   const char *repos_relpath;
 
+    /** a file or directory can be 'switched' if the switch command has been
+   * used.  If this is TRUE, then file_external will be FALSE.
+   */
+  svn_boolean_t switched;
+
+  /** The locally present lock. (Values of path, token, owner, comment and
+   * are available if a lock is present) */
+  const svn_lock_t *lock;
+
+  /** Which changelist this item is part of, or NULL if not part of any. */
+  const char *changelist;
+
   /**
    * @defgroup svn_wc_status_ood WC out-of-date info from the repository
    * @{
@@ -3585,83 +3595,35 @@ typedef struct svn_wc_status3_t
    * below.
    */
 
-  /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM
-   * if not out of date.
-   */
-  svn_revnum_t ood_last_cmt_rev;
-
-  /** Set to the most recent commit date, or @c 0 if not out of date.
-   */
-  apr_time_t ood_last_cmt_date;
-
   /** Set to the node kind of the youngest commit, or #svn_node_none
-   * if not out of date.
-   */
+   * if not out of date. */
   svn_node_kind_t ood_kind;
 
-  /** Set to the user name of the youngest commit, or @c NULL if not
-   * out of date or non-existent.  Because a non-existent @c
-   * svn:author property has the same behavior as an out-of-date
-   * working copy, examine @c ood_last_cmt_rev to determine whether
-   * the working copy is out of date.
-   */
-  const char *ood_last_cmt_author;
-
-  /** @} */
-
-  /** If the item is a file that was added to the working copy with an
-   * svn:externals; if file_external is TRUE, then switched is always
-   * FALSE.
-   */
-  svn_boolean_t file_external;
-
-  /** The actual status of the text compared to the pristine base of the
-   * file. This value isn't masked by other working copy statuses.
-   * @c pristine_text_status is #svn_wc_status_none if this value was
-   * not calculated during the status walk.
-   */
-  enum svn_wc_status_kind pristine_text_status;
-
-  /** The actual status of the properties compared to the pristine base of
-   * the node. This value isn't masked by other working copy statuses.
-   * @c pristine_prop_status is #svn_wc_status_none if this value was
-   * not calculated during the status walk.
-   */
-  enum svn_wc_status_kind pristine_prop_status;
-
-  /** Base revision.  */
-  svn_revnum_t revision;
-
-  /** Last revision this was changed */
-  svn_revnum_t changed_rev;
 
-  /** Last commit author of this item */
-  const char *changed_author;
+  /** The entry's text status in the repository. */
+  enum svn_wc_status_kind repos_text_status;
 
-  /** Date of last commit. */
-  apr_time_t changed_date;
+  /** The entry's property status in the repository. */
+  enum svn_wc_status_kind repos_prop_status;
 
-  /** The locally present lock token.
-   */
-  const char *lock_token;
+  /** The entry's lock in the repository, if any. */
+  const svn_lock_t *repos_lock;
 
-  /** The locally present lock owner.
-   */
-  const char *lock_owner;
+  /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM
+   * if not out of date. */
+  svn_revnum_t ood_changed_rev;
 
-  /** The locally present lock comment.
-   */
-  const char *lock_comment;
+  /** Set to the most recent commit date, or @c 0 if not out of date. */
+  apr_time_t ood_changed_date;
 
-  /** The locally present lock creation date.
-   */
-  apr_time_t lock_creation_date;
-  
-  /** Set to TRUE if the item is the victim of a conflict. */
-  svn_boolean_t conflicted;
+  /** Set to the user name of the youngest commit, or @c NULL if not
+   * out of date or non-existent.  Because a non-existent @c
+   * svn:author property has the same behavior as an out-of-date
+   * working copy, examine @c ood_last_cmt_rev to determine whether
+   * the working copy is out of date. */
+  const char *ood_changed_author;
 
-  /** Which changelist this item is part of, or NULL if not part of any. */
-  const char *changelist;
+  /** @} */
 
   /* NOTE! Please update svn_wc_dup_status3() when adding new fields here. */
 } svn_wc_status3_t;

Modified: subversion/trunk/subversion/libsvn_client/status.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=955755&r1=955754&r2=955755&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/status.c (original)
+++ subversion/trunk/subversion/libsvn_client/status.c Thu Jun 17 21:40:20 2010
@@ -62,6 +62,7 @@ struct status_baton
 /* Create svn_client_status_t from svn_wc_satus3_t */
 static svn_error_t *
 create_client_status(svn_client_status_t **cst,
+                     svn_wc_context_t *wc_ctx,
                      const char *local_abspath,
                      const svn_wc_status3_t *status,
                      apr_pool_t *result_pool,
@@ -105,7 +106,7 @@ tweak_status(void *baton,
                                  sb->changelist_hash, scratch_pool))
     return SVN_NO_ERROR;
 
-  SVN_ERR(create_client_status(&cst, local_abspath, status,
+  SVN_ERR(create_client_status(&cst, sb->wc_ctx, local_abspath, status,
                                scratch_pool, scratch_pool));
 
   /* Call the real status function/baton. */
@@ -583,6 +584,7 @@ svn_client_status_dup(const svn_client_s
  */
 static svn_error_t *
 create_client_status(svn_client_status_t **cst,
+                     svn_wc_context_t *wc_ctx,
                      const char *local_abspath,
                      const svn_wc_status3_t *status,
                      apr_pool_t *result_pool,
@@ -603,7 +605,10 @@ create_client_status(svn_client_status_t
 
   (*cst)->switched = status->switched;
 
-  (*cst)->locked = status->locked;
+  if (status->kind == svn_node_dir)
+    SVN_ERR(svn_wc__temp_get_wclocked(&(*cst)->locked, wc_ctx, local_abspath,
+                                      scratch_pool));
+
   (*cst)->copied = status->copied;
   (*cst)->revision = status->revision;
 
@@ -615,22 +620,24 @@ create_client_status(svn_client_status_t
   (*cst)->repos_relpath = status->repos_relpath;
 
   (*cst)->switched = status->switched;
-  (*cst)->file_external = status->file_external;
+  (*cst)->file_external = FALSE;
 
-  if (status->lock_token)
+  if (status->versioned
+      && status->switched
+      && status->kind == svn_node_file)
     {
-      svn_lock_t *lock = apr_pcalloc(result_pool, sizeof(*lock));
-
-      lock->path = status->repos_relpath;
-      lock->token = status->lock_token;
-      lock->owner = status->lock_owner;
-      lock->comment = status->lock_comment;
-      lock->creation_date = status->lock_creation_date;
+      svn_boolean_t is_file_external;
+      SVN_ERR(svn_wc__node_is_file_external(&is_file_external, wc_ctx,
+                                            local_abspath, scratch_pool));
 
-      (*cst)->lock = lock;
+      if (is_file_external)
+        {
+          (*cst)->file_external = is_file_external;
+          (*cst)->switched = FALSE; /* ### Keep switched true now? */
+        }
     }
-  else
-    (*cst)->lock = NULL;
+
+  (*cst)->lock = status->lock;
 
   (*cst)->changelist = status->changelist;
   (*cst)->depth = status->depth;
@@ -642,9 +649,9 @@ create_client_status(svn_client_status_t
   (*cst)->repos_prop_status = status->repos_prop_status;
   (*cst)->repos_lock = status->repos_lock;
 
-  (*cst)->ood_changed_rev = status->ood_last_cmt_rev;
-  (*cst)->ood_changed_date = status->ood_last_cmt_date;
-  (*cst)->ood_changed_author = status->ood_last_cmt_author;
+  (*cst)->ood_changed_rev = status->ood_changed_rev;
+  (*cst)->ood_changed_date = status->ood_changed_date;
+  (*cst)->ood_changed_author = status->ood_changed_author;
 
   /* When changing the value of backwards_compatibility_baton, also
      change its use in status4_wrapper_func in deprecated.c */

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=955755&r1=955754&r2=955755&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Thu Jun 17 21:40:20 2010
@@ -186,10 +186,10 @@ struct dir_baton
   apr_pool_t *pool;
 
   /* out-of-date info corresponding to ood_* fields in svn_wc_status3_t. */
-  svn_revnum_t ood_last_cmt_rev;
-  apr_time_t ood_last_cmt_date;
   svn_node_kind_t ood_kind;
-  const char *ood_last_cmt_author;
+  svn_revnum_t ood_changed_rev;
+  apr_time_t ood_changed_date;  
+  const char *ood_changed_author;
 };
 
 
@@ -225,10 +225,11 @@ struct file_baton
   svn_boolean_t prop_changed;
 
   /* out-of-date info corresponding to ood_* fields in svn_wc_status3_t. */
-  svn_revnum_t ood_last_cmt_rev;
-  apr_time_t ood_last_cmt_date;
   svn_node_kind_t ood_kind;
-  const char *ood_last_cmt_author;
+  svn_revnum_t ood_changed_rev;
+  apr_time_t ood_changed_date;
+
+  const char *ood_changed_author;
 };
 
 
@@ -270,7 +271,6 @@ assemble_status(svn_wc_status3_t **statu
                 svn_node_kind_t path_kind,
                 svn_boolean_t path_special,
                 svn_boolean_t get_all,
-                svn_boolean_t is_ignored,
                 const svn_lock_t *repos_lock,
                 apr_pool_t *result_pool,
                 apr_pool_t *scratch_pool)
@@ -280,10 +280,8 @@ assemble_status(svn_wc_status3_t **statu
   svn_wc__db_kind_t db_kind;
   const char *repos_relpath;
   const char *repos_root_url;
-  svn_boolean_t locked_p = FALSE;
   svn_boolean_t switched_p = FALSE;
   const svn_wc_conflict_description2_t *tree_conflict;
-  svn_boolean_t file_external_p = FALSE;
   svn_boolean_t prop_modified_p;
   svn_wc__db_lock_t *lock;
   svn_revnum_t revision;
@@ -319,40 +317,16 @@ assemble_status(svn_wc_status3_t **statu
                                &conflicted, &lock, db, local_abspath,
                                result_pool, scratch_pool));
 
-  SVN_ERR(svn_wc__internal_is_file_external(&file_external_p, db,
-                                            local_abspath, scratch_pool));
-
-  /** File externals are switched files, but they are not shown as
-      such.  To be switched it must have both an URL and a parent with
-      an URL, at the very least. */
-  if (! file_external_p)
-    {
-      if (parent_repos_root_url && repos_root_url &&
-          (strcmp(parent_repos_root_url, repos_root_url) == 0))
-        {
-          const char *base = svn_dirent_basename(local_abspath, scratch_pool);
-
-          if (! repos_relpath)
-            {
-              repos_relpath = svn_relpath_join(parent_repos_relpath, base,
-                                               result_pool);
-              /* If _read_info() doesn't give us a repos_relpath, it means
-               * that it is implied by the parent, thus the path can not be
-               * switched. */
-              switched_p = FALSE;
-            }
-          else
-            {
-              switched_p = (strcmp(svn_relpath_join(parent_repos_relpath, base,
-                                                    scratch_pool),
-                                   repos_relpath) != 0);
-            }
-        }
-    }
-
   if (!repos_relpath)
     {
-      if (db_status == svn_wc__db_status_added)
+      /* The node is not switched, so imply from parent if possible */
+
+      if (parent_repos_relpath != NULL)
+        repos_relpath = svn_relpath_join(parent_repos_relpath,
+                                         svn_dirent_basename(local_abspath,
+                                                             NULL),
+                                         result_pool);
+      else if (db_status == svn_wc__db_status_added)
         SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &repos_relpath,
                                          &repos_root_url, NULL, NULL, NULL,
                                          NULL, NULL,
@@ -363,16 +337,19 @@ assemble_status(svn_wc_status3_t **statu
                                            &repos_root_url, NULL,
                                            db, local_abspath,
                                            result_pool, scratch_pool));
-      else
-        {
-          SVN_ERR_ASSERT(parent_repos_relpath != NULL);
 
-          repos_relpath = svn_relpath_join(parent_repos_relpath,
-                                           svn_dirent_basename(local_abspath,
-                                                               NULL),
-                                           result_pool);
-        }
+      switched_p = FALSE;
     }
+  else if (!parent_repos_relpath)
+    switched_p = FALSE;
+  else
+    {
+      /* A node is switched if it doesn't have the implied repos_relpath */
+
+      const char *name = svn_relpath_is_child(parent_repos_relpath, 
repos_relpath, NULL);
+      switched_p = !name || (strcmp(name, svn_dirent_basename(local_abspath, 
NULL)) != 0);
+    }
+
   if (!repos_root_url && parent_repos_root_url)
     repos_root_url = apr_pstrdup(result_pool, parent_repos_root_url);
 
@@ -622,10 +599,6 @@ assemble_status(svn_wc_status3_t **statu
       else if ( wc_special != path_special)
         final_text_status = svn_wc_status_obstructed;
 #endif /* HAVE_SYMLINK */
-
-      if (path_kind == svn_node_dir && db_kind == svn_wc__db_kind_dir)
-        SVN_ERR(svn_wc__db_wclocked(&locked_p, db, local_abspath,
-                                    scratch_pool));
     }
 
   /* 5. Easy out:  unless we're fetching -every- entry, don't bother
@@ -636,9 +609,7 @@ assemble_status(svn_wc_status3_t **statu
          || (final_text_status == svn_wc_status_normal))
         && ((final_prop_status == svn_wc_status_none)
             || (final_prop_status == svn_wc_status_normal))
-        && (! locked_p)
         && (! switched_p)
-        && (! file_external_p)
         && (! lock) 
         && (! repos_lock)
         && (! changelist)
@@ -671,25 +642,32 @@ assemble_status(svn_wc_status3_t **statu
   stat->prop_status = final_prop_status;
   stat->repos_text_status = svn_wc_status_none;   /* default */
   stat->repos_prop_status = svn_wc_status_none;   /* default */
-  stat->locked = locked_p;
   stat->switched = switched_p;
-  stat->file_external = file_external_p;
   stat->copied = copied;
   stat->repos_lock = repos_lock;
   stat->revision = revision;
   stat->changed_rev = changed_rev;
   stat->changed_author = changed_author;
   stat->changed_date = changed_date;
-  stat->ood_last_cmt_rev = SVN_INVALID_REVNUM;
-  stat->ood_last_cmt_date = 0;
+
   stat->ood_kind = svn_node_none;
-  stat->ood_last_cmt_author = NULL;
-  stat->pristine_text_status = pristine_text_status;
-  stat->pristine_prop_status = pristine_prop_status;
-  stat->lock_token = lock ? lock->token : NULL;
-  stat->lock_owner = lock ? lock->owner : NULL;
-  stat->lock_comment = lock ? lock->comment : NULL;
-  stat->lock_creation_date = lock ? lock->date : 0;
+  stat->ood_changed_rev = SVN_INVALID_REVNUM;
+  stat->ood_changed_date = 0;
+  stat->ood_changed_author = NULL;
+
+  if (lock)
+    {
+      svn_lock_t *lck = apr_pcalloc(result_pool, sizeof(*lck));
+      lck->path = repos_relpath;
+      lck->token = lock->token;
+      lck->owner = lock->owner;
+      lck->comment = lock->comment;
+      lck->creation_date = lock->date;
+      stat->lock = lck;
+    }
+  else
+    stat->lock = NULL;
+
   stat->conflicted = conflicted;
   stat->versioned = TRUE;
   stat->changelist = changelist;
@@ -753,7 +731,7 @@ assemble_unversioned(svn_wc_status3_t **
 
   stat->revision = SVN_INVALID_REVNUM;
   stat->changed_rev = SVN_INVALID_REVNUM;
-  stat->ood_last_cmt_rev = SVN_INVALID_REVNUM;
+  stat->ood_changed_rev = SVN_INVALID_REVNUM;
   stat->ood_kind = svn_node_none;
 
   /* For the case of an incoming delete to a locally deleted path during
@@ -777,7 +755,6 @@ send_status_structure(const struct walk_
                       svn_node_kind_t path_kind,
                       svn_boolean_t path_special,
                       svn_boolean_t get_all,
-                      svn_boolean_t is_ignored,
                       svn_wc_status_func4_t status_func,
                       void *status_baton,
                       apr_pool_t *scratch_pool)
@@ -825,7 +802,7 @@ send_status_structure(const struct walk_
 
   SVN_ERR(assemble_status(&statstruct, wb->db, local_abspath,
                           parent_repos_root_url, parent_repos_relpath,
-                          path_kind, path_special, get_all, is_ignored,
+                          path_kind, path_special, get_all,
                           repos_lock, scratch_pool, scratch_pool));
 
   if (statstruct && status_func)
@@ -1048,8 +1025,7 @@ handle_dir_entry(const struct walk_statu
           SVN_ERR(send_status_structure(wb, local_abspath,
                                         dir_repos_root_url,
                                         dir_repos_relpath, svn_node_dir,
-                                        FALSE /* path_special */,
-                                        get_all, FALSE /* is_ignored */,
+                                        FALSE /* path_special */, get_all,
                                         status_func, status_baton, pool));
         }
     }
@@ -1059,8 +1035,7 @@ handle_dir_entry(const struct walk_statu
       SVN_ERR(send_status_structure(wb, local_abspath,
                                     dir_repos_root_url,
                                     dir_repos_relpath, path_kind,
-                                    path_special, get_all, 
-                                    FALSE /* is_ignored */,
+                                    path_special, get_all,
                                     status_func, status_baton, pool));
     }
 
@@ -1258,8 +1233,7 @@ get_dir_status(const struct walk_status_
         SVN_ERR(send_status_structure(wb, local_abspath,
                                       parent_repos_root_url,
                                       parent_repos_relpath, svn_node_dir,
-                                      FALSE /* path_special */,
-                                      get_all, FALSE /* is_ignored */,
+                                      FALSE /* path_special */, get_all,
                                       status_func, status_baton,
                                       iterpool));
 
@@ -1433,10 +1407,10 @@ hash_stash(void *baton,
        optionally the revision path was deleted, in all other cases it must
        be set to SVN_INVALID_REVNUM.  If DELETED_REV is not
        SVN_INVALID_REVNUM and REPOS_TEXT_STATUS is svn_wc_status_deleted,
-       then use DELETED_REV to set PATH's ood_last_cmt_rev field in BATON.
+       then use DELETED_REV to set PATH's ood_changed_rev field in BATON.
        If DELETED_REV is SVN_INVALID_REVNUM and REPOS_TEXT_STATUS is
-       svn_wc_status_deleted, set PATH's ood_last_cmt_rev to its parent's
-       ood_last_cmt_rev value - see comment below.
+       svn_wc_status_deleted, set PATH's ood_changed_rev to its parent's
+       ood_changed_rev value - see comment below.
 
    If a new struct was added, set the repos_lock to REPOS_LOCK. */
 static svn_error_t *
@@ -1518,31 +1492,31 @@ tweak_statushash(void *baton,
              is a higher revision than the path was deleted, but this is
              better than nothing... */
           if (deleted_rev == SVN_INVALID_REVNUM)
-            statstruct->ood_last_cmt_rev =
-              ((struct dir_baton *) baton)->ood_last_cmt_rev;
+            statstruct->ood_changed_rev =
+              ((struct dir_baton *) baton)->ood_changed_rev;
           else
-            statstruct->ood_last_cmt_rev = deleted_rev;
+            statstruct->ood_changed_rev = deleted_rev;
         }
       else
         {
           statstruct->ood_kind = b->ood_kind;
-          statstruct->ood_last_cmt_rev = b->ood_last_cmt_rev;
-          statstruct->ood_last_cmt_date = b->ood_last_cmt_date;
-          if (b->ood_last_cmt_author)
-            statstruct->ood_last_cmt_author =
-              apr_pstrdup(pool, b->ood_last_cmt_author);
+          statstruct->ood_changed_rev = b->ood_changed_rev;
+          statstruct->ood_changed_date = b->ood_changed_date;
+          if (b->ood_changed_author)
+            statstruct->ood_changed_author =
+              apr_pstrdup(pool, b->ood_changed_author);
         }
 
     }
   else
     {
       struct file_baton *b = baton;
-      statstruct->ood_last_cmt_rev = b->ood_last_cmt_rev;
-      statstruct->ood_last_cmt_date = b->ood_last_cmt_date;
+      statstruct->ood_changed_rev = b->ood_changed_rev;
+      statstruct->ood_changed_date = b->ood_changed_date;
       statstruct->ood_kind = b->ood_kind;
-      if (b->ood_last_cmt_author)
-        statstruct->ood_last_cmt_author =
-          apr_pstrdup(pool, b->ood_last_cmt_author);
+      if (b->ood_changed_author)
+        statstruct->ood_changed_author =
+          apr_pstrdup(pool, b->ood_changed_author);
     }
   return SVN_NO_ERROR;
 }
@@ -1606,10 +1580,10 @@ make_dir_baton(void **dir_baton,
   d->parent_baton = parent_baton;
   d->pool = pool;
   d->statii = apr_hash_make(pool);
-  d->ood_last_cmt_rev = SVN_INVALID_REVNUM;
-  d->ood_last_cmt_date = 0;
+  d->ood_changed_rev = SVN_INVALID_REVNUM;
+  d->ood_changed_date = 0;
   d->ood_kind = svn_node_dir;
-  d->ood_last_cmt_author = NULL;
+  d->ood_changed_author = NULL;
 
   if (pb)
     {
@@ -1701,10 +1675,10 @@ make_file_baton(struct dir_baton *parent
   f->pool = pool;
   f->dir_baton = pb;
   f->edit_baton = eb;
-  f->ood_last_cmt_rev = SVN_INVALID_REVNUM;
-  f->ood_last_cmt_date = 0;
+  f->ood_changed_rev = SVN_INVALID_REVNUM;
+  f->ood_changed_date = 0;
   f->ood_kind = svn_node_file;
-  f->ood_last_cmt_author = NULL;
+  f->ood_changed_author = NULL;
   return f;
 }
 
@@ -1747,16 +1721,12 @@ svn_wc__is_sendable_status(const svn_wc_
   if (status->conflicted)
     return TRUE;
 
-  /* If it's locked or switched, send it. */
-  if (status->locked)
-    return TRUE;
+  /* If it's switched, send it. */
   if (status->switched)
     return TRUE;
-  if (status->file_external)
-    return TRUE;
 
   /* If there is a lock token, send it. */
-  if (status->versioned && status->lock_token)
+  if (status->versioned && status->lock)
     return TRUE;
 
   /* If the entry is associated with a changelist, send it. */
@@ -1980,14 +1950,14 @@ change_dir_prop(void *dir_baton,
   if (value != NULL)
     {
       if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
-        db->ood_last_cmt_rev = SVN_STR_TO_REV(value->data);
+        db->ood_changed_rev = SVN_STR_TO_REV(value->data);
       else if (strcmp(name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
-        db->ood_last_cmt_author = apr_pstrdup(db->pool, value->data);
+        db->ood_changed_author = apr_pstrdup(db->pool, value->data);
       else if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
         {
           apr_time_t tm;
           SVN_ERR(svn_time_from_cstring(&tm, value->data, db->pool));
-          db->ood_last_cmt_date = tm;
+          db->ood_changed_date = tm;
         }
     }
 
@@ -2008,7 +1978,7 @@ close_directory(void *dir_baton,
   /* If nothing has changed and directory has no out of
      date descendants, return. */
   if (db->added || db->prop_changed || db->text_changed
-      || db->ood_last_cmt_rev != SVN_INVALID_REVNUM)
+      || db->ood_changed_rev != SVN_INVALID_REVNUM)
     {
       enum svn_wc_status_kind repos_text_status;
       enum svn_wc_status_kind repos_prop_status;
@@ -2048,13 +2018,13 @@ close_directory(void *dir_baton,
           eb->anchor_status->repos_text_status = repos_text_status;
 
           /* If the root dir is out of date set the ood info directly too. */
-          if (db->ood_last_cmt_rev != eb->anchor_status->revision)
+          if (db->ood_changed_rev != eb->anchor_status->revision)
             {
-              eb->anchor_status->ood_last_cmt_rev = db->ood_last_cmt_rev;
-              eb->anchor_status->ood_last_cmt_date = db->ood_last_cmt_date;
+              eb->anchor_status->ood_changed_rev = db->ood_changed_rev;
+              eb->anchor_status->ood_changed_date = db->ood_changed_date;
               eb->anchor_status->ood_kind = db->ood_kind;
-              eb->anchor_status->ood_last_cmt_author =
-                apr_pstrdup(pool, db->ood_last_cmt_author);
+              eb->anchor_status->ood_changed_author =
+                apr_pstrdup(pool, db->ood_changed_author);
             }
         }
     }
@@ -2208,16 +2178,16 @@ change_file_prop(void *file_baton,
   if (value != NULL)
     {
       if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
-        fb->ood_last_cmt_rev = SVN_STR_TO_REV(value->data);
+        fb->ood_changed_rev = SVN_STR_TO_REV(value->data);
       else if (strcmp(name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
-        fb->ood_last_cmt_author = apr_pstrdup(fb->dir_baton->pool,
+        fb->ood_changed_author = apr_pstrdup(fb->dir_baton->pool,
                                               value->data);
       else if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
         {
           apr_time_t tm;
           SVN_ERR(svn_time_from_cstring(&tm, value->data,
                                         fb->dir_baton->pool));
-          fb->ood_last_cmt_date = tm;
+          fb->ood_changed_date = tm;
         }
     }
 
@@ -2648,7 +2618,6 @@ internal_status(svn_wc_status3_t **statu
                                           parent_repos_relpath, path_kind,
                                           path_special,
                                           TRUE /* get_all */,
-                                          FALSE /* is_ignored */,
                                           NULL /* repos_lock */,
                                           result_pool, scratch_pool));
 }
@@ -2682,21 +2651,12 @@ svn_wc_dup_status3(const svn_wc_status3_
   if (orig_stat->changed_author)
     new_stat->changed_author = apr_pstrdup(pool, orig_stat->changed_author);
 
-  if (orig_stat->ood_last_cmt_author)
-    new_stat->ood_last_cmt_author
-      = apr_pstrdup(pool, orig_stat->ood_last_cmt_author);
-
-  if (orig_stat->lock_token)
-    new_stat->lock_token
-      = apr_pstrdup(pool, orig_stat->lock_token);
-
-  if (orig_stat->lock_owner)
-    new_stat->lock_owner
-      = apr_pstrdup(pool, orig_stat->lock_owner);
-
-  if (orig_stat->lock_comment)
-    new_stat->lock_comment
-      = apr_pstrdup(pool, orig_stat->lock_comment);
+  if (orig_stat->ood_changed_author)
+    new_stat->ood_changed_author
+      = apr_pstrdup(pool, orig_stat->ood_changed_author);
+
+  if (orig_stat->lock)
+    new_stat->lock = svn_lock_dup(orig_stat->lock, pool);
 
   if (orig_stat->changelist)
     new_stat->changelist

Modified: subversion/trunk/subversion/libsvn_wc/util.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/util.c?rev=955755&r1=955754&r2=955755&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/util.c (original)
+++ subversion/trunk/subversion/libsvn_wc/util.c Thu Jun 17 21:40:20 2010
@@ -583,25 +583,75 @@ svn_wc__status2_from_3(svn_wc_status2_t 
   old_tree_conflict = svn_wc__cd2_to_cd(tree_conflict, result_pool);
 
   (*status)->entry = entry;
-  (*status)->text_status = old_status->text_status;
-  (*status)->prop_status = old_status->prop_status;
-  (*status)->locked = old_status->locked;
   (*status)->copied = old_status->copied;
-  (*status)->switched = old_status->switched;
-  (*status)->repos_text_status = old_status->repos_text_status;
-  (*status)->repos_prop_status = old_status->repos_prop_status;
   (*status)->repos_lock = svn_lock_dup(old_status->repos_lock, result_pool);
-  (*status)->url = svn_path_url_add_component2(old_status->repos_root_url,
-                                               old_status->repos_relpath,
-                                               result_pool);
-  (*status)->ood_last_cmt_rev = old_status->ood_last_cmt_rev;
-  (*status)->ood_last_cmt_date = old_status->ood_last_cmt_date;
+
+  if (old_status->repos_relpath)
+    (*status)->url = svn_path_url_add_component2(old_status->repos_root_url,
+                                                 old_status->repos_relpath,
+                                                 result_pool);
+  (*status)->ood_last_cmt_rev = old_status->ood_changed_rev;
+  (*status)->ood_last_cmt_date = old_status->ood_changed_date;
   (*status)->ood_kind = old_status->ood_kind;
-  (*status)->ood_last_cmt_author = old_status->ood_last_cmt_author;
+  (*status)->ood_last_cmt_author = old_status->ood_changed_author;
   (*status)->tree_conflict = old_tree_conflict;
-  (*status)->file_external = old_status->file_external;
-  (*status)->pristine_text_status = old_status->pristine_text_status;
-  (*status)->pristine_prop_status = old_status->pristine_prop_status;
+
+  (*status)->switched = old_status->switched;
+
+  if (old_status->versioned
+      && old_status->switched
+      && old_status->kind == svn_node_file)
+    {
+      svn_boolean_t file_external;
+
+      SVN_ERR(svn_wc__internal_is_file_external(&file_external,
+                                            wc_ctx->db, local_abspath,
+                                            scratch_pool));
+
+      if (file_external)
+        {
+          (*status)->switched = FALSE;
+          (*status)->file_external = TRUE;
+        }
+    }
+
+  (*status)->text_status = old_status->text_status;
+  (*status)->prop_status = old_status->prop_status;
+
+  (*status)->repos_text_status = old_status->repos_text_status;
+  (*status)->repos_prop_status = old_status->repos_prop_status;
+
+  /* Find pristine_text_status value */
+  switch (old_status->text_status)
+    {
+      case svn_wc_status_none:
+      case svn_wc_status_normal:
+      case svn_wc_status_modified:
+        (*status)->pristine_text_status = old_status->text_status;
+        break;
+      case svn_wc_status_conflicted:
+      default:
+        /* ### Fetch compare data, or fall back to the documented
+               not retrieved behavior? */
+        (*status)->pristine_text_status = svn_wc_status_none;
+        break;
+    }
+
+  /* Find pristine_prop_status value */
+  switch (old_status->prop_status)
+    {
+      case svn_wc_status_none:
+      case svn_wc_status_normal:
+      case svn_wc_status_modified:
+        (*status)->pristine_prop_status = old_status->prop_status;
+        break;
+      case svn_wc_status_conflicted:
+      default:
+        /* ### Fetch compare data, or fall back to the documented
+               not retrieved behavior? */
+        (*status)->pristine_prop_status = svn_wc_status_none;
+        break;
+    }
 
   return SVN_NO_ERROR;
 }


Reply via email to