Commit 2a81c5d9 authored by Eric S. Raymond's avatar Eric S. Raymond

Confine vc-stay-local to CVS, because it was unusable in SVN.

parent c1083725
......@@ -170,64 +170,6 @@ control systems."
:type 'boolean
:group 'vc)
(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)
(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 "23.1"
:group 'vc)
(defun vc-stay-local-p (file &optional backend)
"Return non-nil if VC should stay local when handling FILE.
This uses the `repository-hostname' backend operation.
If FILE is a list of files, return non-nil if any of them
individually should stay local."
(if (listp file)
(delq nil (mapcar (lambda (arg) (vc-stay-local-p arg backend)) file))
(setq backend (or backend (vc-backend file)))
(let* ((sym (vc-make-backend-sym backend 'stay-local))
(stay-local (if (boundp sym) (symbol-value sym) vc-stay-local)))
(if (symbolp stay-local) stay-local
(let ((dirname (if (file-directory-p file)
(directory-file-name file)
(file-name-directory file))))
(eq 'yes
(or (vc-file-getprop dirname 'vc-stay-local-p)
dirname 'vc-stay-local-p
(let ((hostname (vc-call-backend
backend 'repository-hostname dirname)))
(if (not hostname)
(let ((default t))
(if (eq (car-safe stay-local) 'except)
(setq default nil stay-local (cdr stay-local)))
(when (consp stay-local)
(setq stay-local
(mapconcat 'identity stay-local "\\|")))
(if (if (string-match stay-local hostname)
default (not default))
'yes 'no))))))))))))
;;; This is handled specially now.
;; Tell Emacs about this new kind of minor mode
;; (add-to-list 'minor-mode-alist '(vc-mode vc-mode))
......@@ -511,7 +511,6 @@ If LIMIT is non-nil, show no more than this many entries."
;; (if (and (= (length files) 1) (vc-stay-local-p file 'SVN)) 'async 0)
(list file)
......@@ -552,7 +551,6 @@ If LIMIT is non-nil, show no more than this many entries."
(list (concat "--diff-cmd=" diff-command) "-x"
(mapconcat 'identity (vc-switches nil 'diff) " "))))
(async (and (not vc-disable-async-diff)
(vc-stay-local-p files 'SVN)
(or oldvers newvers)))) ; Svn diffs those locally.
(apply 'vc-svn-command buffer
(if async 'async 0)
......@@ -595,7 +593,7 @@ NAME is assumed to be a URL."
;; Subversion makes backups for us, so don't bother.
;; (defun vc-svn-make-version-backups-p (file)
;; "Return non-nil if version backups should be made for FILE."
;; (vc-stay-local-p file 'SVN))
;; nil)
(defun vc-svn-check-headers ()
"Check if the current file has any headers in it."
......@@ -618,17 +616,6 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
(cons vc-svn-global-switches flags)
(append vc-svn-global-switches flags))))
(defun vc-svn-repository-hostname (dirname)
(let (process-file-side-effects)
(vc-svn-command t t dirname "info" "--xml"))
(goto-char (point-min))
(when (re-search-forward "<url>\\(.*\\)</url>" nil t)
;; This is not a hostname but a URL. This may actually be considered
;; as a feature since it allows vc-svn-stay-local to specify different
;; behavior for different modules on the same server.
(match-string 1))))
(defun vc-svn-resolve-when-done ()
"Call \"svn resolved\" if the conflict markers have been removed."
......@@ -481,14 +481,6 @@
;; Return the root of the VC controlled hierarchy for file.
;; - repository-hostname (dirname)
;; Return the hostname that the backend will have to contact
;; in order to operate on a file in DIRNAME. If the return value
;; is nil, it means that the repository is local.
;; This function is used in `vc-stay-local-p' which backends can use
;; for their convenience.
;; - ignore (file &optional directory)
;; Ignore FILE under the VCS of DIRECTORY (default is `default-directory').
......@@ -630,9 +622,6 @@
;;;; Internal cleanups:
;; - backends that care about vc-stay-local should try to take it into
;; account for vc-dir. Is this likely to be useful??? YES!
;; - vc-expand-dirs should take a backend parameter and only look for
;; files managed by that backend.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment