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 2018/09/17 17:30:16 UTC

'svn info --viewspec' has an if (TRUE)

From subversion/svn/info-cmd.c:

   246	cl_layout_list(apr_array_header_t *targets,
   ⋮
   272	  if (TRUE)
   273	    {
   274	      /* svn-viewspec.py format */
   275	      llb.vs_py_format = 2;
   276	
   277	      SVN_ERR(svn_client_layout_list(list_abspath,
   278	                                     output_svn_viewspec_py, &llb,
   279	                                     ctx, scratch_pool));
   280	    }
   281	  else
   282	    {
   283	      /* svn command-line format */
   284	      SVN_ERR(svn_client_layout_list(list_abspath,
   285	                                     output_svn_command_line, &llb,
   286	                                     ctx, scratch_pool));
   287	    }

Why is there an «if (TRUE)» there?  Should that condition be exposed a
command-line option, or removed?

Re: 'svn info --viewspec' has an if (TRUE)

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Julian Foad wrote on Mon, 17 Sep 2018 20:39 +0100:
> Daniel Shahaf wrote:
> > From subversion/svn/info-cmd.c:
> >    272	  if (TRUE)
> >    274	      /* svn-viewspec.py format */
> >    281	  else
> >    283	      /* svn command-line format */
> > 
> > Why is there an «if (TRUE)» there?  Should that condition be exposed a
> > command-line option, or removed?
> 
> For experimenting with viewspec output, I feel both formats are about 
> equally useful at this stage, neither is ideal, and neither is likely 
> what an eventual stable format should be. That's based on knowing that 
> cmdline is practical for testing and assuming that there are some users 
> using viewspec.py (e.g. Paul Hammant recently contributed a regression 
> test suite for it).
> 
> I was thinking to add a cmdline option to select, for the time being. 
> IIRC Brane said "pick one and be done with it". That's as far as we got. 
> I still favour adding a user-selectable option, e.g. "--x-viewspec={cmdline|svn-viewspec.py}" (ugly, I know).

I agree.  The API is experimental so exposing a second output mode
doesn't restrict our options going forward.  r1841272.

Cheers,

Daniel

Re: 'svn info --viewspec' has an if (TRUE)

Posted by Julian Foad <ju...@apache.org>.
Daniel Shahaf wrote:
> From subversion/svn/info-cmd.c:
>    272	  if (TRUE)
>    274	      /* svn-viewspec.py format */
>    281	  else
>    283	      /* svn command-line format */
> 
> Why is there an «if (TRUE)» there?  Should that condition be exposed a
> command-line option, or removed?

For experimenting with viewspec output, I feel both formats are about equally useful at this stage, neither is ideal, and neither is likely what an eventual stable format should be. That's based on knowing that cmdline is practical for testing and assuming that there are some users using viewspec.py (e.g. Paul Hammant recently contributed a regression test suite for it).

I was thinking to add a cmdline option to select, for the time being. IIRC Brane said "pick one and be done with it". That's as far as we got. I still favour adding a user-selectable option, e.g. "--x-viewspec={cmdline|svn-viewspec.py}" (ugly, I know).

-- 
- Julian