diff options
| author | Eric S. Raymond | 2007-12-26 23:24:08 +0000 |
|---|---|---|
| committer | Eric S. Raymond | 2007-12-26 23:24:08 +0000 |
| commit | cdce374aed500a9b86f96af71d72a618d9639054 (patch) | |
| tree | 85372217cfc358e5b77b90c1cd59b600663f386d | |
| parent | f24830d2b74c9f86626661d143d10804d8e22a62 (diff) | |
| download | emacs-cdce374aed500a9b86f96af71d72a618d9639054.tar.gz emacs-cdce374aed500a9b86f96af71d72a618d9639054.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/vc-bzr.el | 4 | ||||
| -rw-r--r-- | lisp/vc-cvs.el | 4 | ||||
| -rw-r--r-- | lisp/vc-mcvs.el | 4 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 6 | ||||
| -rw-r--r-- | lisp/vc.el | 26 |
6 files changed, 30 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ba59b6db9ca..e9d99a404f2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | 2007-12-26 Eric S. Raymond <esr@snark.thyrsus.com> | 1 | 2007-12-26 Eric S. Raymond <esr@snark.thyrsus.com> |
| 2 | 2 | ||
| 3 | * log-view.el: Add Subversion and Mercurial log format samples. | 3 | * log-view.el: Add Subversion and Mercurial log format samples. |
| 4 | * vc-bzr.el, vc-cvs.el, vc.el, vc-mcvs.el, vc-svn.el: Significantly | ||
| 5 | speed up (vc-dired-hook) by arranging for it to call the backend | ||
| 6 | dir-state hook (if it exists) exactly *once*, rather than once per | ||
| 7 | each subdirectory (with dired-state-info calls on all toplevel files | ||
| 8 | slowing it down even further). For this to work, backend dir-state | ||
| 9 | methods have to recurse to subdirectories. Most of them already | ||
| 10 | did anyway; a few needed *non*-recursion switches removed. This | ||
| 11 | change mostly removed code that was perversely bad and should have | ||
| 12 | been shot through the head years ago. | ||
| 4 | 13 | ||
| 5 | 2007-12-26 Andreas Schwab <schwab@suse.de> | 14 | 2007-12-26 Andreas Schwab <schwab@suse.de> |
| 6 | 15 | ||
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 801e1942cb6..5e9bace920f 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el | |||
| @@ -485,7 +485,7 @@ stream. Standard error output is discarded." | |||
| 485 | ;; and implement a command to run ediff and `bzr resolve' once the | 485 | ;; and implement a command to run ediff and `bzr resolve' once the |
| 486 | ;; changes have been merged. | 486 | ;; changes have been merged. |
| 487 | (defun vc-bzr-dir-state (dir &optional localp) | 487 | (defun vc-bzr-dir-state (dir &optional localp) |
| 488 | "Find the VC state of all files in DIR. | 488 | "Find the VC state of all files in DIR and its subdirectories. |
| 489 | Optional argument LOCALP is always ignored." | 489 | Optional argument LOCALP is always ignored." |
| 490 | (let ((bzr-root-directory (vc-bzr-root dir)) | 490 | (let ((bzr-root-directory (vc-bzr-root dir)) |
| 491 | (at-start t) | 491 | (at-start t) |
| @@ -498,7 +498,7 @@ Optional argument LOCALP is always ignored." | |||
| 498 | ;; evidence of the contrary. | 498 | ;; evidence of the contrary. |
| 499 | (setq at-start t) | 499 | (setq at-start t) |
| 500 | (with-temp-buffer | 500 | (with-temp-buffer |
| 501 | (vc-bzr-command "ls" t 0 nil "--versioned" "--non-recursive") | 501 | (vc-bzr-command "ls" t 0 nil "--versioned") |
| 502 | (goto-char (point-min)) | 502 | (goto-char (point-min)) |
| 503 | (while (or at-start | 503 | (while (or at-start |
| 504 | (eq 0 (forward-line))) | 504 | (eq 0 (forward-line))) |
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 6d57a329b0c..5ffaf8ffa77 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el | |||
| @@ -212,7 +212,7 @@ See also variable `vc-cvs-sticky-date-format-string'." | |||
| 212 | 'edited))) | 212 | 'edited))) |
| 213 | 213 | ||
| 214 | (defun vc-cvs-dir-state (dir) | 214 | (defun vc-cvs-dir-state (dir) |
| 215 | "Find the CVS state of all files in DIR." | 215 | "Find the CVS state of all files in DIR and subdirectories." |
| 216 | ;; if DIR is not under CVS control, don't do anything. | 216 | ;; if DIR is not under CVS control, don't do anything. |
| 217 | (when (file-readable-p (expand-file-name "CVS/Entries" dir)) | 217 | (when (file-readable-p (expand-file-name "CVS/Entries" dir)) |
| 218 | (if (vc-stay-local-p dir) | 218 | (if (vc-stay-local-p dir) |
| @@ -221,7 +221,7 @@ See also variable `vc-cvs-sticky-date-format-string'." | |||
| 221 | ;; Don't specify DIR in this command, the default-directory is | 221 | ;; Don't specify DIR in this command, the default-directory is |
| 222 | ;; enough. Otherwise it might fail with remote repositories. | 222 | ;; enough. Otherwise it might fail with remote repositories. |
| 223 | (with-temp-buffer | 223 | (with-temp-buffer |
| 224 | (vc-cvs-command t 0 nil "status" "-l") | 224 | (vc-cvs-command t 0 nil "status") |
| 225 | (goto-char (point-min)) | 225 | (goto-char (point-min)) |
| 226 | (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) | 226 | (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) |
| 227 | (narrow-to-region (match-beginning 0) (match-end 0)) | 227 | (narrow-to-region (match-beginning 0) (match-end 0)) |
diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el index c3b68f8aeaf..70d502c7670 100644 --- a/lisp/vc-mcvs.el +++ b/lisp/vc-mcvs.el | |||
| @@ -178,7 +178,7 @@ This is only meaningful if you don't use the implicit checkout model | |||
| 178 | (defalias 'vc-mcvs-state-heuristic 'vc-cvs-state-heuristic) | 178 | (defalias 'vc-mcvs-state-heuristic 'vc-cvs-state-heuristic) |
| 179 | 179 | ||
| 180 | (defun vc-mcvs-dir-state (dir) | 180 | (defun vc-mcvs-dir-state (dir) |
| 181 | "Find the Meta-CVS state of all files in DIR." | 181 | "Find the Meta-CVS state of all files in DIR and subdirectories." |
| 182 | ;; if DIR is not under Meta-CVS control, don't do anything. | 182 | ;; if DIR is not under Meta-CVS control, don't do anything. |
| 183 | (when (file-readable-p (expand-file-name "MCVS/CVS/Entries" dir)) | 183 | (when (file-readable-p (expand-file-name "MCVS/CVS/Entries" dir)) |
| 184 | (if (vc-stay-local-p dir) | 184 | (if (vc-stay-local-p dir) |
| @@ -188,7 +188,7 @@ This is only meaningful if you don't use the implicit checkout model | |||
| 188 | ;; enough. Otherwise it might fail with remote repositories. | 188 | ;; enough. Otherwise it might fail with remote repositories. |
| 189 | (with-temp-buffer | 189 | (with-temp-buffer |
| 190 | (setq default-directory (vc-mcvs-root dir)) | 190 | (setq default-directory (vc-mcvs-root dir)) |
| 191 | (vc-mcvs-command t 0 nil "status" "-l") | 191 | (vc-mcvs-command t 0 nil "status") |
| 192 | (goto-char (point-min)) | 192 | (goto-char (point-min)) |
| 193 | (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) | 193 | (while (re-search-forward "^=+\n\\([^=\n].*\n\\|\n\\)+" nil t) |
| 194 | (narrow-to-region (match-beginning 0) (match-end 0)) | 194 | (narrow-to-region (match-beginning 0) (match-end 0)) |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index b83f8e0580f..2b46d2b9fec 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -27,10 +27,6 @@ | |||
| 27 | ;; Sync'd with Subversion's vc-svn.el as of revision 5801. but this version | 27 | ;; Sync'd with Subversion's vc-svn.el as of revision 5801. but this version |
| 28 | ;; has been extensively modified since to handle filesets. | 28 | ;; has been extensively modified since to handle filesets. |
| 29 | 29 | ||
| 30 | ;;; Bugs: | ||
| 31 | |||
| 32 | ;; - VC-dired is (really) slow. | ||
| 33 | |||
| 34 | ;;; Code: | 30 | ;;; Code: |
| 35 | 31 | ||
| 36 | (eval-when-compile | 32 | (eval-when-compile |
| @@ -151,7 +147,7 @@ If you want to force an empty list of arguments, use t." | |||
| 151 | (vc-svn-state file 'local)) | 147 | (vc-svn-state file 'local)) |
| 152 | 148 | ||
| 153 | (defun vc-svn-dir-state (dir &optional localp) | 149 | (defun vc-svn-dir-state (dir &optional localp) |
| 154 | "Find the SVN state of all files in DIR." | 150 | "Find the SVN state of all files in DIR and its subdirectories." |
| 155 | (setq localp (or localp (vc-stay-local-p dir))) | 151 | (setq localp (or localp (vc-stay-local-p dir))) |
| 156 | (let ((default-directory dir)) | 152 | (let ((default-directory dir)) |
| 157 | ;; Don't specify DIR in this command, the default-directory is | 153 | ;; Don't specify DIR in this command, the default-directory is |
diff --git a/lisp/vc.el b/lisp/vc.el index 7d843b934c5..d8c99b25108 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -160,9 +160,11 @@ | |||
| 160 | ;; - dir-state (dir) | 160 | ;; - dir-state (dir) |
| 161 | ;; | 161 | ;; |
| 162 | ;; If provided, this function is used to find the version control state | 162 | ;; If provided, this function is used to find the version control state |
| 163 | ;; of all files in DIR in a fast way. The function should not return | 163 | ;; of all files in DIR, and all subdirecties of DIR, in a fast way. |
| 164 | ;; anything, but rather store the files' states into the corresponding | 164 | ;; The function should not return anything, but rather store the files' |
| 165 | ;; `vc-state' properties. | 165 | ;; states into the corresponding `vc-state' properties. (Note: in |
| 166 | ;; older versions this method was not required to recurse into | ||
| 167 | ;; subdirectories.) | ||
| 166 | ;; | 168 | ;; |
| 167 | ;; * working-revision (file) | 169 | ;; * working-revision (file) |
| 168 | ;; | 170 | ;; |
| @@ -2311,19 +2313,19 @@ This code, like dired, assumes UNIX -l format." | |||
| 2311 | "Reformat the listing according to version control. | 2313 | "Reformat the listing according to version control. |
| 2312 | Called by dired after any portion of a vc-dired buffer has been read in." | 2314 | Called by dired after any portion of a vc-dired buffer has been read in." |
| 2313 | (message "Getting version information... ") | 2315 | (message "Getting version information... ") |
| 2314 | (let (subdir filename (inhibit-read-only t)) | 2316 | ;; if the backend supports it, get the state |
| 2317 | ;; of all files in this directory at once | ||
| 2318 | (let ((backend (vc-responsible-backend default-directory))) | ||
| 2319 | ;; check `backend' can really handle `default-directory'. | ||
| 2320 | (if (and (vc-call-backend backend 'responsible-p default-directory) | ||
| 2321 | (vc-find-backend-function backend 'dir-state)) | ||
| 2322 | (vc-call-backend backend 'dir-state default-directory))) | ||
| 2323 | (let (filename (inhibit-read-only t)) | ||
| 2315 | (goto-char (point-min)) | 2324 | (goto-char (point-min)) |
| 2316 | (while (not (eobp)) | 2325 | (while (not (eobp)) |
| 2317 | (cond | 2326 | (cond |
| 2318 | ;; subdir header line | 2327 | ;; subdir header line |
| 2319 | ((setq subdir (dired-get-subdir)) | 2328 | ((dired-get-subdir) |
| 2320 | ;; if the backend supports it, get the state | ||
| 2321 | ;; of all files in this directory at once | ||
| 2322 | (let ((backend (vc-responsible-backend subdir))) | ||
| 2323 | ;; check `backend' can really handle `subdir'. | ||
| 2324 | (if (and (vc-call-backend backend 'responsible-p subdir) | ||
| 2325 | (vc-find-backend-function backend 'dir-state)) | ||
| 2326 | (vc-call-backend backend 'dir-state subdir))) | ||
| 2327 | (forward-line 1) | 2329 | (forward-line 1) |
| 2328 | ;; erase (but don't remove) the "total" line | 2330 | ;; erase (but don't remove) the "total" line |
| 2329 | (delete-region (point) (line-end-position)) | 2331 | (delete-region (point) (line-end-position)) |