diff options
| author | Dan Nicolaescu | 2008-10-13 01:16:49 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2008-10-13 01:16:49 +0000 |
| commit | 5870cb7682e7b70471d86b1b0b5724aa0fe18d74 (patch) | |
| tree | ed1c973bd81a9ea79801b939cbb1bccd58572481 | |
| parent | dd4fdc44b1143f7959439eecb00d3a79c471a962 (diff) | |
| download | emacs-5870cb7682e7b70471d86b1b0b5724aa0fe18d74.tar.gz emacs-5870cb7682e7b70471d86b1b0b5724aa0fe18d74.zip | |
* vc-hooks.el (vc-stay-local): Add a new choice and default to it.
* vc-cvs.el (vc-cvs-dir-stay-local): Remove.
(vc-cvs-stay-local): Add a new choice and default to it.
(vc-cvs-dir-status): Use the new vc-stay-local choice.
* vc-svn.el (vc-svn-dir-status): Use the new vc-stay-local choice.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/vc-cvs.el | 40 | ||||
| -rw-r--r-- | lisp/vc-hooks.el | 12 | ||||
| -rw-r--r-- | lisp/vc-svn.el | 3 |
4 files changed, 40 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bbcce20ddb9..00a2d4540fc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2008-10-13 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * vc-hooks.el (vc-stay-local): Add a new choice and default to it. | ||
| 4 | |||
| 5 | * vc-cvs.el (vc-cvs-dir-stay-local): Remove. | ||
| 6 | (vc-cvs-stay-local): Add a new choice and default to it. | ||
| 7 | (vc-cvs-dir-status): Use the new vc-stay-local choice. | ||
| 8 | |||
| 9 | * vc-svn.el (vc-svn-dir-status): Use the new vc-stay-local choice. | ||
| 10 | |||
| 1 | 2008-10-12 Stephen Leake <stephen_leake@member.fsf.org> | 11 | 2008-10-12 Stephen Leake <stephen_leake@member.fsf.org> |
| 2 | 12 | ||
| 3 | * progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start): | 13 | * progmodes/ada-mode.el (ada-get-indent-end, ada-goto-matching-start): |
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index bd6e755d128..0d8cbb1e6fb 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el | |||
| @@ -105,11 +105,15 @@ This is only meaningful if you don't use the implicit checkout model | |||
| 105 | :version "21.1" | 105 | :version "21.1" |
| 106 | :group 'vc) | 106 | :group 'vc) |
| 107 | 107 | ||
| 108 | (defcustom vc-cvs-stay-local t | 108 | (defcustom vc-cvs-stay-local 'only-file |
| 109 | "*Non-nil means use local operations when possible for remote repositories. | 109 | "*Non-nil means use local operations when possible for remote repositories. |
| 110 | This avoids slow queries over the network and instead uses heuristics | 110 | This avoids slow queries over the network and instead uses heuristics |
| 111 | and past information to determine the current status of a file. | 111 | and past information to determine the current status of a file. |
| 112 | 112 | ||
| 113 | If value is the symbol `only-file' `vc-dir' will connect to the | ||
| 114 | server, but heuristics will be used to determine the status for | ||
| 115 | all other VC operations. | ||
| 116 | |||
| 113 | The value can also be a regular expression or list of regular | 117 | The value can also be a regular expression or list of regular |
| 114 | expressions to match against the host name of a repository; then VC | 118 | expressions to match against the host name of a repository; then VC |
| 115 | only stays local for hosts that match it. Alternatively, the value | 119 | only stays local for hosts that match it. Alternatively, the value |
| @@ -117,19 +121,12 @@ can be a list of regular expressions where the first element is the | |||
| 117 | symbol `except'; then VC always stays local except for hosts matched | 121 | symbol `except'; then VC always stays local except for hosts matched |
| 118 | by these regular expressions." | 122 | by these regular expressions." |
| 119 | :type '(choice (const :tag "Always stay local" t) | 123 | :type '(choice (const :tag "Always stay local" t) |
| 120 | (const :tag "Don't stay local" nil) | 124 | (const :tag "Only for file operations" 'only-file) |
| 125 | (const :tag "Don't stay local" nil) | ||
| 121 | (list :format "\nExamine hostname and %v" :tag "Examine hostname ..." | 126 | (list :format "\nExamine hostname and %v" :tag "Examine hostname ..." |
| 122 | (set :format "%v" :inline t (const :format "%t" :tag "don't" except)) | 127 | (set :format "%v" :inline t (const :format "%t" :tag "don't" except)) |
| 123 | (regexp :format " stay local,\n%t: %v" :tag "if it matches") | 128 | (regexp :format " stay local,\n%t: %v" :tag "if it matches") |
| 124 | (repeat :format "%v%i\n" :inline t (regexp :tag "or")))) | 129 | (repeat :format "%v%i\n" :inline t (regexp :tag "or")))) |
| 125 | :version "21.1" | ||
| 126 | :group 'vc) | ||
| 127 | |||
| 128 | (defcustom vc-cvs-dir-stay-local nil | ||
| 129 | "*Non-nil means use local operations when possible for remote repositories. | ||
| 130 | This avoids slow queries over the network and instead uses heuristics | ||
| 131 | and past information to determine the current status of files for `vc-dir'." | ||
| 132 | :type 'boolean | ||
| 133 | :version "23.1" | 130 | :version "23.1" |
| 134 | :group 'vc) | 131 | :group 'vc) |
| 135 | 132 | ||
| @@ -961,17 +958,18 @@ state." | |||
| 961 | (defun vc-cvs-dir-status (dir update-function) | 958 | (defun vc-cvs-dir-status (dir update-function) |
| 962 | "Create a list of conses (file . state) for DIR." | 959 | "Create a list of conses (file . state) for DIR." |
| 963 | ;; FIXME check all files in DIR instead? | 960 | ;; FIXME check all files in DIR instead? |
| 964 | (if vc-cvs-dir-stay-local | 961 | (let ((local (vc-stay-local-p dir))) |
| 965 | (vc-cvs-dir-status-heuristic dir update-function) | 962 | (if (and local (not (eq local 'only-file))) |
| 966 | (vc-cvs-command (current-buffer) 'async dir "-f" "status") | 963 | (vc-cvs-dir-status-heuristic dir update-function) |
| 967 | ;; Alternative implementation: use the "update" command instead of | 964 | (vc-cvs-command (current-buffer) 'async dir "-f" "status") |
| 968 | ;; the "status" command. | 965 | ;; Alternative implementation: use the "update" command instead of |
| 969 | ;; (vc-cvs-command (current-buffer) 'async | 966 | ;; the "status" command. |
| 970 | ;; (file-relative-name dir) | 967 | ;; (vc-cvs-command (current-buffer) 'async |
| 971 | ;; "-f" "-n" "update" "-d" "-P") | 968 | ;; (file-relative-name dir) |
| 972 | (vc-exec-after | 969 | ;; "-f" "-n" "update" "-d" "-P") |
| 973 | `(vc-cvs-after-dir-status (quote ,update-function))))) | 970 | (vc-exec-after |
| 974 | 971 | `(vc-cvs-after-dir-status (quote ,update-function)))))) | |
| 972 | |||
| 975 | (defun vc-cvs-dir-status-files (dir files default-state update-function) | 973 | (defun vc-cvs-dir-status-files (dir files default-state update-function) |
| 976 | "Create a list of conses (file . state) for DIR." | 974 | "Create a list of conses (file . state) for DIR." |
| 977 | (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files) | 975 | (apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files) |
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 83c4d6aff2a..7910c068833 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -142,24 +142,30 @@ See also variable `vc-consult-headers'." | |||
| 142 | (funcall vc-mistrust-permissions | 142 | (funcall vc-mistrust-permissions |
| 143 | (vc-backend-subdirectory-name file))))) | 143 | (vc-backend-subdirectory-name file))))) |
| 144 | 144 | ||
| 145 | (defcustom vc-stay-local t | 145 | (defcustom vc-stay-local 'only-file |
| 146 | "Non-nil means use local operations when possible for remote repositories. | 146 | "Non-nil means use local operations when possible for remote repositories. |
| 147 | This avoids slow queries over the network and instead uses heuristics | 147 | This avoids slow queries over the network and instead uses heuristics |
| 148 | and past information to determine the current status of a file. | 148 | and past information to determine the current status of a file. |
| 149 | 149 | ||
| 150 | If value is the symbol `only-file' `vc-dir' will connect to the | ||
| 151 | server, but heuristics will be used to determine the status for | ||
| 152 | all other VC operations. | ||
| 153 | |||
| 150 | The value can also be a regular expression or list of regular | 154 | The value can also be a regular expression or list of regular |
| 151 | expressions to match against the host name of a repository; then VC | 155 | expressions to match against the host name of a repository; then VC |
| 152 | only stays local for hosts that match it. Alternatively, the value | 156 | only stays local for hosts that match it. Alternatively, the value |
| 153 | can be a list of regular expressions where the first element is the | 157 | can be a list of regular expressions where the first element is the |
| 154 | symbol `except'; then VC always stays local except for hosts matched | 158 | symbol `except'; then VC always stays local except for hosts matched |
| 155 | by these regular expressions." | 159 | by these regular expressions." |
| 156 | :type '(choice (const :tag "Always stay local" t) | 160 | :type '(choice |
| 161 | (const :tag "Always stay local" t) | ||
| 162 | (const :tag "Only for file operations" 'only-file) | ||
| 157 | (const :tag "Don't stay local" nil) | 163 | (const :tag "Don't stay local" nil) |
| 158 | (list :format "\nExamine hostname and %v" :tag "Examine hostname ..." | 164 | (list :format "\nExamine hostname and %v" :tag "Examine hostname ..." |
| 159 | (set :format "%v" :inline t (const :format "%t" :tag "don't" except)) | 165 | (set :format "%v" :inline t (const :format "%t" :tag "don't" except)) |
| 160 | (regexp :format " stay local,\n%t: %v" :tag "if it matches") | 166 | (regexp :format " stay local,\n%t: %v" :tag "if it matches") |
| 161 | (repeat :format "%v%i\n" :inline t (regexp :tag "or")))) | 167 | (repeat :format "%v%i\n" :inline t (regexp :tag "or")))) |
| 162 | :version "22.1" | 168 | :version "23.1" |
| 163 | :group 'vc) | 169 | :group 'vc) |
| 164 | 170 | ||
| 165 | (defun vc-stay-local-p (file) | 171 | (defun vc-stay-local-p (file) |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index f44b55e2a48..2dd3bb32db3 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -180,7 +180,8 @@ If you want to force an empty list of arguments, use t." | |||
| 180 | CALLBACK is called as (CALLBACK RESULT BUFFER), where | 180 | CALLBACK is called as (CALLBACK RESULT BUFFER), where |
| 181 | RESULT is a list of conses (FILE . STATE) for directory DIR." | 181 | RESULT is a list of conses (FILE . STATE) for directory DIR." |
| 182 | ;; FIXME should this rather be all the files in dir? | 182 | ;; FIXME should this rather be all the files in dir? |
| 183 | (let ((remote (not (vc-stay-local-p dir)))) | 183 | (let* ((local (vc-stay-local-p dir)) |
| 184 | (remote (and local (not (eq local 'only-file))))) | ||
| 184 | (vc-svn-command (current-buffer) 'async nil "status" | 185 | (vc-svn-command (current-buffer) 'async nil "status" |
| 185 | (if remote "-u")) | 186 | (if remote "-u")) |
| 186 | (vc-exec-after | 187 | (vc-exec-after |