diff options
Diffstat (limited to 'lisp/vc')
-rw-r--r-- | lisp/vc/vc-cvs.el | 2 | ||||
-rw-r--r-- | lisp/vc/vc-dir.el | 16 | ||||
-rw-r--r-- | lisp/vc/vc-svn.el | 5 | ||||
-rw-r--r-- | lisp/vc/vc.el | 13 |
4 files changed, 25 insertions, 11 deletions
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index d84700fc176..a9e79d7956c 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -440,7 +440,7 @@ REV is the revision to check out." (if vc-cvs-use-edit (vc-cvs-command nil 0 file "unedit") ;; Make the file read-only by switching off all w-bits - (set-file-modes file (logand (file-modes file) 3950))))) + (set-file-modes file (logand (file-modes file) #o7555))))) (defun vc-cvs-merge-file (file) "Accept a file merge request, prompting for revisions." diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 9a6f6bb6874..e2259785923 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -864,10 +864,18 @@ with the command \\[tags-loop-continue]." delimited) (fileloop-continue)) -(defun vc-dir-ignore () - "Ignore the current file." - (interactive) - (vc-ignore (vc-dir-current-file))) +(defun vc-dir-ignore (&optional arg) + "Ignore the current file. +If a prefix argument is given, ignore all marked files." + (interactive "P") + (if arg + (ewoc-map + (lambda (filearg) + (when (vc-dir-fileinfo->marked filearg) + (vc-ignore (vc-dir-fileinfo->name filearg)) + t)) + vc-ewoc) + (vc-ignore (vc-dir-current-file)))) (defun vc-dir-current-file () (let ((node (ewoc-locate vc-ewoc))) diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 4d7b4c4055d..db09aa4bc06 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -366,8 +366,9 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY." (defun vc-svn-ignore-completion-table (directory) "Return the list of ignored files in DIRECTORY." (with-temp-buffer - (vc-svn-command t t nil "propget" "svn:ignore" (expand-file-name directory)) - (split-string (buffer-string)))) + (when (zerop (vc-svn-command + t t nil "propget" "svn:ignore" (expand-file-name directory))) + (split-string (buffer-string) "\n")))) (defun vc-svn-find-admin-dir (file) "Return the administrative directory of FILE." diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 90899d27e38..9d2eadad873 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1417,17 +1417,22 @@ remove from the list of ignored files." (defun vc-default-ignore (backend file &optional directory remove) "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). -FILE is a file wildcard, relative to the root directory of DIRECTORY. +FILE is a wildcard specification, either relative to +DIRECTORY or absolute. When called from Lisp code, if DIRECTORY is non-nil, the repository to use will be deduced by DIRECTORY; if REMOVE is non-nil, remove FILE from ignored files. Argument BACKEND is the backend you are using." (let ((ignore (vc-call-backend backend 'find-ignore-file (or directory default-directory))) - (pattern (file-relative-name - (expand-file-name file) (file-name-directory file)))) + file-path root-dir pattern) + (setq file-path (expand-file-name file directory)) + (setq root-dir (file-name-directory ignore)) + (when (not (string= (substring file-path 0 (length root-dir)) root-dir)) + (error "Ignore spec %s is not below project root %s" file-path root-dir)) + (setq pattern (substring file-path (length root-dir))) (if remove - (vc--remove-regexp pattern ignore) + (vc--remove-regexp (concat "^" (regexp-quote pattern ) "\\(\n\\|$\\)") ignore) (vc--add-line pattern ignore)))) (defun vc-default-ignore-completion-table (backend file) |