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

svn commit: r942170 - in /subversion/trunk/subversion/libsvn_wc: props.c props.h status.c

Author: gstein
Date: Fri May  7 18:34:12 2010
New Revision: 942170

URL: http://svn.apache.org/viewvc?rev=942170&view=rev
Log:
Remove a couple internal props functions.

* subversion/libsvn_wc/props.h:
  (svn_wc__has_props): removed
  (svn_wc__wcprop_set): declaration removed.

* subversion/libsvn_wc/props.c:
  (svn_wc__wcprop_set): renamed to ...
  (wcprop_set): ... this. made static. added comment about the
    transaction-ness of this function.
  (svn_wc__internal_propset): track rename to wcprop_set
  (svn_wc__has_props): removed

* subversion/libsvn_wc/status.c:
  (assemble_status): alter call to __has_props by fetching the pristine
    and current set of properties for the node. leave a note that we
    cannot (yet) rely on these for the __props_modified call.

Modified:
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/props.h
    subversion/trunk/subversion/libsvn_wc/status.c

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=942170&r1=942169&r2=942170&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Fri May  7 18:34:12 2010
@@ -1853,21 +1853,25 @@ svn_wc__merge_props(svn_wc_notify_state_
 }
 
 
-
-/*** Private 'wc prop' functions ***/
-
-
-svn_error_t *
-svn_wc__wcprop_set(svn_wc__db_t *db,
-                   const char *local_abspath,
-                   const char *name,
-                   const svn_string_t *value,
-                   apr_pool_t *scratch_pool)
+/* Set a single 'wcprop' NAME to VALUE for versioned object LOCAL_ABSPATH.
+   If VALUE is null, remove property NAME.  */
+static svn_error_t *
+wcprop_set(svn_wc__db_t *db,
+           const char *local_abspath,
+           const char *name,
+           const svn_string_t *value,
+           apr_pool_t *scratch_pool)
 {
   apr_hash_t *prophash;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
+  /* Note: this is not well-transacted. But... meh. This is merely a cache,
+     and if two processes are trying to modify this one entry at the same
+     time, then fine: we can let one be a winner, and one a loser. Of course,
+     if there are *other* state changes afoot, then the lack of a txn could
+     be a real issue, but we cannot solve that here.  */
+
   SVN_ERR(svn_wc__db_base_get_dav_cache(&prophash, db, local_abspath,
                                         scratch_pool, scratch_pool));
 
@@ -1880,10 +1884,6 @@ svn_wc__wcprop_set(svn_wc__db_t *db,
                                                         scratch_pool));
 }
 
