[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] fix for wrong svn_node_kind_t in r38893

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Tue, 25 Aug 2009 12:50:55 +0200

On Tue, Aug 25, 2009 at 01:45:45AM +0000, Greg Stein wrote:
> > The error returned from get_entry_versioned() is determined like this:
> >
> > * subversion/libsvn_wc/entries.c (svn_wc__get_entry_versioned)
> >
> > if (err && (err->apr_err == SVN_ERR_WC_MISSING
> > || err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND
> > || err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND))
> > {
> > svn_error_clear(err);
> > *entry = NULL;
> > }
> >
> > ....
> >
> > if (! *entry)
> > return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
> > _("'%s' is not under version control"),
> > svn_dirent_local_style(local_abspath,
> > scratch_pool));
>
> Right. In this case, the error computation might actually be wrong. If
> you state a kind, but get back something else, then it simply
> "pretends" the node is not versioned. That is probably wrong.
>
> Regardless of the error handling here, the base issue is that
> svn_wc__get_entry() takes a kind representative of the *expected
> entry*, and should be changed.
 
I skip the discussion whether the errors are the right ones. But if I
were to catch an error and ignore it or replace it I would put in a
little comment to describe why I did it.

In init_patch_target() I assume that the target can only refer to a
file. The doc comment begins like this:

 /* Attempt to initialize a patch TARGET structure for a target file
  * described by PATCH.

make check PASSED.

[[[
Follow up to r38893. Changed svn_node_kind_t to use the kind of the
entry rather than the kind of the node on disk.

* subversion/libsvn_client/patch.c
  (merge_file_changed, merge_file_added): Set kind to svn_node_file.
  (merge_dir_added): Set kind to svn_node_dir.
  (init_patch_target): Set kind to svn_node_file.
]]]

Mvh
Daniel

Received on 2009-08-27 00:06:59 CEST

This is an archived mail posted to the Subversion Dev mailing list.