Subject: [PATCH] vc-svn-ignore sets incorrect properties for relative filenames

From: Wolfgang Scherer <[email-masked]>
Date: Thu, 29 Aug 2019 01:39:48 +0200

If a relative filename has at least one level of parent
directories, `vc-svn-ignore' fails to add the ignore spec to the
correct subdirectory.

The attached patch fixes that error.

From dc6484a72161c251e213d40ea1b750b3a366608c Mon Sep 17 00:00:00 2001
From: Wolfgang Scherer <[email-masked]>
Date: Thu, 29 Aug 2019 01:37:23 +0200
Subject: [PATCH] Set correct svn:ignore property for relative filenames

* lisp/vc/vc-svn.el: (vc-svn-ignore) Use svn:ignore property of
immediate parent directory for wildcard specification.
---
 lisp/vc/vc-svn.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 3c50c8f..7196394 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -353,15 +353,18 @@ to the SVN command."

 (defun vc-svn-ignore (file &optional directory remove)
   "Ignore FILE under Subversion.
-FILE is a file wildcard, relative to the root directory of DIRECTORY."
-  (let* ((ignores (vc-svn-ignore-completion-table directory))
-         (file (file-relative-name file directory))
+FILE is a wildcard specification, either relative to
+DIRECTORY or absolute."
+  (let* ((path (directory-file-name (expand-file-name file directory)))
+         (directory (file-name-directory path))
+         (file (file-name-nondirectory path))
+         (ignores (vc-svn-ignore-completion-table directory))
          (ignores (if remove
                       (delete file ignores)
                     (push file ignores))))
     (vc-svn-command nil 0 nil nil "propset" "svn:ignore"
                     (mapconcat #'identity ignores "\n")
-                    (expand-file-name directory))))
+                    directory)))

 (defun vc-svn-ignore-completion-table (directory)
   "Return the list of ignored files in DIRECTORY."
--
2.7.4