-/*------------------------------------------------------------------*/
-
-
-/*** Public Functions ***/
 
 svn_error_t *
 svn_wc__get_actual_props(apr_hash_t **props,
@@ -2240,8 +2240,8 @@ svn_wc__internal_propset(svn_wc__db_t *d
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   if (prop_kind == svn_prop_wc_kind)
-    return svn_error_return(svn_wc__wcprop_set(db, local_abspath,
-                                               name, value, scratch_pool));
+    return svn_error_return(wcprop_set(db, local_abspath, name, value,
+                                       scratch_pool));
 
   /* we don't do entry properties here */
   if (prop_kind == svn_prop_entry_kind)
@@ -2545,34 +2545,6 @@ svn_wc_is_entry_prop(const char *name)
 
 
 svn_error_t *
-svn_wc__has_props(svn_boolean_t *has_props,
-                  svn_wc__db_t *db,
-                  const char *local_abspath,
-                  apr_pool_t *scratch_pool)
-{
-  apr_hash_t *props;
-
-  /* ### this function is only used by status.c. should nuke it all.  */
-
-  /* ### no pristines should be okay  */
-  SVN_ERR(load_pristine_props(&props, db, local_abspath,
-                              scratch_pool, scratch_pool));
-  if (props != NULL && apr_hash_count(props))
-    {
-      *has_props = TRUE;
-      return SVN_NO_ERROR;
-    }
-
-  SVN_ERR(load_actual_props(&props, db, local_abspath,
-                            scratch_pool, scratch_pool));
-  *has_props = (apr_hash_count(props) > 0);
-
-  return SVN_NO_ERROR;
-}
-
-
-
-svn_error_t *
 svn_wc__props_modified(svn_boolean_t *modified_p,
                        svn_wc__db_t *db,
                        const char *local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=942170&r1=942169&r2=942170&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Fri May  7 18:34:12 2010
@@ -44,13 +44,6 @@ typedef enum svn_wc__props_kind_t
   svn_wc__props_working
 } svn_wc__props_kind_t;
 
-
-/* If the working item at PATH has properties attached, set HAS_PROPS. */
-svn_error_t *svn_wc__has_props(svn_boolean_t *has_props,
-                               svn_wc__db_t *db,
-                               const char *local_abspath,
-                               apr_pool_t *pool);
-
 
 /* Internal function for diffing props. See svn_wc_get_prop_diffs2(). */
 svn_error_t *
@@ -137,14 +130,6 @@ svn_wc__merge_props(svn_wc_notify_state_
                     apr_pool_t *scratch_pool);
 
 
-/* Set a single 'wcprop' NAME to VALUE for versioned object LOCAL_ABSPATH.
-   If VALUE is null, remove property NAME.  */
-svn_error_t *svn_wc__wcprop_set(svn_wc__db_t *db,
-                                const char *local_abspath,
-                                const char *name,
-                                const svn_string_t *value,
-                                apr_pool_t *scratch_pool);
-
 /* Given PROPERTIES is array of @c svn_prop_t structures. Returns TRUE if any
    of the PROPERTIES are the known "magic" ones that might require
    changing the working file. */

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=942170&r1=942169&r2=942170&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Fri May  7 18:34:12 2010
@@ -457,11 +457,24 @@ assemble_status(svn_wc_status3_t **statu
             precedence over M. */
 
       /* Does the entry have props? */
-      SVN_ERR(svn_wc__has_props(&has_props, db, local_abspath, scratch_pool));
+      {
+        apr_hash_t *pristine;
+        apr_hash_t *actual;
+
+        SVN_ERR(svn_wc__get_pristine_props(&pristine, db, local_abspath,
+                                           scratch_pool, scratch_pool));
+        SVN_ERR(svn_wc__get_actual_props(&actual, db, local_abspath,
+                                         scratch_pool, scratch_pool));
+        has_props = ((pristine != NULL && apr_hash_count(pristine) > 0)
+                     || (actual != NULL && apr_hash_count(actual) > 0));
+      }
       if (has_props)
         final_prop_status = svn_wc_status_normal;
 
       /* If the entry has a property file, see if it has local changes. */
+      /* ### we could compute this ourself, based on the prop hashes
+         ### fetched above. but for now, there is some trickery we may
+         ### need to rely upon in ths function. keep it for now.  */
       SVN_ERR(svn_wc__props_modified(&prop_modified_p, db, local_abspath,
                                      scratch_pool));
 



Re: svn commit: r942170 - in /subversion/trunk/subversion/libsvn_wc: props.c props.h status.c

Posted by Greg Stein <gs...@gmail.com>.
On Tue, May 11, 2010 at 14:17, Greg Stein <gs...@gmail.com> wrote:
> On Tue, May 11, 2010 at 12:39, Philip Martin <ph...@wandisco.com> wrote:
>...
>> It appears that the main testsuite doesn't check status on missing,
>> deleted directories.  942170 is when a simple 'svn st' started
>> failing, 'svn st -u' has been failing for much longer.  There is some

The key piece was an svn_wc__adm_missing() check before recursing on a
subdirectory. I removed that in r37361 a year ago, and put an
svn_wc__get_entry() call in its place. That would have error'd if it
could not retrieve the "real" data. (tho the error check was wrong...
no biggy)

Last August, r38991 replaced all the entry logic with some other wc-ng
gunk, and the check was lost entirely.

So today, the crawler attempts to recurse "into" an obstructing file. Whoops.

This should be a pretty simple fix...

Cheers,
-g

Re: svn commit: r942170 - in /subversion/trunk/subversion/libsvn_wc: props.c props.h status.c

Posted by Greg Stein <gs...@gmail.com>.
On Tue, May 11, 2010 at 12:39, Philip Martin <ph...@wandisco.com> wrote:
> "Hyrum K. Wright" <hy...@mail.utexas.edu> writes:
>
>> I think this is causing the JavaHL test failure, namely that status now
>> fails on a missing, schedule-delete directory.  Could this be a connection?
>
> Well check-javahl with 942169 passes and with 942170 it fails :)

Yup.

> It appears that the main testsuite doesn't check status on missing,
> deleted directories.  942170 is when a simple 'svn st' started
> failing, 'svn st -u' has been failing for much longer.  There is some
> code in basic_tests.py:basic_revert:828 that would check this but it
> is commented out.

I'll write a specific test for obstructions and properties, and then
get this bug fixed up.

Thanks,
-g

Re: svn commit: r942170 - in /subversion/trunk/subversion/libsvn_wc: props.c props.h status.c

Posted by Philip Martin <ph...@wandisco.com>.
"Hyrum K. Wright" <hy...@mail.utexas.edu> writes:

> I think this is causing the JavaHL test failure, namely that status now
> fails on a missing, schedule-delete directory.  Could this be a connection?

Well check-javahl with 942169 passes and with 942170 it fails :)

It appears that the main testsuite doesn't check status on missing,
deleted directories.  942170 is when a simple 'svn st' started
failing, 'svn st -u' has been failing for much longer.  There is some
code in basic_tests.py:basic_revert:828 that would check this but it
is commented out.

-- 
Philip

Re: svn commit: r942170 - in /subversion/trunk/subversion/libsvn_wc: props.c props.h status.c

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Fri, May 7, 2010 at 1:34 PM, <gs...@apache.org> wrote:

> Author: gstein
> Date: Fri May  7 18:34:12 2010
> New Revision: 942170
>
> URL: http://svn.apache.org/viewvc?rev=942170&view=rev
> Log:
> Remove a couple internal props functions.
>
> * subversion/libsvn_wc/props.h:
>  (svn_wc__has_props): removed
>  (svn_wc__wcprop_set): declaration removed.
>
> * subversion/libsvn_wc/props.c:
>  (svn_wc__wcprop_set): renamed to ...
>  (wcprop_set): ... this. made static. added comment about the
>    transaction-ness of this function.
>  (svn_wc__internal_propset): track rename to wcprop_set
>  (svn_wc__has_props): removed
>
> * subversion/libsvn_wc/status.c:
>  (assemble_status): alter call to __has_props by fetching the pristine
>    and current set of properties for the node. leave a note that we
>    cannot (yet) rely on these for the __props_modified call.
>
> Modified:
>    subversion/trunk/subversion/libsvn_wc/props.c
>    subversion/trunk/subversion/libsvn_wc/props.h
>    subversion/trunk/subversion/libsvn_wc/status.c

...


I think this is causing the JavaHL test failure, namely that status now
fails on a missing, schedule-delete directory.  Could this be a connection?

-Hyrum

Re: svn commit: r942170 - in /subversion/trunk/subversion/libsvn_wc: props.c props.h status.c

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Fri, May 7, 2010 at 1:34 PM, <gs...@apache.org> wrote:

> Author: gstein
> Date: Fri May  7 18:34:12 2010
> New Revision: 942170
>
> URL: http://svn.apache.org/viewvc?rev=942170&view=rev
> Log:
> Remove a couple internal props functions.
>
> * subversion/libsvn_wc/props.h:
>  (svn_wc__has_props): removed
>  (svn_wc__wcprop_set): declaration removed.
>
> * subversion/libsvn_wc/props.c:
>  (svn_wc__wcprop_set): renamed to ...
>  (wcprop_set): ... this. made static. added comment about the
>    transaction-ness of this function.
>  (svn_wc__internal_propset): track rename to wcprop_set
>  (svn_wc__has_props): removed
>
> * subversion/libsvn_wc/status.c:
>  (assemble_status): alter call to __has_props by fetching the pristine
>    and current set of properties for the node. leave a note that we
>    cannot (yet) rely on these for the __props_modified call.
>
> Modified:
>    subversion/trunk/subversion/libsvn_wc/props.c
>    subversion/trunk/subversion/libsvn_wc/props.h
>    subversion/trunk/subversion/libsvn_wc/status.c

...


I think this is causing the JavaHL test failure, namely that status now
fails on a missing, schedule-delete directory.  Could this be a connection?

-Hyrum