You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jelmer Vernooij <je...@samba.org> on 2006/06/23 11:30:43 UTC

[PATCH] Return error code rather than crash in svn_wc_crawl_revisions2()

Hi,

[[[
Return error code for unversioned files in svn_wc_crawl_revisions2()
rather than crashing.

 * subversion/libsvn_wc/adm_crawler.c 
   (svn_wc_crawl_revisions2): Return error for unversioned files.
]]]

Cheers,

Jelmer
-- 
Jelmer Vernooij <je...@samba.org> - http://samba.org/~jelmer/

Re: [PATCH] Return error code rather than crash in svn_wc_crawl_revisions2()

Posted by Madan U Sreenivasan <ma...@collab.net>.
On Fri, 23 Jun 2006 17:00:43 +0530, Jelmer Vernooij <je...@samba.org>  
wrote:

> Hi,
>
> [[[
> Return error code for unversioned files in svn_wc_crawl_revisions2()
> rather than crashing.
>
>  * subversion/libsvn_wc/adm_crawler.c
>    (svn_wc_crawl_revisions2): Return error for unversioned files.
> ]]]

Am wondering how we dodge the following check:

   if ((! entry) || ((entry->schedule == svn_wc_schedule_add)
                     && (entry->kind == svn_node_dir)))

for an unversioned path?

yeah, like Garrett said, could you pl. give us a recipe pl. (If you write  
a cmdline/python binding test case, we could reuse it to check it in along  
with the fix - just a suggestion :)


Regards,
Madan U S
www.symonds.net/~madan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Return error code rather than crash in svn_wc_crawl_revisions2()

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/23/06, Jelmer Vernooij <je...@samba.org> wrote:
> On Fri, 2006-06-23 at 16:55 +0200, Jelmer Vernooij wrote:
> > On Fri, 2006-06-23 at 10:47 -0400, Garrett Rooney wrote:
> > > On 6/23/06, Jelmer Vernooij <je...@samba.org> wrote:
> > > > Hi,
> > > >
> > > > [[[
> > > > Return error code for unversioned files in svn_wc_crawl_revisions2()
> > > > rather than crashing.
> > > >
> > > >  * subversion/libsvn_wc/adm_crawler.c
> > > >    (svn_wc_crawl_revisions2): Return error for unversioned files.
> > > > ]]]
> > >
> > > Do you have a way to reproduce this problem?  I'm just curious how it
> > > can actually happen...
> > Yep, just pass an unversioned path to svn_wc_crawl_revisions2().
> >
> > This was biting us in the Python bindings.
> To be more specific: This problem occurs because svn_wc_entry() returns
> a successful error code at subversion/libsvn_wc/adm_crawler.c:449 but
> parent_entry is set to NULL (indicating a unversioned file according to
> svn_wc.h).
>
> Other places in the code (such as svn_wc_merge_props) explicitly check
> for this already.

Works for me.  Committed with minor tweaks in r20227.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Return error code rather than crash in svn_wc_crawl_revisions2()

Posted by Jelmer Vernooij <je...@samba.org>.
On Fri, 2006-06-23 at 16:55 +0200, Jelmer Vernooij wrote:
> On Fri, 2006-06-23 at 10:47 -0400, Garrett Rooney wrote:
> > On 6/23/06, Jelmer Vernooij <je...@samba.org> wrote:
> > > Hi,
> > >
> > > [[[
> > > Return error code for unversioned files in svn_wc_crawl_revisions2()
> > > rather than crashing.
> > >
> > >  * subversion/libsvn_wc/adm_crawler.c
> > >    (svn_wc_crawl_revisions2): Return error for unversioned files.
> > > ]]]
> > 
> > Do you have a way to reproduce this problem?  I'm just curious how it
> > can actually happen...
> Yep, just pass an unversioned path to svn_wc_crawl_revisions2(). 
> 
> This was biting us in the Python bindings.
To be more specific: This problem occurs because svn_wc_entry() returns
a successful error code at subversion/libsvn_wc/adm_crawler.c:449 but
parent_entry is set to NULL (indicating a unversioned file according to
svn_wc.h).

Other places in the code (such as svn_wc_merge_props) explicitly check
for this already.

Cheers,

Jelmer

-- 
Jelmer Vernooij <je...@samba.org> - http://samba.org/~jelmer/

Re: [PATCH] Return error code rather than crash in svn_wc_crawl_revisions2()

Posted by Jelmer Vernooij <je...@samba.org>.
On Fri, 2006-06-23 at 10:47 -0400, Garrett Rooney wrote:
> On 6/23/06, Jelmer Vernooij <je...@samba.org> wrote:
> > Hi,
> >
> > [[[
> > Return error code for unversioned files in svn_wc_crawl_revisions2()
> > rather than crashing.
> >
> >  * subversion/libsvn_wc/adm_crawler.c
> >    (svn_wc_crawl_revisions2): Return error for unversioned files.
> > ]]]
> 
> Do you have a way to reproduce this problem?  I'm just curious how it
> can actually happen...
Yep, just pass an unversioned path to svn_wc_crawl_revisions2(). 

This was biting us in the Python bindings.

Cheers,

Jelmer

-- 
Jelmer Vernooij <je...@samba.org> - http://samba.org/~jelmer/

Re: [PATCH] Return error code rather than crash in svn_wc_crawl_revisions2()

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/23/06, Jelmer Vernooij <je...@samba.org> wrote:
> Hi,
>
> [[[
> Return error code for unversioned files in svn_wc_crawl_revisions2()
> rather than crashing.
>
>  * subversion/libsvn_wc/adm_crawler.c
>    (svn_wc_crawl_revisions2): Return error for unversioned files.
> ]]]

Do you have a way to reproduce this problem?  I'm just curious how it
can actually happen...

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org