You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/01/26 14:41:04 UTC
svn commit: r903224 - /subversion/trunk/subversion/libsvn_client/patch.c
Author: stsp
Date: Tue Jan 26 13:41:04 2010
New Revision: 903224
URL: http://svn.apache.org/viewvc?rev=903224&view=rev
Log:
* subversion/libsvn_client/patch.c
(resolve_target_path): Correctly determine the on-disk kind of
missing/obstructed/unversioned targets. These were all reported
as "missing" even though they might exist on disk.
Also, return early when skipping the target, rather than using
longish if-else clauses.
Modified:
subversion/trunk/subversion/libsvn_client/patch.c
Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=903224&r1=903223&r2=903224&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Tue Jan 26 13:41:04 2010
@@ -268,45 +268,44 @@
status->text_status == svn_wc_status_ignored ||
status->text_status == svn_wc_status_obstructed)
{
- target->skipped = TRUE;
- target->kind = svn_node_none;
+ target->skipped = TRUE;
+ SVN_ERR(svn_io_check_path(target->abs_path, &target->kind,
+ scratch_pool));
+ return SVN_NO_ERROR;
}
- else
- {
- /* Deduce some information about the target from its kind. */
- SVN_ERR(svn_wc__node_get_kind(&target->kind, wc_ctx, target->abs_path,
- FALSE, scratch_pool));
- switch (target->kind)
- {
- case svn_node_file:
- target->added = FALSE;
- target->parent_dir_exists = TRUE;
- break;
- case svn_node_none:
- case svn_node_unknown:
- {
- const char *abs_dirname;
- svn_node_kind_t kind;
- /* The file is not there, that's fine. The patch might want to
- * create it. Check if the containing directory of the target
- * exists. We may need to create it later. */
- target->added = TRUE;
- abs_dirname = svn_dirent_dirname(target->abs_path, scratch_pool);
- SVN_ERR(svn_wc__node_get_kind(&kind, wc_ctx, abs_dirname,
- FALSE, scratch_pool));
- SVN_ERR(svn_wc_status3(&status, wc_ctx, abs_dirname,
- scratch_pool, scratch_pool));
- target->parent_dir_exists =
- (kind == svn_node_dir &&
- status->text_status != svn_wc_status_deleted &&
- status->text_status != svn_wc_status_missing);
- break;
- }
- default:
- target->skipped = TRUE;
- break;
+ SVN_ERR(svn_wc__node_get_kind(&target->kind, wc_ctx, target->abs_path,
+ FALSE, scratch_pool));
+ switch (target->kind)
+ {
+ case svn_node_file:
+ target->added = FALSE;
+ target->parent_dir_exists = TRUE;
+ break;
+ case svn_node_none:
+ case svn_node_unknown:
+ {
+ const char *abs_dirname;
+ svn_node_kind_t kind;
+
+ /* The file is not there, that's fine. The patch might want to
+ * create it. Check if the containing directory of the target
+ * exists. We may need to create it later. */
+ target->added = TRUE;
+ abs_dirname = svn_dirent_dirname(target->abs_path, scratch_pool);
+ SVN_ERR(svn_wc__node_get_kind(&kind, wc_ctx, abs_dirname,
+ FALSE, scratch_pool));
+ SVN_ERR(svn_wc_status3(&status, wc_ctx, abs_dirname,
+ scratch_pool, scratch_pool));
+ target->parent_dir_exists =
+ (kind == svn_node_dir &&
+ status->text_status != svn_wc_status_deleted &&
+ status->text_status != svn_wc_status_missing);
+ break;
}
+ default:
+ target->skipped = TRUE;
+ break;
}
return SVN_NO_ERROR;