You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2005/10/03 21:58:08 UTC

Re: svn commit: r16423 - branches/wc-replacements/subversion/libsvn_wc

zhakov@tigris.org writes:

> Author: zhakov
> Date: Mon Oct  3 10:23:50 2005
> New Revision: 16423

> --- branches/wc-replacements/subversion/libsvn_wc/adm_ops.c	(original)
> +++ branches/wc-replacements/subversion/libsvn_wc/adm_ops.c	Mon Oct  3 10:23:50 2005
> @@ -40,6 +40,7 @@
>  #include "svn_io.h"
>  #include "svn_md5.h"
>  #include "svn_xml.h"
> +#include "svn_time.h"
>  
>  #include "wc.h"
>  #include "log.h"
> @@ -577,6 +578,107 @@
>  }
>  
>  
> +static svn_error_t *
> +loggy_move_copy_internal (svn_stringbuf_t **log_accum,
> +                          svn_boolean_t *dst_modified,
> +                          const char *move_copy_op,
> +                          svn_wc_adm_access_t *adm_access,
> +                          const char *src_path, const char *dst_path,
> +                          svn_boolean_t remove_dst_if_no_src,
> +                          apr_pool_t *pool)
> +{
> +  svn_node_kind_t kind;
> +  const char *full_src = svn_path_join (svn_wc_adm_access_path(adm_access),
> +                                        src_path, pool);
> +
> +  /* Does this file exist?  If not, get outta here. */

That comment doesn't seem to match the code.

> +  SVN_ERR (svn_io_check_path (full_src, &kind, pool));
> +  if (kind == svn_node_none)
> +    {
> +      if (remove_dst_if_no_src)
> +        {
> +          svn_xml_make_open_tag (log_accum, pool,
> +                                 svn_xml_self_closing,
> +                                 SVN_WC__LOG_RM,
> +                                 SVN_WC__LOG_ATTR_NAME,
> +                                 dst_path,
> +                                 NULL);
> +          if (dst_modified)
> +            *dst_modified = TRUE;
> +        }
> +    }
> +  else
> +    {
> +      svn_xml_make_open_tag (log_accum, pool,
> +                             svn_xml_self_closing,
> +                             move_copy_op,
> +                             SVN_WC__LOG_ATTR_NAME,
> +                             src_path,
> +                             SVN_WC__LOG_ATTR_DEST,
> +                             dst_path,
> +                             NULL);
> +      if (dst_modified)
> +        *dst_modified = TRUE;
> +    }
> +
> +  return SVN_NO_ERROR;
> +}
> +
> +/* Logs BASE_NAME for remove to LOG_ACCUM if it exists and is a file.
> +   If it does not exist, do nothing. */
> +static svn_error_t *
> +loggy_remove_file_if_present (svn_stringbuf_t **log_accum,
> +                              svn_wc_adm_access_t *adm_access,
> +                              const char *base_name, apr_pool_t *pool)
> +{
> +  svn_node_kind_t kind;
> +  const char *full_path = svn_path_join (svn_wc_adm_access_path(adm_access),
> +                                          base_name, pool);
> +
> +  /* Does this file exist?  If not, get outta here. */
> +  SVN_ERR (svn_io_check_path (full_path, &kind, pool));
> +  if (kind == svn_node_none)
> +    return SVN_NO_ERROR;

I see, it's a cut-n-paste comment :D  As far as I am concerned it
doesn't add any useful information, I'd be happy to see it removed.

> +
> +  /* Else, remove the file. */

The same goes with for that one.

> +  svn_xml_make_open_tag (log_accum, pool,
> +                         svn_xml_self_closing,
> +                         SVN_WC__LOG_RM,
> +                         SVN_WC__LOG_ATTR_NAME,
> +                         base_name,
> +                         NULL);
> +
> +  return SVN_NO_ERROR;
> +}

-- 
Philip Martin

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

Re: svn commit: r16423 - branches/wc-replacements/subversion/libsvn_wc

Posted by Ivan Zhakov <ch...@gmail.com>.
Hi, Philip!

