[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r28605 - in trunk/subversion: include libsvn_client libsvn_subr svn

From: Joe Swatosh <joe.swatosh_at_gmail.com>
Date: 2007-12-27 19:52:14 CET

On Dec 27, 2007 10:50 AM, David Glasser <glasser@davidglasser.net> wrote:
>
> On Dec 27, 2007 10:47 AM, David Glasser <glasser@davidglasser.net> wrote:
> >
> > On Dec 27, 2007 10:39 AM, Joe Swatosh <joe.swatosh@gmail.com> wrote:
> > > Hi Mike,
> > >
> > > I can't seem to get the Ruby bindings tests to pass after this commit....
> > >
> > > On Dec 20, 2007 12:19 PM, <cmpilato@tigris.org> wrote:
> > > > Author: cmpilato
> > > > Date: Thu Dec 20 12:19:20 2007
> > > > New Revision: 28605
> > > >
> > > > Log:
> > > > Teach svn_client_get_changelist[s]() to handle multiple changelists,
> > > > or to report on any changelists found.
> > > >
> > > > * subversion/include/svn_client.h
> > > > (svn_changelist_receiver_t): Add 'changelist' parameter.
> > > > (svn_client_get_changelists): Was svn_client_get_changelist().
> > > >
> > > > * subversion/libsvn_client/changelist.c
> > > > (struct fe_baton): Trade string 'changelist' for hash 'changelists'.
> > > > (found_an_entry): Check against a changelists hash instead of a
> > > > single string, and pass changelist name to the callback function.
> > > > (svn_client_get_changelists): Was svn_client_get_changelist().
> > > > Update use of fe_baton, building a hash of changelist names to be
> > > > checked.
> > > >
> > > > * subversion/include/svn_hash.h,
> > > > * subversion/libsvn_subr/hash.c
> > > > (svn_hash_from_array): New.
> > > >
> > > > * subversion/svn/util.c
> > > > (svn_cl__get_changelist): Update call to svn_client_get_changelists().
> > > >
> > >
> > >
> > >
> > > > Modified: trunk/subversion/libsvn_client/changelist.c
> > > > URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/changelist.c?pathrev=28605&r1=28604&r2=28605
> > > > ==============================================================================
> > > > --- trunk/subversion/libsvn_client/changelist.c (original)
> > > > +++ trunk/subversion/libsvn_client/changelist.c Thu Dec 20 12:19:20 2007
> > > > @@ -25,6 +25,7 @@
> > > > #include "svn_client.h"
> > > > #include "svn_wc.h"
> > > > #include "svn_pools.h"
> > > > +#include "svn_hash.h"
> > > >
> > > > #include "client.h"
> > > >
> > > > @@ -78,7 +79,7 @@
> > > > {
> > > > svn_changelist_receiver_t callback_func;
> > > > void *callback_baton;
> > > > - const char *changelist_name;
> > > > + apr_hash_t *changelists;
> > > > apr_pool_t *pool;
> > > > };
> > > >
> > > > @@ -92,16 +93,19 @@
> > > > struct fe_baton *b = (struct fe_baton *)baton;
> > > >
> > > > /* If the entry has a changelist, and is a file or is the "this-dir"
> > > > - entry for directory, and the changelist matches what we're looking
> > > > - for... */
> > > > + entry for directory, and the changelist matches one that we're
> > > > + looking for (or we aren't looking for any in particular)... */
> > > > if (entry->changelist
> > > > + && ((! b->changelists)
> > > > + || apr_hash_get(b->changelists, entry->changelist,
> > > > + APR_HASH_KEY_STRING))
> > > > && ((entry->kind == svn_node_file)
> > > > || ((entry->kind == svn_node_dir)
> > > > - && (strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR) == 0)))
> > > > - && (strcmp(entry->changelist, b->changelist_name) == 0))
> > > > + && (strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR) == 0))))
> > > > {
> > > > /* ...then call the callback function. */
> > > > - SVN_ERR(b->callback_func(b->callback_baton, path, pool));
> > > > + SVN_ERR(b->callback_func(b->callback_baton, path,
> > > > + entry->changelist, pool));
> > > > }
> > > >
> > > > return SVN_NO_ERROR;
> > >
> > > .... this is were the issue seems to be. The call to apr_hash_get()
> > > above is always
> > > returning zero. I did a little experimenting and it appears that it
> > > only finds the key
> > > if it is a pointer to the same string rather than a string with the
> > > same value.
> > >
> > > I guess this is not the expected behavior since the length is
> > > APR_HASH_KEY_STRING.
> > > Perhaps the problem is actually in svn_hash_from_array() where the
> > > apr_hash_set() is
> > > called with a length of keys->elt_size?
> > >
> > > Maybe I'm all wet, but I could sure use some help.
> >
> > I wonder if it could be a pool issue? ie, the original key got destroyed?
>
> Actually, did r28630 fix this?
>
>

Dunno, I only made it to r28629...

More soon

--
Joe
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 27 19:52:23 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.