You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/02/15 17:59:56 UTC

svn commit: r1244593 - /subversion/trunk/subversion/libsvn_delta/compat.c

Author: hwright
Date: Wed Feb 15 16:59:56 2012
New Revision: 1244593

URL: http://svn.apache.org/viewvc?rev=1244593&view=rev
Log:
Ev2 shims: What Greg hath broken, I shall fix.

Followup to r1241748 by supplying the correct children in the shims to
svn_editor_add_directory().

Current number of Ev2 test failures: 13

* subversion/libsvn_delta/compat.c
  (get_children): New.
  (process_actions): Use the new function to populate the children array.

Modified:
    subversion/trunk/subversion/libsvn_delta/compat.c

Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1244593&r1=1244592&r2=1244593&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Wed Feb 15 16:59:56 2012
@@ -232,6 +232,42 @@ add_action(struct ev2_edit_baton *eb,
   return SVN_NO_ERROR;
 }
 
+/* Find all the paths which are immediate children of PATH and return their
+   basenames in a list. */
+static apr_array_header_t *
+get_children(struct ev2_edit_baton *eb,
+             const char *path,
+             apr_pool_t *pool)
+{
+  apr_array_header_t *children = apr_array_make(pool, 1, sizeof(const char *));
+  apr_hash_index_t *hi;
+
+  for (hi = apr_hash_first(pool, eb->paths); hi; hi = apr_hash_next(hi))
+    {
+      const char *p = svn__apr_hash_index_key(hi);
+      const char *child;
+
+      /* Sanitize our paths. */
+      if (*p == '/')
+        p++;
+      
+      /* Find potential children. */
+      child = svn_relpath_skip_ancestor(path, p);
+      if (!child || !*child)
+        continue;
+
+      /* If we have a path separator, it's a deep child, so just ignore it.
+         ### Is there an API we should be using for this? */
+      if (strchr(child, '/') != NULL)
+        continue;
+
+      APR_ARRAY_PUSH(children, const char *) = child;
+    }
+
+  return children;
+}
+                  
+
 static svn_error_t *
 process_actions(void *edit_baton,
                 const char *path,
@@ -319,8 +355,7 @@ process_actions(void *edit_baton,
 
               if (kind == svn_kind_dir)
                 {
-                  children = apr_array_make(scratch_pool, 1,
-                                            sizeof(const char *));
+                  children = get_children(eb, path, scratch_pool);
                 }
               else
                 {



Re: svn commit: r1244593 - /subversion/trunk/subversion/libsvn_delta/compat.c

Posted by Greg Stein <gs...@gmail.com>.
On Wed, Feb 15, 2012 at 12:30, Greg Stein <gs...@gmail.com> wrote:
>
> On Feb 15, 2012 12:28 PM, "Hyrum K Wright" <hy...@wandisco.com>
> wrote:
>>
>> On Wed, Feb 15, 2012 at 10:59 AM,  <hw...@apache.org> wrote:
>> > Author: hwright
>> > Date: Wed Feb 15 16:59:56 2012
>> > New Revision: 1244593
>> >
>> > URL: http://svn.apache.org/viewvc?rev=1244593&view=rev
>> > Log:
>> > Ev2 shims: What Greg hath broken, I shall fix.
>> >
>> > Followup to r1241748 by supplying the correct children in the shims to
>> > svn_editor_add_directory().
>> >
>> > Current number of Ev2 test failures: 13
>>
>> Greg,
>> Some of these failures are due to a bug in the completed children
>> validation code in editor.c.  The case that's interesting is when a
>> directory is added, and one of its children is copied into place.
>> That child is copied via svn_editor_copy(), which doesn't mark the
>> child as completed, leaving incomplete children which trips the
>> validator in svn_editor_close().
>>
>> I'm not completely decided on the right way to clean this up, but
>> since you (re)wrote the validation code, I figured you'd have an idea.
>> :)
>
> Sure, I'll take care of it, O Tall One.

Fixed in r1244763.

Re: svn commit: r1244593 - /subversion/trunk/subversion/libsvn_delta/compat.c

Posted by Greg Stein <gs...@gmail.com>.
On Feb 15, 2012 12:28 PM, "Hyrum K Wright" <hy...@wandisco.com>
wrote:
>
> On Wed, Feb 15, 2012 at 10:59 AM,  <hw...@apache.org> wrote:
> > Author: hwright
> > Date: Wed Feb 15 16:59:56 2012
> > New Revision: 1244593
> >
> > URL: http://svn.apache.org/viewvc?rev=1244593&view=rev
> > Log:
> > Ev2 shims: What Greg hath broken, I shall fix.
> >
> > Followup to r1241748 by supplying the correct children in the shims to
> > svn_editor_add_directory().
> >
> > Current number of Ev2 test failures: 13
>
> Greg,
> Some of these failures are due to a bug in the completed children
> validation code in editor.c.  The case that's interesting is when a
> directory is added, and one of its children is copied into place.
> That child is copied via svn_editor_copy(), which doesn't mark the
> child as completed, leaving incomplete children which trips the
> validator in svn_editor_close().
>
> I'm not completely decided on the right way to clean this up, but
> since you (re)wrote the validation code, I figured you'd have an idea.
> :)

Sure, I'll take care of it, O Tall One.

Cheers,
-g

Re: svn commit: r1244593 - /subversion/trunk/subversion/libsvn_delta/compat.c

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Wed, Feb 15, 2012 at 10:59 AM,  <hw...@apache.org> wrote:
> Author: hwright
> Date: Wed Feb 15 16:59:56 2012
> New Revision: 1244593
>
> URL: http://svn.apache.org/viewvc?rev=1244593&view=rev
> Log:
> Ev2 shims: What Greg hath broken, I shall fix.
>
> Followup to r1241748 by supplying the correct children in the shims to
> svn_editor_add_directory().
>
> Current number of Ev2 test failures: 13

Greg,
Some of these failures are due to a bug in the completed children
validation code in editor.c.  The case that's interesting is when a
directory is added, and one of its children is copied into place.
That child is copied via svn_editor_copy(), which doesn't mark the
child as completed, leaving incomplete children which trips the
validator in svn_editor_close().

I'm not completely decided on the right way to clean this up, but
since you (re)wrote the validation code, I figured you'd have an idea.
:)

-Hyrum


-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/