You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/09/23 17:22:54 UTC

svn commit: r1000495 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: julianfoad
Date: Thu Sep 23 15:22:52 2010
New Revision: 1000495

URL: http://svn.apache.org/viewvc?rev=1000495&view=rev
Log:
* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_op_copy, make_copy_txn): Mark op_depth parameters with comments.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1000495&r1=1000494&r2=1000495&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Sep 23 15:22:52 2010
@@ -968,7 +968,7 @@ copy_working_from_base(void *baton,
 }
 
 
-
+/* */
 static svn_error_t *
 insert_incomplete_working_children(svn_sqlite__db_t *sdb,
                                    apr_int64_t wc_id,
@@ -3665,7 +3665,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
       SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
                     src_pdh->wcroot->wc_id, src_relpath,
                     dst_relpath,
-                    (children == NULL) ? (apr_int64_t)2 :
+                    (children == NULL) ? (apr_int64_t)2 :  /* ### op_depth */
                                 (apr_int64_t)1, /* no directory or stub */
                     dst_parent_relpath,
                     presence_map, dst_status));
@@ -8935,7 +8935,7 @@ make_copy_txn(void *baton,
       SVN_ERR(svn_sqlite__bindf(stmt, "isi",
                                 mcb->pdh->wcroot->wc_id,
                                 mcb->local_relpath,
-                                (*mcb->local_relpath == '\0'
+                                (*mcb->local_relpath == '\0' /* ### op_depth */
                                  ? (apr_int64_t)1 : (apr_int64_t)2)));
 
       SVN_ERR(svn_sqlite__step_done(stmt));
@@ -8966,7 +8966,7 @@ make_copy_txn(void *baton,
       SVN_ERR(svn_sqlite__bindf(stmt, "isi",
                                 mcb->pdh->wcroot->wc_id,
                                 mcb->local_relpath,
-                                (*mcb->local_relpath == '\0'
+                                (*mcb->local_relpath == '\0' /* ### op_depth */
                                  ? (apr_int64_t)1 : (apr_int64_t)2)));
 
       SVN_ERR(svn_sqlite__step_done(stmt));



Re: svn commit: r1000495 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Philip Martin <ph...@wandisco.com>.
Greg Stein <gs...@gmail.com> writes:

> On Thu, Sep 23, 2010 at 11:22,  <ju...@apache.org> wrote:
>>...
>> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Sep 23 15:22:52 2010
>>...
>> @@ -3665,7 +3665,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
>>       SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
>>                     src_pdh->wcroot->wc_id, src_relpath,
>>                     dst_relpath,
>> -                    (children == NULL) ? (apr_int64_t)2 :
>> +                    (children == NULL) ? (apr_int64_t)2 :  /* ### op_depth */
>>                                 (apr_int64_t)1, /* no directory or stub */
>
> I see stuff like this scattered all through wc_db. How can we possibly
> use constants for op_depth? Those constants only make sense in
> multi-db. Shouldn't these be switched to look at the path now?

op_depth is not implemented yet beyond zero/non-zero.  We could change
all those lines to a simple (apr_int64_t)1.  There is one advantage to
making some of them 1 and some of them 2: it means we can't
accidentally rely on the value being 1.

-- 
Philip

Re: svn commit: r1000495 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Julian Foad <ju...@wandisco.com>.
Greg Stein wrote:
> On Thu, Sep 23, 2010 at 11:22,  <ju...@apache.org> wrote:
> >...
> > +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Sep 23 15:22:52 2010
> >...
> > @@ -3665,7 +3665,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
> >       SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
> >                     src_pdh->wcroot->wc_id, src_relpath,
> >                     dst_relpath,
> > -                    (children == NULL) ? (apr_int64_t)2 :
> > +                    (children == NULL) ? (apr_int64_t)2 :  /* ### op_depth */
> >                                 (apr_int64_t)1, /* no directory or stub */
> 
> I see stuff like this scattered all through wc_db. How can we possibly
> use constants for op_depth? Those constants only make sense in
> multi-db. Shouldn't these be switched to look at the path now?

Yes, precisely.  That's what I'm doing now, and why I've been trying to
understand the NODES design properly for the last ten days.

- Julian


Re: svn commit: r1000495 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Greg Stein <gs...@gmail.com>.
On Thu, Sep 23, 2010 at 11:22,  <ju...@apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Sep 23 15:22:52 2010
>...
> @@ -3665,7 +3665,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
>       SVN_ERR(svn_sqlite__bindf(stmt, "issisnnnt",
>                     src_pdh->wcroot->wc_id, src_relpath,
>                     dst_relpath,
> -                    (children == NULL) ? (apr_int64_t)2 :
> +                    (children == NULL) ? (apr_int64_t)2 :  /* ### op_depth */
>                                 (apr_int64_t)1, /* no directory or stub */

I see stuff like this scattered all through wc_db. How can we possibly
use constants for op_depth? Those constants only make sense in
multi-db. Shouldn't these be switched to look at the path now?

>...

Cheers,
-g

Re: svn commit: r1000495 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Greg Stein <gs...@gmail.com>.
On Thu, Sep 23, 2010 at 11:22,  <ju...@apache.org> wrote:
> Author: julianfoad
> Date: Thu Sep 23 15:22:52 2010
> New Revision: 1000495
>
> URL: http://svn.apache.org/viewvc?rev=1000495&view=rev
> Log:
> * subversion/libsvn_wc/wc_db.c
>  (svn_wc__db_op_copy, make_copy_txn): Mark op_depth parameters with comments.

If you're going to mark them, then please do it right before the
comma... in all these cases you're placing the comment mid-expression
:-(

>...

Cheers,
-g