unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37216: [PATCH] vc-svn-ignore sets incorrect properties for relative filenames
@ 2019-08-28 23:39 Wolfgang Scherer
  2019-09-15 13:07 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Scherer @ 2019-08-28 23:39 UTC (permalink / raw)
  To: 37216

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Set-correct-svn-ignore-property-for-relative-filenam.patch --]
[-- Type: text/x-patch; name="0001-Set-correct-svn-ignore-property-for-relative-filenam.patch", Size: 1678 bytes --]

From dc6484a72161c251e213d40ea1b750b3a366608c Mon Sep 17 00:00:00 2001
From: Wolfgang Scherer <wolfgang.scherer@gmx.de>
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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#37216: [PATCH] vc-svn-ignore sets incorrect properties for relative filenames
  2019-08-28 23:39 bug#37216: [PATCH] vc-svn-ignore sets incorrect properties for relative filenames Wolfgang Scherer
@ 2019-09-15 13:07 ` Lars Ingebrigtsen
  2019-10-07  4:59   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-15 13:07 UTC (permalink / raw)
  To: Wolfgang Scherer; +Cc: 37216

Wolfgang Scherer <Wolfgang.Scherer@gmx.de> writes:

> 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.

[...]

> +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)))

I don't have any svn trees to test with, but if I understand the code
here, then this seems correct.

Does anybody else have an opinion?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#37216: [PATCH] vc-svn-ignore sets incorrect properties for relative filenames
  2019-09-15 13:07 ` Lars Ingebrigtsen
@ 2019-10-07  4:59   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-07  4:59 UTC (permalink / raw)
  To: Wolfgang Scherer; +Cc: 37216

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I don't have any svn trees to test with, but if I understand the code
> here, then this seems correct.
>
> Does anybody else have an opinion?

Nobody piped up, so I went ahead and applied the patch.  If any svn
users run into problems with this, please revert.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-07  4:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 23:39 bug#37216: [PATCH] vc-svn-ignore sets incorrect properties for relative filenames Wolfgang Scherer
2019-09-15 13:07 ` Lars Ingebrigtsen
2019-10-07  4:59   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).