You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Glasser <gl...@davidglasser.net> on 2008/03/31 20:58:43 UTC

Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

On Wed, Mar 19, 2008 at 10:48 AM,  <bh...@tigris.org> wrote:
> Author: bhuvan
>  Date: Wed Mar 19 10:48:51 2008
>  New Revision: 29961
>
>  Log:
>  This is a follow-up for r29948. Rename the macro which checks if
>  revision kind is dependent on a WC. Use the new macro wherever it is
>  applicable.
>
>  * subversion/include/svn_client.h
>   (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND): Move this macro ...
>  * subversion/libsvn_client/client.h
>   (SVN_CLIENT__REVKIND_NEEDS_WC) ... to here and rename it.

I see I commented on r29948 before reading all my mail.

I still think it should be in svn_opt (so that it can be adjusted for
future revision kinds), and should have a name without the new term
"revkind".

--dave

>  * subversion/libsvn_client/copy.c
>   (setup_copy): Use the macro.
>  * subversion/libsvn_client/log.c
>   (svn_client_log4): Use the new macro.
>
>  Suggested by: kfogel
>  Approved by: kfogel
>
>  Modified:
>    trunk/subversion/include/svn_client.h
>    trunk/subversion/libsvn_client/client.h
>    trunk/subversion/libsvn_client/copy.c
>    trunk/subversion/libsvn_client/log.c
>
>  Modified: trunk/subversion/include/svn_client.h
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_client.h?pathrev=29961&r1=29960&r2=29961
>  ==============================================================================
>  --- trunk/subversion/include/svn_client.h       Wed Mar 19 10:29:38 2008        (r29960)
>  +++ trunk/subversion/include/svn_client.h       Wed Mar 19 10:48:51 2008        (r29961)
>  @@ -4303,16 +4303,6 @@ svn_client_open_ra_session(svn_ra_sessio
>
>   /** @} */
>
>  -/** Return TRUE iff revision kind is dependent on the working copy.
>  - * Otherwise, return FALSE.
>  - *
>  - * @since New in 1.6.
>  - */
>  -#define SVN_CLIENT_IS_WC_DEPENDENT_REVKIND(kind)                           \
>  -  ((kind == svn_opt_revision_base || kind == svn_opt_revision_previous ||  \
>  -   kind == svn_opt_revision_working || kind == svn_opt_revision_committed) \
>  -   ? TRUE : FALSE)
>  -
>   #ifdef __cplusplus
>   }
>   #endif /* __cplusplus */
>
>  Modified: trunk/subversion/libsvn_client/client.h
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/client.h?pathrev=29961&r1=29960&r2=29961
>  ==============================================================================
>  --- trunk/subversion/libsvn_client/client.h     Wed Mar 19 10:29:38 2008        (r29960)
>  +++ trunk/subversion/libsvn_client/client.h     Wed Mar 19 10:48:51 2008        (r29961)
>  @@ -1059,6 +1059,17 @@ svn_error_t *svn_client__get_revprop_tab
>                                             svn_client_ctx_t *ctx,
>                                             apr_pool_t *pool);
>
>  +
>  +/** Return TRUE iff revision kind is dependent on the working copy.
>  + * Otherwise, return FALSE.
>  + */
>  +#define SVN_CLIENT__REVKIND_NEEDS_WC(kind)                                 \
>  +  (((kind) == svn_opt_revision_base ||                                     \
>  +   (kind) == svn_opt_revision_previous ||                                  \
>  +   (kind) == svn_opt_revision_working ||                                   \
>  +   (kind) == svn_opt_revision_committed)                                   \
>  +   ? TRUE : FALSE)
>  +
>
>   #ifdef __cplusplus
>   }
>
>  Modified: trunk/subversion/libsvn_client/copy.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/copy.c?pathrev=29961&r1=29960&r2=29961
>  ==============================================================================
>  --- trunk/subversion/libsvn_client/copy.c       Wed Mar 19 10:29:38 2008        (r29960)
>  +++ trunk/subversion/libsvn_client/copy.c       Wed Mar 19 10:48:51 2008        (r29961)
>  @@ -1711,9 +1711,7 @@ setup_copy(svn_commit_info_t **commit_in
>          ((svn_client_copy_source_t **) (sources->elts))[i];
>
>        if (svn_path_is_url(source->path)
>  -          && (source->peg_revision->kind == svn_opt_revision_base
>  -              || source->peg_revision->kind == svn_opt_revision_committed
>  -              || source->peg_revision->kind == svn_opt_revision_previous))
>  +          && (SVN_CLIENT__REVKIND_NEEDS_WC(source->peg_revision->kind)))
>          return svn_error_create
>            (SVN_ERR_CLIENT_BAD_REVISION, NULL,
>             _("Revision type requires a working copy path, not a URL"));
>
>  Modified: trunk/subversion/libsvn_client/log.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_client/log.c?pathrev=29961&r1=29960&r2=29961
>  ==============================================================================
>  --- trunk/subversion/libsvn_client/log.c        Wed Mar 19 10:29:38 2008        (r29960)
>  +++ trunk/subversion/libsvn_client/log.c        Wed Mar 19 10:48:51 2008        (r29961)
>  @@ -326,9 +326,9 @@ svn_client_log4(const apr_array_header_t
>    /* Use the passed URL, if there is one.  */
>    if (svn_path_is_url(url_or_path))
>      {
>  -      if (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND(peg_revision->kind) ||
>  -          SVN_CLIENT_IS_WC_DEPENDENT_REVKIND(start->kind) ||
>  -          SVN_CLIENT_IS_WC_DEPENDENT_REVKIND(end->kind))
>  +      if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind) ||
>  +          SVN_CLIENT__REVKIND_NEEDS_WC(start->kind) ||
>  +          SVN_CLIENT__REVKIND_NEEDS_WC(end->kind))
>
>          return svn_error_create
>            (SVN_ERR_CLIENT_BAD_REVISION, NULL,
>  @@ -433,7 +433,7 @@ svn_client_log4(const apr_array_header_t
>      /* If this is a revision type that requires access to the working copy,
>       * we use our initial target path to figure out where to root the RA
>       * session, otherwise we use our URL. */
>  -    if (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND(peg_revision->kind))
>  +    if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind))
>        SVN_ERR(svn_path_condense_targets(&ra_target, NULL, targets, TRUE, pool));
>      else
>        ra_target = url_or_path;
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
>  For additional commands, e-mail: svn-help@subversion.tigris.org
>
>