On 10/4/05, Philip Martin <ph...@codematters.co.uk> wrote:
> zhakov@tigris.org writes:
>
> > Author: zhakov
> > Date: Mon Oct  3 10:23:50 2005
> > New Revision: 16423
>
> > --- branches/wc-replacements/subversion/libsvn_wc/adm_ops.c   (original)
> > +++ branches/wc-replacements/subversion/libsvn_wc/adm_ops.c   Mon Oct  3 10:23:50 2005
> > @@ -40,6 +40,7 @@
> >  #include "svn_io.h"
> >  #include "svn_md5.h"
> >  #include "svn_xml.h"
> > +#include "svn_time.h"
> >
> >  #include "wc.h"
> >  #include "log.h"
> > @@ -577,6 +578,107 @@
> >  }
> >
> >
> > +static svn_error_t *
> > +loggy_move_copy_internal (svn_stringbuf_t **log_accum,
> > +                          svn_boolean_t *dst_modified,
> > +                          const char *move_copy_op,
> > +                          svn_wc_adm_access_t *adm_access,
> > +                          const char *src_path, const char *dst_path,
> > +                          svn_boolean_t remove_dst_if_no_src,
> > +                          apr_pool_t *pool)
> > +{
> > +  svn_node_kind_t kind;
> > +  const char *full_src = svn_path_join (svn_wc_adm_access_path(adm_access),
> > +                                        src_path, pool);
> > +
> > +  /* Does this file exist?  If not, get outta here. */
>
> That comment doesn't seem to match the code.
>
> > +  SVN_ERR (svn_io_check_path (full_src, &kind, pool));
> > +  if (kind == svn_node_none)
> > +    {
> > +      if (remove_dst_if_no_src)
> > +        {
> > +          svn_xml_make_open_tag (log_accum, pool,
> > +                                 svn_xml_self_closing,
> > +                                 SVN_WC__LOG_RM,
> > +                                 SVN_WC__LOG_ATTR_NAME,
> > +                                 dst_path,
> > +                                 NULL);
> > +          if (dst_modified)
> > +            *dst_modified = TRUE;
> > +        }
> > +    }
> > +  else
> > +    {
> > +      svn_xml_make_open_tag (log_accum, pool,
> > +                             svn_xml_self_closing,
> > +                             move_copy_op,
> > +                             SVN_WC__LOG_ATTR_NAME,
> > +                             src_path,
> > +                             SVN_WC__LOG_ATTR_DEST,
> > +                             dst_path,
> > +                             NULL);
> > +      if (dst_modified)
> > +        *dst_modified = TRUE;
> > +    }
> > +
> > +  return SVN_NO_ERROR;
> > +}
> > +
> > +/* Logs BASE_NAME for remove to LOG_ACCUM if it exists and is a file.
> > +   If it does not exist, do nothing. */
> > +static svn_error_t *
> > +loggy_remove_file_if_present (svn_stringbuf_t **log_accum,
> > +                              svn_wc_adm_access_t *adm_access,
> > +                              const char *base_name, apr_pool_t *pool)
> > +{
> > +  svn_node_kind_t kind;
> > +  const char *full_path = svn_path_join (svn_wc_adm_access_path(adm_access),
> > +                                          base_name, pool);
> > +
> > +  /* Does this file exist?  If not, get outta here. */
> > +  SVN_ERR (svn_io_check_path (full_path, &kind, pool));
> > +  if (kind == svn_node_none)
> > +    return SVN_NO_ERROR;
>
> I see, it's a cut-n-paste comment :D  As far as I am concerned it
> doesn't add any useful information, I'd be happy to see it removed.
>
> > +
> > +  /* Else, remove the file. */
>
> The same goes with for that one.
>
> > +  svn_xml_make_open_tag (log_accum, pool,
> > +                         svn_xml_self_closing,
> > +                         SVN_WC__LOG_RM,
> > +                         SVN_WC__LOG_ATTR_NAME,
> > +                         base_name,
> > +                         NULL);
> > +
> > +  return SVN_NO_ERROR;
> > +}
Thanks. I have fixed this and other stylistic issues in r16441.

--
Ivan Zhakov