Hi!

I have a patch that passes make check. But a test suite can't test
everything (although the status code is probably one of the best covered
due to it's part in almost every cmdline-test). Posting only the changes
in libsvn_wc/status.c

What I'm wondering about:

* I'm using SVN_INVALID_REVNUM() for determining if read_info() gives us
  a valid revision. If it does I assume that we don't have to check for
  base_shadowed, addition or deletion. If the path used as IN parameter
  to read_info() is deleted, we will get a valid revision. Correct?

* svn_wc__db_scan_deletion() checks work_del_abspath. That works for all
  the cases in the test suite. I assumed that a plain delete would set
  the work_del_abspath to the root but this part of the doc comment of
  scan_deletion() says something else. Am I misinterpreting this (e.g.
  it's a part of the earlier paragraphs and has more operations done) or
  can it really be that a plain delete does not set the work_del_abspath?

[[[
If B/W/D does not exist in the WORKING tree (we're only talking about a
deletion of nodes of the BASE tree), then deleting B/W/D would have
marked the subtree for deletion. BASE_DEL_ABSPATH will refer to B/W/D,
BASE_REPLACED will be FALSE, MOVED_TO_ABSPATH will be NULL, and
WORK_DEL_ABSPATH will be NULL.                                             
]]]

* For all cases where read_info() says we have an addition (and by that
  read_info() means copied-here and moved-here too) I've set the
  revision to -1. Correct? Until committed, no revision exists is my
  point!

Daniel
Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c       (revision 935612)
+++ subversion/libsvn_wc/status.c       (working copy)
@@ -297,6 +297,11 @@ assemble_status(svn_wc_status3_t **status,
   svn_boolean_t switched_p = FALSE;
   const svn_wc_conflict_description2_t *tree_conflict;
   svn_boolean_t file_external_p = FALSE;
+  svn_wc__db_status_t db_status;
+  svn_revnum_t revision;
+  svn_revnum_t changed_rev;
+  const char *changed_author;
+  svn_boolean_t base_shadowed;
 #ifdef HAVE_SYMLINK
   svn_boolean_t wc_special;
 #endif /* HAVE_SYMLINK */
@@ -376,6 +381,9 @@ assemble_status(svn_wc_status3_t **status,
 
       stat->repos_lock = repos_lock;
       stat->url = NULL;
+      stat->revision = SVN_INVALID_REVNUM;
+      stat->changed_rev = SVN_INVALID_REVNUM;
+      stat->changed_author = NULL;
       stat->ood_last_cmt_rev = SVN_INVALID_REVNUM;
       stat->ood_last_cmt_date = 0;
       stat->ood_kind = svn_node_none;
@@ -385,6 +393,51 @@ assemble_status(svn_wc_status3_t **status,
       return SVN_NO_ERROR;
     }
 
+  SVN_ERR(svn_wc__db_read_info(&db_status, NULL, &revision, NULL, NULL, NULL,
+                               &changed_rev, NULL, &changed_author,
+                               NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, NULL, NULL, &base_shadowed, NULL,
+                               NULL, db, local_abspath, result_pool,
+                               scratch_pool));
+
+  if (db_status == svn_wc__db_status_deleted)
+    {
+      const char *work_del_abspath = NULL;
+      const char *base_del_abspath = NULL;
+
+      if (! SVN_IS_VALID_REVNUM(revision))
+        {
+          SVN_ERR(svn_wc__db_scan_deletion(&base_del_abspath, NULL, NULL, 
+                                           &work_del_abspath, db, 
+                                           local_abspath, scratch_pool,
+                                           result_pool));
+
+          SVN_ERR_ASSERT(work_del_abspath != NULL);
+
+          SVN_ERR(svn_wc__db_read_info(&db_status, NULL, &revision, NULL, 
NULL, NULL,
+                                       &changed_rev, NULL, &changed_author,
+                                       NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL,
+                                       NULL, NULL, NULL, NULL, NULL, NULL,
+                                       NULL, db, work_del_abspath, result_pool,
+                                       scratch_pool));
+        }
+    }
+
+  if (base_shadowed)
+    {
+      SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, &revision, NULL, NULL, NULL,
+                                       &changed_rev, NULL, &changed_author,
+                                       NULL, NULL, NULL, NULL, NULL, NULL, db,
+                                       local_abspath, result_pool,
+                                       scratch_pool));
+    }
+  else if (db_status == svn_wc__db_status_added)
+    {
+      revision = SVN_INVALID_REVNUM;
+      changed_rev = SVN_INVALID_REVNUM;
+      changed_author = NULL;
+    }
+
   /* Someone either deleted the administrative directory in the versioned
      subdir, or deleted the directory altogether and created a new one.
      In any case, what is currently there is in the way.
@@ -606,6 +659,9 @@ assemble_status(svn_wc_status3_t **status,
   stat->copied = entry->copied;
   stat->repos_lock = repos_lock;
   stat->url = (entry->url ? entry->url : NULL);
+  stat->revision = revision;
+  stat->changed_rev = changed_rev;
+  stat->changed_author = changed_author;
   stat->ood_last_cmt_rev = SVN_INVALID_REVNUM;
   stat->ood_last_cmt_date = 0;
   stat->ood_kind = svn_node_none;
@@ -2452,6 +2508,9 @@ svn_wc_dup_status3(const svn_wc_status3_t *orig_st
   if (orig_stat->url)
     new_stat->url = apr_pstrdup(pool, orig_stat->url);
 
+  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);

Reply via email to