With a recent trunk build, I noticed this problem with attempting to
apply an 'add a file' patch while an unversioned file already exists:
[[[
$ echo hello > f
$ svn add f
A f
$ svn diff f > f.patch
$ svn revert f # Note that this leaves 'f' on disk
Reverted 'f'
$ svn patch f.patch
Skipped missing target: 'f'
Summary of conflicts:
Skipped paths: 1
]]]
The immediate bug here is that I expect the error message to say something like:
Skipped adding target: 'f' -- obstructed by unversioned file 'f'
The problem seems to be in this block in patch.c:send_patch_notification():
[[[
if (action == svn_wc_notify_skip)
{
if (target->db_kind == svn_node_none ||
target->db_kind == svn_node_unknown)
notify->content_state = svn_wc_notify_state_missing;
else if (target->db_kind == svn_node_dir)
notify->content_state = svn_wc_notify_state_obstructed;
else
notify->content_state = svn_wc_notify_state_unknown;
}
]]]
The db_kind is 'none' but the content_state should (I think) be
'obstructed'. If we just fix that part, the message will be simply
"Skipped 'f'". To get a better message we'll also have to add
something in notify.c:notify_body(), such as:
[[[
Index: subversion/svn/notify.c
===================================================================
--- subversion/svn/notify.c (revision 1682837)
+++ subversion/svn/notify.c (working copy)
@@ -253,6 +253,13 @@ notify_body(struct notify_baton *nb,
_("Skipped target: '%s' -- copy-source is missing\n"),
path_local));
}
+ else if (n->content_state == svn_wc_notify_state_obstructed)
+ {
+ SVN_ERR(svn_cmdline_printf(
+ pool,
+ _("Skipped target: '%s' -- obstruction on disk\n"),
+ path_local));
+ }
else
{
SVN_ERR(svn_cmdline_printf(pool, _("Skipped '%s'\n"), path_local));
]]]
- Julian
Received on 2015-06-05 13:24:34 CEST