You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@wandisco.com> on 2010/08/25 10:00:10 UTC

Re: svn commit: r988956 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

philip@apache.org writes:

> Author: philip
> Date: Wed Aug 25 09:55:35 2010
> New Revision: 988956
>
> URL: http://svn.apache.org/viewvc?rev=988956&view=rev
> Log:
> Fix some uses of unitialised variables identified by valgrind.
>
> * subversion/libsvn_wc/update_editor.c
>   (add_directory, add_file): Set conflicted if svn_wc__db_read_info fails.
>
> Modified:
>     subversion/trunk/subversion/libsvn_wc/update_editor.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=988956&r1=988955&r2=988956&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug 25 09:55:35 2010
> @@ -2357,6 +2357,7 @@ add_directory(const char *path,
>        svn_error_clear(err);
>        wc_kind = svn_wc__db_kind_unknown;
>        status = svn_wc__db_status_normal;
> +      conflicted = FALSE;
>  
>        versioned_locally_and_present = FALSE;
>      }
> @@ -3808,6 +3809,7 @@ add_file(const char *path,
>        svn_error_clear(err);
>        wc_kind = svn_wc__db_kind_unknown;
>        status = svn_wc__db_status_normal;
> +      conflicted = FALSE;
>  
>        versioned_locally_and_present = FALSE;
>      }

Could someone confirm that FALSE is correct here?

-- 
Philip

RE: svn commit: r988956 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Posted by Bert Huijben <be...@vmoo.com>.

> -----Original Message-----
> From: Stefan Sperling [mailto:stsp@elego.de]
> Sent: woensdag 25 augustus 2010 14:52
> To: Philip Martin
> Cc: dev@subversion.apache.org
> Subject: Re: svn commit: r988956 -
> /subversion/trunk/subversion/libsvn_wc/update_editor.c
> 
> On Wed, Aug 25, 2010 at 11:00:10AM +0100, Philip Martin wrote:
> > philip@apache.org writes:
> >
> > > Author: philip
> > > Date: Wed Aug 25 09:55:35 2010
> > > New Revision: 988956
> > >
> > > URL: http://svn.apache.org/viewvc?rev=988956&view=rev
> > > Log:
> > > Fix some uses of unitialised variables identified by valgrind.
> > >
> > > * subversion/libsvn_wc/update_editor.c
> > >   (add_directory, add_file): Set conflicted if svn_wc__db_read_info
fails.
> > >
> > > Modified:
> > >     subversion/trunk/subversion/libsvn_wc/update_editor.c
> > >
> > > Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
> > > URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/upd
> ate_editor.c?rev=988956&r1=988955&r2=988956&view=diff
> > >
> ==========================================================
> ====================
> > > --- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
> > > +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug
> 25 09:55:35 2010
> > > @@ -2357,6 +2357,7 @@ add_directory(const char *path,
> > >        svn_error_clear(err);
> > >        wc_kind = svn_wc__db_kind_unknown;
> > >        status = svn_wc__db_status_normal;
> > > +      conflicted = FALSE;
> > >
> > >        versioned_locally_and_present = FALSE;
> > >      }
> > > @@ -3808,6 +3809,7 @@ add_file(const char *path,
> > >        svn_error_clear(err);
> > >        wc_kind = svn_wc__db_kind_unknown;
> > >        status = svn_wc__db_status_normal;
> > > +      conflicted = FALSE;
> > >
> > >        versioned_locally_and_present = FALSE;
> > >      }
> >
> > Could someone confirm that FALSE is correct here?
> 
> Looks fine to me.

Answered on IRC: No, this is not the correct value. 

A node can still be in conflict while _db_read_info() returns path not
found. Currently delete-delete tree conflicts can be the exception.

So in this case it's safer to set the conflicted variable to TRUE and
thereby perform the more expensive checks, to verify if the node is really
in conflict.

	Bert

Re: svn commit: r988956 - /subversion/trunk/subversion/libsvn_wc/update_editor.c

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Aug 25, 2010 at 11:00:10AM +0100, Philip Martin wrote:
> philip@apache.org writes:
> 
> > Author: philip
> > Date: Wed Aug 25 09:55:35 2010
> > New Revision: 988956
> >
> > URL: http://svn.apache.org/viewvc?rev=988956&view=rev
> > Log:
> > Fix some uses of unitialised variables identified by valgrind.
> >
> > * subversion/libsvn_wc/update_editor.c
> >   (add_directory, add_file): Set conflicted if svn_wc__db_read_info fails.
> >
> > Modified:
> >     subversion/trunk/subversion/libsvn_wc/update_editor.c
> >
> > Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=988956&r1=988955&r2=988956&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
> > +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Aug 25 09:55:35 2010
> > @@ -2357,6 +2357,7 @@ add_directory(const char *path,
> >        svn_error_clear(err);
> >        wc_kind = svn_wc__db_kind_unknown;
> >        status = svn_wc__db_status_normal;
> > +      conflicted = FALSE;
> >  
> >        versioned_locally_and_present = FALSE;
> >      }
> > @@ -3808,6 +3809,7 @@ add_file(const char *path,
> >        svn_error_clear(err);
> >        wc_kind = svn_wc__db_kind_unknown;
> >        status = svn_wc__db_status_normal;
> > +      conflicted = FALSE;
> >  
> >        versioned_locally_and_present = FALSE;
> >      }
> 
> Could someone confirm that FALSE is correct here?

Looks fine to me.

Stefan