You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/05/12 22:57:45 UTC

svn commit: r943683 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/status.c svn/status-cmd.c

Author: dannas
Date: Wed May 12 20:57:45 2010
New Revision: 943683

URL: http://svn.apache.org/viewvc?rev=943683&view=rev
Log:
Since we need the changelist information inside libsvn_wc, we might
aswell put it in svn_wc_status3_t and save us the overhead of fetching
it again in the callback.

* subversion/svn/status-cmd.c
  (print_status): Use status->changelist instead of fetching the 
    changelist separately.

* subversion/include/svn_wc.h
  (svn_wc_status3_t): Add new field 'changelist'.

* subversion/libsvn_wc/status.c
  (assemble_status,
   assemble_unversioned): Initialize status->changelist.
  (svn_wc_dup_status3): Allocate space for the 'changelist' field.

Suggested by: Bert
              gstein

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_wc/status.c
    subversion/trunk/subversion/svn/status-cmd.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=943683&r1=943682&r2=943683&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Wed May 12 20:57:45 2010
@@ -3644,6 +3644,9 @@ typedef struct svn_wc_status3_t
   /** If the path is under version control, versioned is TRUE. */
   svn_boolean_t versioned;
 
+  /** 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_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=943683&r1=943682&r2=943683&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Wed May 12 20:57:45 2010
@@ -620,6 +620,7 @@ assemble_status(svn_wc_status3_t **statu
   stat->lock_creation_date = lock ? lock->date : 0;
   stat->conflicted = conflicted;
   stat->versioned = TRUE;
+  stat->changelist = changelist;
 
   *status = stat;
 
@@ -680,6 +681,7 @@ assemble_unversioned(svn_wc_status3_t **
   /* For the case of an incoming delete to a locally deleted path during
      an update, we get a tree conflict. */
   stat->conflicted = (tree_conflict != NULL);
+  stat->changelist = NULL;
 
   *status = stat;
   return SVN_NO_ERROR;
@@ -2583,6 +2585,10 @@ svn_wc_dup_status3(const svn_wc_status3_
     new_stat->lock_comment
       = apr_pstrdup(pool, orig_stat->lock_comment);
 
+  if (orig_stat->changelist)
+    new_stat->changelist
+      = apr_pstrdup(pool, orig_stat->changelist);
+
   /* Return the new hotness. */
   return new_stat;
 }

Modified: subversion/trunk/subversion/svn/status-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/status-cmd.c?rev=943683&r1=943682&r2=943683&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/status-cmd.c (original)
+++ subversion/trunk/subversion/svn/status-cmd.c Wed May 12 20:57:45 2010
@@ -177,7 +177,6 @@ print_status(void *baton,
   apr_time_t changed_date;
   const char *changed_author;
   const char *local_abspath;
-  const char *changelist;
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, sb->cl_pool));
   tweaked_status = svn_wc_dup_status3(status, sb->cl_pool);
@@ -202,17 +201,14 @@ print_status(void *baton,
       tweaked_status->changed_author = changed_author;
     }
 
-  SVN_ERR(svn_wc__node_get_changelist(&changelist, sb->ctx->wc_ctx, local_abspath,
-                                      pool, pool));
-
   /* If the path is part of a changelist, then we don't print
      the item, but instead dup & cache the status structure for later. */
-  if (changelist)
+  if (status->changelist)
     {
       /* The hash maps a changelist name to an array of status_cache
          structures. */
       apr_array_header_t *path_array;
-      const char *cl_key = apr_pstrdup(sb->cl_pool, changelist);
+      const char *cl_key = apr_pstrdup(sb->cl_pool, status->changelist);
       struct status_cache *scache = apr_pcalloc(sb->cl_pool, sizeof(*scache));
       scache->path = apr_pstrdup(sb->cl_pool, path);
       scache->status = svn_wc_dup_status3(tweaked_status, sb->cl_pool);