emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9a3089f: (project--vc-list-files): Optimize the Hg


From: Dmitry Gutov
Subject: [Emacs-diffs] master 9a3089f: (project--vc-list-files): Optimize the Hg implementation
Date: Fri, 4 Oct 2019 08:50:51 -0400 (EDT)

branch: master
commit 9a3089fea004e83992b6c4d05ecb7517b6c519ba
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    (project--vc-list-files): Optimize the Hg implementation
    
    * lisp/progmodes/project.el (project--vc-list-files):
    Optimize the Hg implementation.
---
 lisp/progmodes/project.el | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 2c0c323..ef24990 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -322,10 +322,9 @@ backend implementation of `project-external-roots'.")
          "\0" t))))
     (`Hg
      (let ((default-directory (file-name-as-directory dir))
-           args
-           files)
+           args)
        ;; Include unregistered.
-       (setq args (nconc args '("--all")))
+       (setq args (nconc args '("-mcardu" "--no-status" "-0")))
        (when extra-ignores
          (setq args (nconc args
                            (mapcan
@@ -333,13 +332,10 @@ backend implementation of `project-external-roots'.")
                               (list "--exclude" i))
                             extra-ignores))))
        (with-temp-buffer
-         (apply #'vc-hg-command t 0 "."
-                "status" args)
-         (goto-char (point-min))
-         (while (re-search-forward "^[?C]\s+\\(.*\\)$" nil t)
-           (setq files (cons (concat dir (match-string 1))
-                             files))))
-       (nreverse files)))))
+         (apply #'vc-hg-command t 0 "." "status" args)
+         (mapcar
+          (lambda (s) (concat dir s))
+          (split-string (buffer-string) "\0" t)))))))
 
 (cl-defmethod project-ignores ((project (head vc)) dir)
   (let* ((root (cdr project))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]