Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
2a81c5d9
Commit
2a81c5d9
authored
Dec 01, 2014
by
Eric S. Raymond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Confine vc-stay-local to CVS, because it was unusable in SVN.
parent
c1083725
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
83 deletions
+1
-83
lisp/vc/vc-hooks.el
lisp/vc/vc-hooks.el
+0
-58
lisp/vc/vc-svn.el
lisp/vc/vc-svn.el
+1
-14
lisp/vc/vc.el
lisp/vc/vc.el
+0
-11
No files found.
lisp/vc/vc-hooks.el
View file @
2a81c5d9
...
...
@@ -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
)
(
vc-file-setprop
dirname
'vc-stay-local-p
(
let
((
hostname
(
vc-call-backend
backend
'repository-hostname
dirname
)))
(
if
(
not
hostname
)
'no
(
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))
...
...
lisp/vc/vc-svn.el
View file @
2a81c5d9
...
...
@@ -511,7 +511,6 @@ If LIMIT is non-nil, show no more than this many entries."
'vc-svn-command
buffer
'async
;; (if (and (= (length files) 1) (vc-stay-local-p file 'SVN)) 'async 0)
(
list
file
)
"log"
(
append
...
...
@@ -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)
(with-temp-buffer
(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.
"
(save-excursion
...
...
lisp/vc/vc.el
View file @
2a81c5d9
...
...
@@ -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.
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment