aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu <[email protected]>2008-10-13 01:16:49 +0000
committerDan Nicolaescu <[email protected]>2008-10-13 01:16:49 +0000
commit5870cb7682e7b70471d86b1b0b5724aa0fe18d74 (patch)
treeed1c973bd81a9ea79801b939cbb1bccd58572481
parentdd4fdc44b1143f7959439eecb00d3a79c471a962 (diff)
* 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/ChangeLog10
-rw-r--r--lisp/vc-cvs.el40
-rw-r--r--lisp/vc-hooks.el12
-rw-r--r--lisp/vc-svn.el3
4 files changed, 40 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bbcce20ddb..00a2d4540f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2008-10-13 Dan Nicolaescu <[email protected]>
+
+ * 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.
+
2008-10-12 Stephen Leake <[email protected]>
* 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 bd6e755d12..0d8cbb1e6f 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
:version "21.1"
:group 'vc)
-(defcustom vc-cvs-stay-local t
+(defcustom vc-cvs-stay-local 'only-file
"*Non-nil means use local operations when possible for remote repositories.
This avoids slow queries over the network and instead uses heuristics
and past information to determine the current status of a file.
+If value is the symbol `only-file' `vc-dir' will connect to the
+server, but heuristics will be used to determine the status for
+all other VC operations.
+
The value can also be a regular expression or list of regular
expressions to match against the host name of a repository; then VC
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
symbol `except'; then VC always stays local except for hosts matched
by these regular expressions."
:type '(choice (const :tag "Always stay local" t)
- (const :tag "Don't stay local" nil)
+ (const :tag "Only for file operations" 'only-file)
+ (const :tag "Don't stay local" nil)
(list :format "\nExamine hostname and %v" :tag "Examine hostname ..."
(set :format "%v" :inline t (const :format "%t" :tag "don't" except))
(regexp :format " stay local,\n%t: %v" :tag "if it matches")
(repeat :format "%v%i\n" :inline t (regexp :tag "or"))))
- :version "21.1"
- :group 'vc)
-
-(defcustom vc-cvs-dir-stay-local nil
- "*Non-nil means use local operations when possible for remote repositories.
-This avoids slow queries over the network and instead uses heuristics
-and past information to determine the current status of files for `vc-dir'."
- :type 'boolean
:version "23.1"
:group 'vc)
@@ -961,17 +958,18 @@ state."
(defun vc-cvs-dir-status (dir update-function)
"Create a list of conses (file . state) for DIR."
;; FIXME check all files in DIR instead?
- (if vc-cvs-dir-stay-local
- (vc-cvs-dir-status-heuristic dir update-function)
- (vc-cvs-command (current-buffer) 'async dir "-f" "status")
- ;; Alternative implementation: use the "update" command instead of
- ;; the "status" command.
- ;; (vc-cvs-command (current-buffer) 'async
- ;; (file-relative-name dir)
- ;; "-f" "-n" "update" "-d" "-P")
- (vc-exec-after
- `(vc-cvs-after-dir-status (quote ,update-function)))))
-
+ (let ((local (vc-stay-local-p dir)))
+ (if (and local (not (eq local 'only-file)))
+ (vc-cvs-dir-status-heuristic dir update-function)
+ (vc-cvs-command (current-buffer) 'async dir "-f" "status")
+ ;; Alternative implementation: use the "update" command instead of
+ ;; the "status" command.
+ ;; (vc-cvs-command (current-buffer) 'async
+ ;; (file-relative-name dir)
+ ;; "-f" "-n" "update" "-d" "-P")
+ (vc-exec-after
+ `(vc-cvs-after-dir-status (quote ,update-function))))))
+
(defun vc-cvs-dir-status-files (dir files default-state update-function)
"Create a list of conses (file . state) for DIR."
(apply 'vc-cvs-command (current-buffer) 'async dir "-f" "status" files)
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 83c4d6aff2..7910c06883 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -142,24 +142,30 @@ See also variable `vc-consult-headers'."
(funcall vc-mistrust-permissions
(vc-backend-subdirectory-name file)))))
-(defcustom vc-stay-local t
+(defcustom vc-stay-local 'only-file
"Non-nil means use local operations when possible for remote repositories.
This avoids slow queries over the network and instead uses heuristics
and past information to determine the current status of a file.
+If value is the symbol `only-file' `vc-dir' will connect to the
+server, but heuristics will be used to determine the status for
+all other VC operations.
+
The value can also be a regular expression or list of regular
expressions to match against the host name of a repository; then VC
only stays local for hosts that match it. Alternatively, the value
can be a list of regular expressions where the first element is the
symbol `except'; then VC always stays local except for hosts matched
by these regular expressions."
- :type '(choice (const :tag "Always stay local" t)
+ :type '(choice
+ (const :tag "Always stay local" t)
+ (const :tag "Only for file operations" 'only-file)
(const :tag "Don't stay local" nil)
(list :format "\nExamine hostname and %v" :tag "Examine hostname ..."
(set :format "%v" :inline t (const :format "%t" :tag "don't" except))
(regexp :format " stay local,\n%t: %v" :tag "if it matches")
(repeat :format "%v%i\n" :inline t (regexp :tag "or"))))
- :version "22.1"
+ :version "23.1"
:group 'vc)
(defun vc-stay-local-p (file)
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index f44b55e2a4..2dd3bb32db 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."
CALLBACK is called as (CALLBACK RESULT BUFFER), where
RESULT is a list of conses (FILE . STATE) for directory DIR."
;; FIXME should this rather be all the files in dir?
- (let ((remote (not (vc-stay-local-p dir))))
+ (let* ((local (vc-stay-local-p dir))
+ (remote (and local (not (eq local 'only-file)))))
(vc-svn-command (current-buffer) 'async nil "status"
(if remote "-u"))
(vc-exec-after