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

svn patch says 'skipped missing target' on obstruction

From: Julian Foad <julianfoad_at_gmail.com>
Date: Fri, 5 Jun 2015 12:23:45 +0100

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

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.