diff options
| author | Dmitry Gutov | 2019-10-04 15:50:16 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2019-10-04 15:50:24 +0300 |
| commit | 9a3089fea004e83992b6c4d05ecb7517b6c519ba (patch) | |
| tree | 45b1930ad6df8bf91d564a1aa0b3de0eed392fd6 | |
| parent | 1039c2e2eb14d5016b9178aaa656c7d1759723d5 (diff) | |
| download | emacs-9a3089fea004e83992b6c4d05ecb7517b6c519ba.tar.gz emacs-9a3089fea004e83992b6c4d05ecb7517b6c519ba.zip | |
(project--vc-list-files): Optimize the Hg implementation
* lisp/progmodes/project.el (project--vc-list-files):
Optimize the Hg implementation.
| -rw-r--r-- | lisp/progmodes/project.el | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2c0c32345d2..ef2499030a7 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -322,10 +322,9 @@ backend implementation of `project-external-roots'.") | |||
| 322 | "\0" t)))) | 322 | "\0" t)))) |
| 323 | (`Hg | 323 | (`Hg |
| 324 | (let ((default-directory (file-name-as-directory dir)) | 324 | (let ((default-directory (file-name-as-directory dir)) |
| 325 | args | 325 | args) |
| 326 | files) | ||
| 327 | ;; Include unregistered. | 326 | ;; Include unregistered. |
| 328 | (setq args (nconc args '("--all"))) | 327 | (setq args (nconc args '("-mcardu" "--no-status" "-0"))) |
| 329 | (when extra-ignores | 328 | (when extra-ignores |
| 330 | (setq args (nconc args | 329 | (setq args (nconc args |
| 331 | (mapcan | 330 | (mapcan |
| @@ -333,13 +332,10 @@ backend implementation of `project-external-roots'.") | |||
| 333 | (list "--exclude" i)) | 332 | (list "--exclude" i)) |
| 334 | extra-ignores)))) | 333 | extra-ignores)))) |
| 335 | (with-temp-buffer | 334 | (with-temp-buffer |
| 336 | (apply #'vc-hg-command t 0 "." | 335 | (apply #'vc-hg-command t 0 "." "status" args) |
| 337 | "status" args) | 336 | (mapcar |
| 338 | (goto-char (point-min)) | 337 | (lambda (s) (concat dir s)) |
| 339 | (while (re-search-forward "^[?C]\s+\\(.*\\)$" nil t) | 338 | (split-string (buffer-string) "\0" t))))))) |
| 340 | (setq files (cons (concat dir (match-string 1)) | ||
| 341 | files)))) | ||
| 342 | (nreverse files))))) | ||
| 343 | 339 | ||
| 344 | (cl-defmethod project-ignores ((project (head vc)) dir) | 340 | (cl-defmethod project-ignores ((project (head vc)) dir) |
| 345 | (let* ((root (cdr project)) | 341 | (let* ((root (cdr project)) |