You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2011/10/21 08:29:28 UTC
Re: svn commit: r1187160 -
/subversion/trunk/subversion/libsvn_delta/compat.c
hwright@apache.org wrote on Fri, Oct 21, 2011 at 01:40:04 -0000:
> Author: hwright
> Date: Fri Oct 21 01:40:03 2011
> New Revision: 1187160
>
> URL: http://svn.apache.org/viewvc?rev=1187160&view=rev
> Log:
> Ev2 shims: Allow callers to pass the kind of a node when building a delta
> editor tree. Most times, this information will be available for free.
>
> * subversion/libsvn_delta/compat.c
> (build): Add a kind argument, and use it.
> (add_directoy_cb, add_file_cb, set_props_cb, set_text_cb): Update callers.
>
> Modified:
> subversion/trunk/subversion/libsvn_delta/compat.c
>
> Modified: subversion/trunk/subversion/libsvn_delta/compat.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1187160&r1=1187159&r2=1187160&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_delta/compat.c (original)
> +++ subversion/trunk/subversion/libsvn_delta/compat.c Fri Oct 21 01:40:03 2011
> @@ -627,6 +627,7 @@ static svn_error_t *
> build(struct editor_baton *eb,
> action_code_t action,
> const char *relpath,
> + svn_kind_t kind,
> const char *url,
> svn_revnum_t rev,
> apr_hash_t *props,
> @@ -683,8 +684,11 @@ build(struct editor_baton *eb,
> operation->operation =
> operation->operation == OP_DELETE ? OP_REPLACE : OP_ADD;
>
> - SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
> - relpath, scratch_pool));
> + if (kind == svn_kind_none)
> + SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
> + relpath, scratch_pool));
> + else
> + operation->kind = kind;
s/svn_kind_none/svn_kind_unknown/ ?
> operation->copyfrom_url = url;
> operation->copyfrom_revision = rev;
> }
> @@ -704,8 +708,7 @@ build(struct editor_baton *eb,
> }
> else
> {
> - SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
> - relpath, scratch_pool));
> + operation->kind = kind;
> if (operation->kind == svn_kind_file)
> operation->operation = OP_OPEN;
> else if (operation->kind == svn_kind_none)
Re: svn commit: r1187160 - /subversion/trunk/subversion/libsvn_delta/compat.c
Posted by Hyrum K Wright <hy...@wandisco.com>.
On Fri, Oct 21, 2011 at 1:29 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> hwright@apache.org wrote on Fri, Oct 21, 2011 at 01:40:04 -0000:
>> Author: hwright
>> Date: Fri Oct 21 01:40:03 2011
>> New Revision: 1187160
>>
>> URL: http://svn.apache.org/viewvc?rev=1187160&view=rev
>> Log:
>> Ev2 shims: Allow callers to pass the kind of a node when building a delta
>> editor tree. Most times, this information will be available for free.
>>
>> * subversion/libsvn_delta/compat.c
>> (build): Add a kind argument, and use it.
>> (add_directoy_cb, add_file_cb, set_props_cb, set_text_cb): Update callers.
>>
>> Modified:
>> subversion/trunk/subversion/libsvn_delta/compat.c
>>
>> Modified: subversion/trunk/subversion/libsvn_delta/compat.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1187160&r1=1187159&r2=1187160&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_delta/compat.c (original)
>> +++ subversion/trunk/subversion/libsvn_delta/compat.c Fri Oct 21 01:40:03 2011
>> @@ -627,6 +627,7 @@ static svn_error_t *
>> build(struct editor_baton *eb,
>> action_code_t action,
>> const char *relpath,
>> + svn_kind_t kind,
>> const char *url,
>> svn_revnum_t rev,
>> apr_hash_t *props,
>> @@ -683,8 +684,11 @@ build(struct editor_baton *eb,
>> operation->operation =
>> operation->operation == OP_DELETE ? OP_REPLACE : OP_ADD;
>>
>> - SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
>> - relpath, scratch_pool));
>> + if (kind == svn_kind_none)
>> + SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
>> + relpath, scratch_pool));
>> + else
>> + operation->kind = kind;
>
> s/svn_kind_none/svn_kind_unknown/ ?
That's probably appropriate here.
Most of the build/drive code was lifted from svnmucc, but as I spend
more time around it, I'm getting a better feel for the information the
shims have that svnmucc doesn't, and how the paradigm needs to change
for the shim use case. This code will probably evolve quite a bit
still, and I'll keep this change in mind as it does.
-Hyrum
>> operation->copyfrom_url = url;
>> operation->copyfrom_revision = rev;
>> }
>> @@ -704,8 +708,7 @@ build(struct editor_baton *eb,
>> }
>> else
>> {
>> - SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
>> - relpath, scratch_pool));
>> + operation->kind = kind;
>> if (operation->kind == svn_kind_file)
>> operation->operation = OP_OPEN;
>> else if (operation->kind == svn_kind_none)
>
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Re: svn commit: r1187160 - /subversion/trunk/subversion/libsvn_delta/compat.c
Posted by Hyrum K Wright <hy...@wandisco.com>.
On Fri, Oct 21, 2011 at 1:29 AM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> hwright@apache.org wrote on Fri, Oct 21, 2011 at 01:40:04 -0000:
>> Author: hwright
>> Date: Fri Oct 21 01:40:03 2011
>> New Revision: 1187160
>>
>> URL: http://svn.apache.org/viewvc?rev=1187160&view=rev
>> Log:
>> Ev2 shims: Allow callers to pass the kind of a node when building a delta
>> editor tree. Most times, this information will be available for free.
>>
>> * subversion/libsvn_delta/compat.c
>> (build): Add a kind argument, and use it.
>> (add_directoy_cb, add_file_cb, set_props_cb, set_text_cb): Update callers.
>>
>> Modified:
>> subversion/trunk/subversion/libsvn_delta/compat.c
>>
>> Modified: subversion/trunk/subversion/libsvn_delta/compat.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1187160&r1=1187159&r2=1187160&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_delta/compat.c (original)
>> +++ subversion/trunk/subversion/libsvn_delta/compat.c Fri Oct 21 01:40:03 2011
>> @@ -627,6 +627,7 @@ static svn_error_t *
>> build(struct editor_baton *eb,
>> action_code_t action,
>> const char *relpath,
>> + svn_kind_t kind,
>> const char *url,
>> svn_revnum_t rev,
>> apr_hash_t *props,
>> @@ -683,8 +684,11 @@ build(struct editor_baton *eb,
>> operation->operation =
>> operation->operation == OP_DELETE ? OP_REPLACE : OP_ADD;
>>
>> - SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
>> - relpath, scratch_pool));
>> + if (kind == svn_kind_none)
>> + SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
>> + relpath, scratch_pool));
>> + else
>> + operation->kind = kind;
>
> s/svn_kind_none/svn_kind_unknown/ ?
That's probably appropriate here.
Most of the build/drive code was lifted from svnmucc, but as I spend
more time around it, I'm getting a better feel for the information the
shims have that svnmucc doesn't, and how the paradigm needs to change
for the shim use case. This code will probably evolve quite a bit
still, and I'll keep this change in mind as it does.
-Hyrum
>> operation->copyfrom_url = url;
>> operation->copyfrom_revision = rev;
>> }
>> @@ -704,8 +708,7 @@ build(struct editor_baton *eb,
>> }
>> else
>> {
>> - SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
>> - relpath, scratch_pool));
>> + operation->kind = kind;
>> if (operation->kind == svn_kind_file)
>> operation->operation = OP_OPEN;
>> else if (operation->kind == svn_kind_none)
>
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/