-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

Posted by Julian Foad <ju...@btopenworld.com>.
David Glasser wrote:
>> * subversion/libsvn_client/client.h
>>  (SVN_CLIENT__REVKIND_NEEDS_WC) ... to here and rename it.
> 
> I still think it should be in svn_opt (so that it can be adjusted for
> future revision kinds), and should have a name without the new term
> "revkind".

Fair points, David, but it's fine for it to start off as a private symbol 
within libsvn_client. It can be made more public and have the name improved if 
and when it's wanted more globally.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

Posted by Kamesh Jayachandran <ka...@collab.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Bhuvaneswaran A wrote:
> On Wed, 2008-04-02 at 12:31 +0530, Kamesh Jayachandran wrote:
>>>>  * subversion/include/svn_client.h
>>>>   (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND): Move this macro ...
>>>>  * subversion/libsvn_client/client.h
>>>>   (SVN_CLIENT__REVKIND_NEEDS_WC) ... to here and rename it.
>> I just realized do we need SVN_CLIENT__REVKIND_NEEDS_WC at all as we
>> already have svn_client__revision_is_local?
> 
> If i'm right, in SVN_CLIENT__REVKIND_NEEDS_WC macro, we check for
> following revisions:
>   svn_opt_revision_base
>   svn_opt_revision_previous
>   svn_opt_revision_working
>   svn_opt_revision_committed
> 
> whereas, in svn_client__revision_is_local() function we check for
> following revisions:
>   svn_opt_revision_unspecified
>   svn_opt_revision_head
>   svn_opt_revision_number
>   svn_opt_revision_date

See the return value 'svn_client__revision_is_local' returns FALSE if
revisionkind belongs to anyone of {unspecified, head, number, date}
otherwise(base, previous, working, committed) returns TRUE same as
SVN_CLIENT__REVKIND_NEEDS_WC.

With regards
Kamesh Jayachandran
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8zOK3WHvyO0YTCwRAvnqAJ9w/6XSrjIGsyjuW0ZFuQBWelueKwCeM1rn
JUSO9kAIB/SANCDVgZrA7qs=
=wqtr
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

Posted by Kamesh Jayachandran <ka...@collab.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



David Glasser wrote:
> On Wed, Apr 2, 2008 at 12:10 AM, Bhuvaneswaran Arumugam
> <bh...@collab.net> wrote:
>>  On Wed, 2008-04-02 at 12:31 +0530, Kamesh Jayachandran wrote:
>>  > >>
>>  > >>  * subversion/include/svn_client.h
>>  > >>   (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND): Move this macro ...
>>  > >>  * subversion/libsvn_client/client.h
>>  > >>   (SVN_CLIENT__REVKIND_NEEDS_WC) ... to here and rename it.
>>  > >
>>  >
>>  > I just realized do we need SVN_CLIENT__REVKIND_NEEDS_WC at all as we
>>  > already have svn_client__revision_is_local?
>>
>>  If i'm right, in SVN_CLIENT__REVKIND_NEEDS_WC macro, we check for
>>  following revisions:
>>   svn_opt_revision_base
>>   svn_opt_revision_previous
>>   svn_opt_revision_working
>>   svn_opt_revision_committed
>>
>>  whereas, in svn_client__revision_is_local() function we check for
>>  following revisions:
>>   svn_opt_revision_unspecified
>>   svn_opt_revision_head
>>   svn_opt_revision_number
>>   svn_opt_revision_date
> 
> Huh.  svn_client__revision_is_local is weird.  Why wouldn't
> svn_opt_revision_number be "local"?  It doesn't require the repository
> to resolve it...

