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/11/18 16:26:06 UTC

Re: svn commit: r1203687 - /subversion/trunk/subversion/svn/status.c


On Friday, November 18, 2011 3:12 PM, cmpilato@apache.org wrote:
> Author: cmpilato
> Date: Fri Nov 18 15:12:03 2011
> New Revision: 1203687
> 
> URL: http://svn.apache.org/viewvc?rev=1203687&view=rev
> Log:
> For issue #1935 ("svn status too verbose with svn:externals
> definitions"), continue trying to refile the filtering of "X" lines.
> 
> * subversion/svn/status.c
>   (svn_cl__print_status): Iterate on the logic which filters out
>     boring "X" lines.
> 
> Reported by: rhuijben
> 
> Modified:
>     subversion/trunk/subversion/svn/status.c
> 
> Modified: subversion/trunk/subversion/svn/status.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/status.c?rev=1203687&r1=1203686&r2=1203687&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svn/status.c (original)
> +++ subversion/trunk/subversion/svn/status.c Fri Nov 18 15:12:03 2011
> @@ -548,12 +548,27 @@ svn_cl__print_status(const char *cwd_abs
>            && status->repos_node_status == svn_wc_status_none))
>      return SVN_NO_ERROR;
>  
> +  /* If we're trying not to print boring "X  /path/to/external"
> +     lines..." */
>    if (suppress_externals_placeholders)
>      {
> -      if (status->node_status == svn_wc_status_external)
> +      /* ... skip regular externals unmodified in the repository. */
> +      if ((status->node_status == svn_wc_status_external)
> +          && (status->repos_node_status == svn_wc_status_none))
>          return SVN_NO_ERROR;
> -      if ((status->node_status == svn_wc_status_normal)
> -          && (status->file_external))
> +
> +      /* ... skip file externals that aren't modified locally or
> +         remotely, changelisted, or locked (in either sense of the
> +         word). */
> +      if ((status->file_external)
> +          && (status->repos_node_status == svn_wc_status_none)
> +          && ((status->node_status == svn_wc_status_normal)
> +              || (status->node_status == svn_wc_status_none))
> +          && ((status->prop_status == svn_wc_status_normal)
> +              || (status->prop_status == svn_wc_status_none))
> +          && (! status->changelist)
> +          && (! status->lock)
> +          && (! status->wc_is_locked))

Forward compatibility?

If we add a status->foo flag (like we added the status->changelist bit
in 1.4), we would have to explicitly add it to this if() too --- which is
too easy to forget.

>          return SVN_NO_ERROR;
>      }
>  
> 
> 
> 

Re: svn commit: r1203687 - /subversion/trunk/subversion/svn/status.c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
On Friday, November 18, 2011 10:36 AM, "C. Michael Pilato" <cm...@collab.net> wrote:
> On 11/18/2011 10:26 AM, Daniel Shahaf wrote:
> > If we add a status->foo flag (like we added the status->changelist bit
> > in 1.4), we would have to explicitly add it to this if() too --- which is
> > too easy to forget.
> 
> Do you have a concrete suggestion for making this future-proof?

No.

> If not,
> we'll simply have to trust that anyone brave enough to add such a new flag
> is also either smart enough to review all consumers of the structure or

"Review all consumers" is not really doable for a public API.

> mature enough to deal with it when someone eventually blames him or her for
> not doing so.  :-)
> 

Re: svn commit: r1203687 - /subversion/trunk/subversion/svn/status.c

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 11/18/2011 10:26 AM, Daniel Shahaf wrote:
> If we add a status->foo flag (like we added the status->changelist bit
> in 1.4), we would have to explicitly add it to this if() too --- which is
> too easy to forget.

Do you have a concrete suggestion for making this future-proof?  If not,
we'll simply have to trust that anyone brave enough to add such a new flag
is also either smart enough to review all consumers of the structure or
mature enough to deal with it when someone eventually blames him or her for
not doing so.  :-)

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