Not on my game today. Thanks!
On Mon, Jun 28, 2010 at 16:26, Bert Huijben <b...@qqmail.nl> wrote: > > >> -----Original Message----- >> From: Greg Stein [mailto:gst...@gmail.com] >> Sent: maandag 28 juni 2010 22:22 >> To: dev@subversion.apache.org >> Subject: Re: svn commit: r958698 - in >> /subversion/trunk/subversion/libsvn_wc: adm_ops.c wc_db.c >> >> On Mon, Jun 28, 2010 at 16:04, <rhuij...@apache.org> wrote: >> >... >> > +++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Jun 28 >> 20:04:22 2010 >> >... >> > @@ -1332,6 +1338,11 @@ svn_wc_add4(svn_wc_context_t *wc_ctx, >> > repos_root_url, >> repos_root_url, >> > repos_uuid, 0, >> > depth, scratch_pool)); >> > + >> > + /* ### The entries based code still needs the incomplete base >> record, >> > + ### remove it for the direct db code. */ >> > + if (!copyfrom_url) >> > + SVN_ERR(svn_wc__db_base_remove(db, local_abspath, >> scratch_pool)); >> >> "direct db" ?? ... did you mean single db? >> >> And I think the comment should explain that area just a bit more: that >> we create an administrative area with a single row in BASE_NODE, and >> then you wipe out that row, leaving a database with no node >> information. > > If you had used a diff tool which showed more context you would have seen: > > /* Make sure this new directory has an admistrative subdirectory > created inside of it. > > This creates a BASE_NODE for an added directory, really > it should create a WORKING_NODE. It gets removed by the > next modify2 call. That is why we don't have to provide a > valid url */ > SVN_ERR(svn_wc__internal_ensure_adm(db, local_abspath, > repos_root_url, repos_root_url, > repos_uuid, 0, > depth, scratch_pool)); > > > > I'm not going to repeat that 5 lines below ;-) > > >> >> >... >> > +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Jun 28 20:04:22 >> 2010 >> > @@ -3071,12 +3071,20 @@ svn_wc__db_op_add_directory(svn_wc__db_t >> > >> > err = navigate_to_parent(&pdh, db, pdh, >> svn_sqlite__mode_readwrite, >> > scratch_pool); >> > - if (err) >> > + if (err && err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY) >> > { >> > - /* Prolly fell off the top of the wcroot. Just call it a >> day. */ >> > + /* Not registered in the parent; register as addition */ >> > svn_error_clear(err); >> > - return SVN_NO_ERROR; >> > + >> > + SVN_ERR(svn_wc__db_pdh_parse_local_abspath(&pdh, >> &local_relpath, db, >> > + svn_dirent_dirname(local_abspath, >> scratch_pool), >> > + svn_sqlite__mode_readwrite, >> scratch_pool, >> > + scratch_pool)); >> > + >> > + VERIFY_USABLE_PDH(pdh); >> > } >> > + else >> > + SVN_ERR(err); >> >> I don't understand this part. navigate_to_parent() doesn't look for >> the child in the parent, so "not registered in the parent" is an >> incorrect statement. > > Navigate to parent does: > > /* Check that the parent has an entry for the child */ > SVN_ERR(svn_sqlite__get_statement(&stmt, (*parent_pdh)->wcroot->sdb, > STMT_SELECT_SUBDIR)); > SVN_ERR(svn_sqlite__bindf(stmt, "is", (*parent_pdh)->wcroot->wc_id, > svn_dirent_basename(child_pdh->local_abspath, > NULL))); > SVN_ERR(svn_sqlite__step(&got_row, stmt)); > SVN_ERR(svn_sqlite__reset(stmt)); > > if (!got_row) > return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL, > _("'%s' does not have a parent."), > > svn_dirent_local_style(child_pdh->local_abspath, > scratch_pool)); > > Bert > >