From: Tassilo Horn Date: Fri, 13 Sep 2019 20:25:55 +0000 (+0200) Subject: ; Improve vc-svn-list-files X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dafbf9992c191ed507e8cbfb423acd029e4676cc;p=emacs.git ; Improve vc-svn-list-files --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2fd4671e5bc..dab26836123 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -225,7 +225,7 @@ to find the list of ignores for each directory." :type '(repeat string) :safe 'listp) -(defcustom project-vc-project-files-backends '(Bzr Git Hg) +(defcustom project-vc-project-files-backends '(Bzr Git Hg SVN) "List of vc backends which should be used by `project-files'. For projects using a backend in this list, `project-files' will @@ -237,10 +237,8 @@ Note that this imposes some differences in semantics: - The vc backends list tracked files whereas \"find\" lists existing files. -- The performance differs vastly. The Git backend list files - very fast (and generally faster than \"find\") while the SVN - backend does so by querying the remote subversion server, i.e., - it requires a network connection and is slow." +- The performance differs depending on operating system, + filesystem, and hardware." :type `(set ,@(mapcar (lambda (b) `(const :tag ,(format "%s" b) ,b)) vc-handled-backends)) :version "27.1") diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index a12b78e73cb..3f0491c8847 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -1319,7 +1319,7 @@ stream. Standard error output is discarded." (declare-function cl-remove-if "cl-seq") -(defun vc-bzr-list-files (&optional dir _args) +(defun vc-bzr-list-files (&optional dir) (let ((default-directory (or dir default-directory))) (mapcar #'expand-file-name diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1ff599c585c..abb50129f53 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1709,7 +1709,7 @@ Returns nil if not possible." (declare-function cl-remove-if "cl-seq") -(defun vc-git-list-files (&optional dir _args) +(defun vc-git-list-files (&optional dir) (let ((default-directory (or dir default-directory))) (mapcar #'expand-file-name diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 613d2d69611..5b3493d1734 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1458,7 +1458,7 @@ This function differs from vc-do-command in that it invokes (defun vc-hg-root (file) (vc-find-root file ".hg")) -(defun vc-hg-list-files (&optional dir _args) +(defun vc-hg-list-files (&optional dir) (let ((default-directory (or dir default-directory))) (mapcar #'expand-file-name diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 4ced1caa60f..dd240feb58c 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -813,17 +813,20 @@ Set file properties accordingly. If FILENAME is non-nil, return its status." (declare-function cl-remove-if "cl-seq") -(defun vc-svn-list-files (&optional dir _args) - (let ((default-directory (or dir default-directory))) - (mapcar - #'expand-file-name - (cl-remove-if #'string-empty-p - (split-string - (with-output-to-string - (with-current-buffer standard-output - (vc-svn-command t 0 "." - "list" "--recursive"))) - "\n"))))) +(defun vc-svn-list-files (&optional dir) + (let ((default-directory (or dir default-directory)) + files) + (with-temp-buffer + (vc-svn-command t 0 "." + "info" "--recursive" + "--show-item" "relative-url" + "--show-item" "kind") + (goto-char (point-min)) + (message "%s" (buffer-string)) + (while (re-search-forward "^file\s+\\(.*\\)$" nil t) + (setq files (cons (expand-file-name (match-string 1)) + files)))) + (nreverse files))) (provide 'vc-svn) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 047b8ee465f..c8b0488977f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3108,7 +3108,7 @@ Invoke FUNC f ARGS on each VC-managed file f underneath it." -(defun vc-default-list-files (_backend &optional dir _args) +(defun vc-default-list-files (_backend &optional dir) (let* ((default-directory (or dir default-directory)) (inhibit-message t) files)