You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2009/03/12 23:34:06 UTC
Re: svn commit: r36517 - trunk/subversion/libsvn_wc
Back up.
These tweaks are not working out.
When you read properties: look in ACTUAL, then WORKING, then BASE.
When you write properties, then you've got a whole different issue.
Those always go into ACTUAL, but props might not be there (yet). So
you may have to INSERT a copy of them. Or maybe a row exists, so you
need to UPDATE the props column to create an initial value. That
initial value comes form WORKING or from BASE. Then, after the copy,
you can update props in ACTUAL.
Of course, if there are props in ACTUAL, and somebody tries to add a
row to WORKING, then you've got a conflict: those props are against
BASE, but somebody is trying to alter that. You essentially have
"local mods".
These functions need to be much more complete.
Cheers,
-g
On Thu, Mar 12, 2009 at 20:37, Hyrum K. Wright <hy...@hyrumwright.org> wrote:
> Author: hwright
> Date: Thu Mar 12 12:37:14 2009
> New Revision: 36517
>
> Log:
> Modifying properties should be done to the ACTUAL tree, not the WORKING tree.
>
> * subversion/libsvn_wc/wc_db.c
> (statement_keys, statements): Rename enums and adjust SQL to select and
> update the ACTUAL table.
> (svn_wc__db_op_set_prop, svn_wc__db_op_set_props): Update enum
> references.
>
> Modified:
> trunk/subversion/libsvn_wc/wc_db.c
>
> Modified: trunk/subversion/libsvn_wc/wc_db.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/wc_db.c?pathrev=36517&r1=36516&r2=36517
> ==============================================================================
> --- trunk/subversion/libsvn_wc/wc_db.c Thu Mar 12 12:29:05 2009 (r36516)
> +++ trunk/subversion/libsvn_wc/wc_db.c Thu Mar 12 12:37:14 2009 (r36517)
> @@ -163,8 +163,8 @@ enum statement_keys {
> STMT_SELECT_WORKING_IS_FILE,
> STMT_SELECT_BASE_IS_FILE,
> STMT_SELECT_BASE_PROPS,
> - STMT_SELECT_WORKING_PROPS,
> - STMT_UPDATE_WORKING_PROPS
> + STMT_SELECT_ACTUAL_PROPS,
> + STMT_UPDATE_ACTUAL_PROPS
> };
>
> static const char * const statements[] = {
> @@ -233,10 +233,10 @@ static const char * const statements[] =
> "select properties from base_node "
> "where wc_id = ?1 and local_relpath = ?2;",
>
> - "select properies from working_node "
> + "select properies from actual_node "
> "where wc_id = ?1 and local_relpath = ?2;",
>
> - "update working_node set properties = ?3 "
> + "update actual_node set properties = ?3 "
> "where wc_id = ?1 and local_relpath = ?2;",
>
> NULL
> @@ -2032,7 +2032,7 @@ svn_wc__db_op_set_prop(svn_wc__db_t *db,
>
> /* Retrieve the existing properties. */
> SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->sdb,
> - STMT_SELECT_WORKING_PROPS));
> + STMT_SELECT_ACTUAL_PROPS));
> SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wc_id, local_relpath));
> SVN_ERR(svn_sqlite__step(&have_row, stmt));
> if (!have_row)
> @@ -2068,7 +2068,7 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
> scratch_pool, scratch_pool));
>
> SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->sdb,
> - STMT_UPDATE_WORKING_PROPS));
> + STMT_UPDATE_ACTUAL_PROPS));
> SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wc_id, local_relpath));
> SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1314125
>
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1314774
Re: svn commit: r36517 - trunk/subversion/libsvn_wc
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Mar 13, 2009, at 10:30 AM, Daniel Rall wrote:
> On Fri, Mar 13, 2009 at 8:15 AM, Hyrum K. Wright
> <hy...@mail.utexas.edu> wrote:
>> On Mar 12, 2009, at 6:34 PM, Greg Stein wrote:
> ...
>>> When you write properties, then you've got a whole different issue.
>>> Those always go into ACTUAL, but props might not be there (yet). So
>>> you may have to INSERT a copy of them. Or maybe a row exists, so you
>>> need to UPDATE the props column to create an initial value. That
>>> initial value comes form WORKING or from BASE. Then, after the copy,
>>> you can update props in ACTUAL.
>>
>> Okay, that makes sense, and I'll update svn_wc__db_op_set_props()
>> accordingly. I presume that svn_wc__db_op_set_prop() just does the
>> same thing, but replaces the given prop, such as is already
>> happening.
>
> "INSERT OR REPLACE" syntax might be helpful for implementation here.
> http://www.sqlite.org/lang_replace.html
> http://www.sqlite.org/lang_insert.html
Possibly. We're already using that syntax a number of places in
entries.c
-Hyrum
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1317666
Re: svn commit: r36517 - trunk/subversion/libsvn_wc
Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Fri, Mar 13, 2009 at 8:15 AM, Hyrum K. Wright
<hy...@mail.utexas.edu> wrote:
> On Mar 12, 2009, at 6:34 PM, Greg Stein wrote:
...
>> When you write properties, then you've got a whole different issue.
>> Those always go into ACTUAL, but props might not be there (yet). So
>> you may have to INSERT a copy of them. Or maybe a row exists, so you
>> need to UPDATE the props column to create an initial value. That
>> initial value comes form WORKING or from BASE. Then, after the copy,
>> you can update props in ACTUAL.
>
> Okay, that makes sense, and I'll update svn_wc__db_op_set_props()
> accordingly. I presume that svn_wc__db_op_set_prop() just does the
> same thing, but replaces the given prop, such as is already happening.
"INSERT OR REPLACE" syntax might be helpful for implementation here.
http://www.sqlite.org/lang_replace.html
http://www.sqlite.org/lang_insert.html
>> Of course, if there are props in ACTUAL, and somebody tries to add a
>> row to WORKING, then you've got a conflict: those props are against
>> BASE, but somebody is trying to alter that. You essentially have
>> "local mods".
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1317662
Re: svn commit: r36517 - trunk/subversion/libsvn_wc
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Mar 12, 2009, at 6:34 PM, Greg Stein wrote:
> Back up.
>
> These tweaks are not working out.
This demonstrates the difficulty my little brain sometimes has
grokking WC-NG. :/
> When you read properties: look in ACTUAL, then WORKING, then BASE.
We don't currently do this anywhere. We have a
svn_wc__db_base_get_props() API which does what one would expect,
based on the name. Do we need another API which does this dance you
describe? Public or private (to the file)?
> When you write properties, then you've got a whole different issue.
> Those always go into ACTUAL, but props might not be there (yet). So
> you may have to INSERT a copy of them. Or maybe a row exists, so you
> need to UPDATE the props column to create an initial value. That
> initial value comes form WORKING or from BASE. Then, after the copy,
> you can update props in ACTUAL.
Okay, that makes sense, and I'll update svn_wc__db_op_set_props()
accordingly. I presume that svn_wc__db_op_set_prop() just does the
same thing, but replaces the given prop, such as is already happening.
> Of course, if there are props in ACTUAL, and somebody tries to add a
> row to WORKING, then you've got a conflict: those props are against
> BASE, but somebody is trying to alter that. You essentially have
> "local mods".
>
> These functions need to be much more complete.
>
> Cheers,
> -g
>
> On Thu, Mar 12, 2009 at 20:37, Hyrum K. Wright
> <hy...@hyrumwright.org> wrote:
>> Author: hwright
>> Date: Thu Mar 12 12:37:14 2009
>> New Revision: 36517
>>
>> Log:
>> Modifying properties should be done to the ACTUAL tree, not the
>> WORKING tree.
>>
>> * subversion/libsvn_wc/wc_db.c
>> (statement_keys, statements): Rename enums and adjust SQL to
>> select and
>> update the ACTUAL table.
>> (svn_wc__db_op_set_prop, svn_wc__db_op_set_props): Update enum
>> references.
>>
>> Modified:
>> trunk/subversion/libsvn_wc/wc_db.c
>>
>> Modified: trunk/subversion/libsvn_wc/wc_db.c
>> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_wc/wc_db.c?pathrev=36517&r1=36516&r2=36517
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- trunk/subversion/libsvn_wc/wc_db.c Thu Mar 12 12:29:05
>> 2009 (r36516)
>> +++ trunk/subversion/libsvn_wc/wc_db.c Thu Mar 12 12:37:14
>> 2009 (r36517)
>> @@ -163,8 +163,8 @@ enum statement_keys {
>> STMT_SELECT_WORKING_IS_FILE,
>> STMT_SELECT_BASE_IS_FILE,
>> STMT_SELECT_BASE_PROPS,
>> - STMT_SELECT_WORKING_PROPS,
>> - STMT_UPDATE_WORKING_PROPS
>> + STMT_SELECT_ACTUAL_PROPS,
>> + STMT_UPDATE_ACTUAL_PROPS
>> };
>>
>> static const char * const statements[] = {
>> @@ -233,10 +233,10 @@ static const char * const statements[] =
>> "select properties from base_node "
>> "where wc_id = ?1 and local_relpath = ?2;",
>>
>> - "select properies from working_node "
>> + "select properies from actual_node "
>> "where wc_id = ?1 and local_relpath = ?2;",
>>
>> - "update working_node set properties = ?3 "
>> + "update actual_node set properties = ?3 "
>> "where wc_id = ?1 and local_relpath = ?2;",
>>
>> NULL
>> @@ -2032,7 +2032,7 @@ svn_wc__db_op_set_prop(svn_wc__db_t *db,
>>
>> /* Retrieve the existing properties. */
>> SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->sdb,
>> - STMT_SELECT_WORKING_PROPS));
>> + STMT_SELECT_ACTUAL_PROPS));
>> SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wc_id, local_relpath));
>> SVN_ERR(svn_sqlite__step(&have_row, stmt));
>> if (!have_row)
>> @@ -2068,7 +2068,7 @@ svn_wc__db_op_set_props(svn_wc__db_t *db
>> scratch_pool, scratch_pool));
>>
>> SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->sdb,
>> - STMT_UPDATE_WORKING_PROPS));
>> + STMT_UPDATE_ACTUAL_PROPS));
>> SVN_ERR(svn_sqlite__bindf(stmt, "is", pdh->wc_id, local_relpath));
>> SVN_ERR(svn_sqlite__bind_properties(stmt, 3, props, scratch_pool));
>>
>> ------------------------------------------------------
>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=1314125
>>
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1314774
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1317621