The implementation is kind of negative logic.

As it is not used either we can remove it(after all a intra library
function and our compatibility rules allow it) or we can change its
logic to a positive logic.

With regards
Kamesh Jayachandran
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8zfm3WHvyO0YTCwRAg2XAJ92cMVw4PibVZCH4ZUAUzn6WmaaaQCdEi7n
F58wdBUCJnM/3uA2ef8wkBA=
=xVtx
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

Posted by "C. Michael Pilato" <cm...@collab.net>.
David Glasser wrote:
> Huh.  svn_client__revision_is_local is weird.  Why wouldn't
> svn_opt_revision_number be "local"?  It doesn't require the repository
> to resolve it...

While the number doesn't require a network to resolve it, we need the 
network to examine the item associated with that revision.  I think that's 
the question the svn_client__revision_is_local() is trying to resolve.  The 
function's name is confusing.  It probably should be more like 
svn_client__object_is_local() or something.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

Posted by David Glasser <gl...@davidglasser.net>.
On Wed, Apr 2, 2008 at 12:10 AM, Bhuvaneswaran Arumugam
<bh...@collab.net> wrote:
>
>  On Wed, 2008-04-02 at 12:31 +0530, Kamesh Jayachandran wrote:
>  > >>
>  > >>  * subversion/include/svn_client.h
>  > >>   (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND): Move this macro ...
>  > >>  * subversion/libsvn_client/client.h
>  > >>   (SVN_CLIENT__REVKIND_NEEDS_WC) ... to here and rename it.
>  > >
>  >
>  > I just realized do we need SVN_CLIENT__REVKIND_NEEDS_WC at all as we
>  > already have svn_client__revision_is_local?
>
>  If i'm right, in SVN_CLIENT__REVKIND_NEEDS_WC macro, we check for
>  following revisions:
>   svn_opt_revision_base
>   svn_opt_revision_previous
>   svn_opt_revision_working
>   svn_opt_revision_committed
>
>  whereas, in svn_client__revision_is_local() function we check for
>  following revisions:
>   svn_opt_revision_unspecified
>   svn_opt_revision_head
>   svn_opt_revision_number
>   svn_opt_revision_date

Huh.  svn_client__revision_is_local is weird.  Why wouldn't
svn_opt_revision_number be "local"?  It doesn't require the repository
to resolve it...

Of course, the function isn't actually used any more.

--dave



-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

Posted by Bhuvaneswaran Arumugam <bh...@collab.net>.
On Wed, 2008-04-02 at 12:31 +0530, Kamesh Jayachandran wrote:
> >>
> >>  * subversion/include/svn_client.h
> >>   (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND): Move this macro ...
> >>  * subversion/libsvn_client/client.h
> >>   (SVN_CLIENT__REVKIND_NEEDS_WC) ... to here and rename it.
> > 
> 
> I just realized do we need SVN_CLIENT__REVKIND_NEEDS_WC at all as we
> already have svn_client__revision_is_local?

If i'm right, in SVN_CLIENT__REVKIND_NEEDS_WC macro, we check for
following revisions:
  svn_opt_revision_base
  svn_opt_revision_previous
  svn_opt_revision_working
  svn_opt_revision_committed

whereas, in svn_client__revision_is_local() function we check for
following revisions:
  svn_opt_revision_unspecified
  svn_opt_revision_head
  svn_opt_revision_number
  svn_opt_revision_date
-- 
Regards,
Bhuvaneswaran

Re: svn commit: r29961 - in trunk/subversion: include libsvn_client

Posted by Kamesh Jayachandran <ka...@collab.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>
>>  * subversion/include/svn_client.h
>>   (SVN_CLIENT_IS_WC_DEPENDENT_REVKIND): Move this macro ...
>>  * subversion/libsvn_client/client.h
>>   (SVN_CLIENT__REVKIND_NEEDS_WC) ... to here and rename it.
> 

I just realized do we need SVN_CLIENT__REVKIND_NEEDS_WC at all as we
already have svn_client__revision_is_local?

With regards
Kamesh Jayachandran
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8y9n3WHvyO0YTCwRAlFYAJ4mLUTb0Rfng4OvPRRROITVlj3fjgCfabVJ
WvqXELEnQkuNsymN3z/574I=
=w2Qe
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org