* lisp/vc/vc-dispatcher.el (vc-run-delayed): New macro.
(vc-do-command, vc-set-async-update): * lisp/vc/vc-mtn.el (vc-mtn-dir-status): * lisp/vc/vc-hg.el (vc-hg-dir-status, vc-hg-dir-status-files) (vc-hg-pull, vc-hg-merge-branch): * lisp/vc/vc-git.el (vc-git-dir-status-goto-stage, vc-git-pull) (vc-git-merge-branch): * lisp/vc/vc-cvs.el (vc-cvs-print-log, vc-cvs-dir-status) (vc-cvs-dir-status-files): * lisp/vc/vc-bzr.el (vc-bzr-pull, vc-bzr-merge-branch, vc-bzr-dir-status) (vc-bzr-dir-status-files): * lisp/vc/vc-arch.el (vc-arch-dir-status): Use vc-run-delayed. * lisp/vc/vc-annotate.el: Use lexical-binding. (vc-annotate-display-select, vc-annotate): Use vc-run-delayed. (vc-sentinel-movepoint): Declare. (vc-annotate): Don't use `goto-line'. * lisp/vc/vc.el (vc-diff-internal): Prefer a closure to `(lambda...). (vc-diff-internal, vc-log-internal-common): Use vc-run-delayed. (vc-sentinel-movepoint): Declare. * lisp/vc/vc-svn.el: Use lexical-binding. (vc-svn-dir-status, vc-svn-dir-status-files): Use vc-run-delayed. * lisp/vc/vc-sccs.el: * lisp/vc/vc-rcs.el: Use lexical-binding.
This commit is contained in:
parent
abae272cce
commit
9c750ebae6
12 changed files with 119 additions and 108 deletions
|
@ -1,4 +1,4 @@
|
|||
;;; vc-annotate.el --- VC Annotate Support
|
||||
;;; vc-annotate.el --- VC Annotate Support -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 1997-1998, 2000-2013 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -306,9 +306,9 @@ use; you may override this using the second optional arg MODE."
|
|||
(vc-annotate-display-default (or vc-annotate-ratio 1.0)))
|
||||
;; One of the auto-scaling modes
|
||||
((eq vc-annotate-display-mode 'scale)
|
||||
(vc-exec-after `(vc-annotate-display-autoscale)))
|
||||
(vc-run-delayed (vc-annotate-display-autoscale)))
|
||||
((eq vc-annotate-display-mode 'fullscale)
|
||||
(vc-exec-after `(vc-annotate-display-autoscale t)))
|
||||
(vc-run-delayed (vc-annotate-display-autoscale t)))
|
||||
((numberp vc-annotate-display-mode) ; A fixed number of days lookback
|
||||
(vc-annotate-display-default
|
||||
(/ vc-annotate-display-mode
|
||||
|
@ -316,6 +316,8 @@ use; you may override this using the second optional arg MODE."
|
|||
(t (error "No such display mode: %s"
|
||||
vc-annotate-display-mode))))
|
||||
|
||||
(defvar vc-sentinel-movepoint)
|
||||
|
||||
;;;###autoload
|
||||
(defun vc-annotate (file rev &optional display-mode buf move-point-to vc-bk)
|
||||
"Display the edit history of the current FILE using colors.
|
||||
|
@ -397,16 +399,16 @@ mode-specific menu. `vc-annotate-color-map' and
|
|||
display-mode))))
|
||||
|
||||
(with-current-buffer temp-buffer-name
|
||||
(vc-exec-after
|
||||
`(progn
|
||||
;; Ideally, we'd rather not move point if the user has already
|
||||
;; moved it elsewhere, but really point here is not the position
|
||||
;; of the user's cursor :-(
|
||||
(when ,current-line ;(and (bobp))
|
||||
(goto-line ,current-line)
|
||||
(setq vc-sentinel-movepoint (point)))
|
||||
(unless (active-minibuffer-window)
|
||||
(message "Annotating... done")))))))
|
||||
(vc-run-delayed
|
||||
;; Ideally, we'd rather not move point if the user has already
|
||||
;; moved it elsewhere, but really point here is not the position
|
||||
;; of the user's cursor :-(
|
||||
(when current-line ;(and (bobp))
|
||||
(goto-char (point-min))
|
||||
(forward-line (1- current-line))
|
||||
(setq vc-sentinel-movepoint (point)))
|
||||
(unless (active-minibuffer-window)
|
||||
(message "Annotating... done"))))))
|
||||
|
||||
(defun vc-annotate-prev-revision (prefix)
|
||||
"Visit the annotation of the revision previous to this one.
|
||||
|
@ -630,7 +632,7 @@ or OFFSET if present."
|
|||
(vc-call-backend vc-annotate-backend 'annotate-current-time))
|
||||
next-time))))
|
||||
|
||||
(defun vc-default-annotate-current-time (backend)
|
||||
(defun vc-default-annotate-current-time (_backend)
|
||||
"Return the current time, encoded as fractional days."
|
||||
(vc-annotate-convert-time (current-time)))
|
||||
|
||||
|
|
|
@ -321,8 +321,8 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see
|
|||
(let ((default-directory dir))
|
||||
(vc-arch-command t 'async nil "changes"))
|
||||
;; The updating could be done asynchronously.
|
||||
(vc-exec-after
|
||||
`(vc-arch-after-dir-status ',callback)))
|
||||
(vc-run-delayed
|
||||
(vc-arch-after-dir-status callback)))
|
||||
|
||||
(defun vc-arch-after-dir-status (callback)
|
||||
(let* ((state-map '(("M " . edited)
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
(eval-when-compile
|
||||
(require 'cl-lib)
|
||||
(require 'vc-dispatcher)
|
||||
(require 'vc-dir)) ; vc-dir-at-event
|
||||
|
||||
;; Clear up the cache to force vc-call to check again and discover
|
||||
|
@ -354,7 +355,7 @@ prompt for the Bzr command to run."
|
|||
command (cadr args)
|
||||
args (cddr args)))
|
||||
(let ((buf (apply 'vc-bzr-async-command command args)))
|
||||
(with-current-buffer buf (vc-exec-after '(vc-compilation-mode 'bzr)))
|
||||
(with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr)))
|
||||
(vc-set-async-update buf))))
|
||||
|
||||
(defun vc-bzr-merge-branch ()
|
||||
|
@ -385,7 +386,7 @@ default if it is available."
|
|||
(command (cadr cmd))
|
||||
(args (cddr cmd)))
|
||||
(let ((buf (apply 'vc-bzr-async-command command args)))
|
||||
(with-current-buffer buf (vc-exec-after '(vc-compilation-mode 'bzr)))
|
||||
(with-current-buffer buf (vc-run-delayed (vc-compilation-mode 'bzr)))
|
||||
(vc-set-async-update buf))))
|
||||
|
||||
(defun vc-bzr-status (file)
|
||||
|
@ -995,23 +996,23 @@ stream. Standard error output is discarded."
|
|||
(defun vc-bzr-dir-status (dir update-function)
|
||||
"Return a list of conses (file . state) for DIR."
|
||||
(vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S")
|
||||
(vc-exec-after
|
||||
`(vc-bzr-after-dir-status (quote ,update-function)
|
||||
;; "bzr status" results are relative to
|
||||
;; the bzr root directory, NOT to the
|
||||
;; directory "bzr status" was invoked in.
|
||||
;; Ugh.
|
||||
;; We pass the relative directory here so
|
||||
;; that `vc-bzr-after-dir-status' can
|
||||
;; frob the results accordingly.
|
||||
(file-relative-name ,dir (vc-bzr-root ,dir)))))
|
||||
(vc-run-delayed
|
||||
(vc-bzr-after-dir-status update-function
|
||||
;; "bzr status" results are relative to
|
||||
;; the bzr root directory, NOT to the
|
||||
;; directory "bzr status" was invoked in.
|
||||
;; Ugh.
|
||||
;; We pass the relative directory here so
|
||||
;; that `vc-bzr-after-dir-status' can
|
||||
;; frob the results accordingly.
|
||||
(file-relative-name dir (vc-bzr-root dir)))))
|
||||
|
||||
(defun vc-bzr-dir-status-files (dir files _default-state update-function)
|
||||
"Return a list of conses (file . state) for DIR."
|
||||
(apply 'vc-bzr-command "status" (current-buffer) 'async dir "-v" "-S" files)
|
||||
(vc-exec-after
|
||||
`(vc-bzr-after-dir-status (quote ,update-function)
|
||||
(file-relative-name ,dir (vc-bzr-root ,dir)))))
|
||||
(vc-run-delayed
|
||||
(vc-bzr-after-dir-status update-function
|
||||
(file-relative-name dir (vc-bzr-root dir)))))
|
||||
|
||||
(defvar vc-bzr-shelve-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
|
|
|
@ -518,7 +518,7 @@ Remaining arguments are ignored."
|
|||
(if (vc-stay-local-p files 'CVS) 'async 0)
|
||||
files "log")
|
||||
(with-current-buffer buffer
|
||||
(vc-exec-after (vc-rcs-print-log-cleanup)))
|
||||
(vc-run-delayed (vc-rcs-print-log-cleanup)))
|
||||
(when limit 'limit-unsupported))
|
||||
|
||||
(defun vc-cvs-comment-history (file)
|
||||
|
@ -1015,14 +1015,14 @@ state."
|
|||
;; (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))))))
|
||||
(vc-run-delayed
|
||||
(vc-cvs-after-dir-status 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)
|
||||
(vc-exec-after
|
||||
`(vc-cvs-after-dir-status (quote ,update-function))))
|
||||
(vc-run-delayed
|
||||
(vc-cvs-after-dir-status update-function)))
|
||||
|
||||
(defun vc-cvs-file-to-string (file)
|
||||
"Read the content of FILE and return it as a string."
|
||||
|
|
|
@ -198,11 +198,11 @@ Another is that undo information is not kept."
|
|||
;; Normally, we want async code such as sentinels to not move point.
|
||||
(save-excursion
|
||||
(goto-char m)
|
||||
;; Each sentinel may move point and the next one should be run
|
||||
;; at that new point. We could get the same result by having
|
||||
;; each sentinel read&set process-mark, but since `cmd' needs
|
||||
;; to work both for async and sync processes, this would be
|
||||
;; difficult to achieve.
|
||||
;; Each sentinel may move point and the next one should be run
|
||||
;; at that new point. We could get the same result by having
|
||||
;; each sentinel read&set process-mark, but since `cmd' needs
|
||||
;; to work both for async and sync processes, this would be
|
||||
;; difficult to achieve.
|
||||
(vc-exec-after code)
|
||||
(move-marker m (point)))
|
||||
;; But sometimes the sentinels really want to move point.
|
||||
|
@ -247,6 +247,10 @@ to evaluate."
|
|||
(t (error "Unexpected process state"))))
|
||||
nil)
|
||||
|
||||
(defmacro vc-run-delayed (&rest body)
|
||||
(declare (indent 0) (debug t))
|
||||
`(vc-exec-after (lambda () ,@body)))
|
||||
|
||||
(defvar vc-post-command-functions nil
|
||||
"Hook run at the end of `vc-do-command'.
|
||||
Each function is called inside the buffer in which the command was run
|
||||
|
@ -328,8 +332,8 @@ case, and the process object in the asynchronous case."
|
|||
(set-process-filter proc 'vc-process-filter)
|
||||
(setq status proc)
|
||||
(when vc-command-messages
|
||||
(vc-exec-after
|
||||
`(message "Running %s in background... done" ',full-command))))
|
||||
(vc-run-delayed
|
||||
(message "Running %s in background... done" full-command))))
|
||||
;; Run synchronously
|
||||
(when vc-command-messages
|
||||
(message "Running %s in foreground..." full-command))
|
||||
|
@ -346,9 +350,9 @@ case, and the process object in the asynchronous case."
|
|||
(if (integerp status) (format "status %d" status) status)))
|
||||
(when vc-command-messages
|
||||
(message "Running %s...OK = %d" full-command status))))
|
||||
(vc-exec-after
|
||||
`(run-hook-with-args 'vc-post-command-functions
|
||||
',command ',file-or-list ',flags))
|
||||
(vc-run-delayed
|
||||
(run-hook-with-args 'vc-post-command-functions
|
||||
command file-or-list flags))
|
||||
status))))
|
||||
|
||||
(defun vc-do-async-command (buffer root command &rest args)
|
||||
|
@ -408,17 +412,17 @@ If the current buffer is a Dired buffer, revert it."
|
|||
(cond
|
||||
((derived-mode-p 'vc-dir-mode)
|
||||
(with-current-buffer process-buffer
|
||||
(vc-exec-after
|
||||
`(if (buffer-live-p ,buf)
|
||||
(with-current-buffer ,buf
|
||||
(vc-dir-refresh))))))
|
||||
(vc-run-delayed
|
||||
(if (buffer-live-p buf)
|
||||
(with-current-buffer buf
|
||||
(vc-dir-refresh))))))
|
||||
((derived-mode-p 'dired-mode)
|
||||
(with-current-buffer process-buffer
|
||||
(vc-exec-after
|
||||
`(and (buffer-live-p ,buf)
|
||||
(= (buffer-modified-tick ,buf) ,tick)
|
||||
(with-current-buffer ,buf
|
||||
(revert-buffer)))))))))
|
||||
(vc-run-delayed
|
||||
(and (buffer-live-p buf)
|
||||
(= (buffer-modified-tick buf) tick)
|
||||
(with-current-buffer buf
|
||||
(revert-buffer)))))))))
|
||||
|
||||
;; These functions are used to ensure that the view the user sees is up to date
|
||||
;; even if the dispatcher client mode has messed with file contents (as in,
|
||||
|
|
|
@ -477,8 +477,8 @@ or an empty string if none."
|
|||
(`diff-index
|
||||
(vc-git-command (current-buffer) 'async files
|
||||
"diff-index" "--relative" "-z" "-M" "HEAD" "--")))
|
||||
(vc-exec-after
|
||||
`(vc-git-after-dir-status-stage ',stage ',files ',update-function)))
|
||||
(vc-run-delayed
|
||||
(vc-git-after-dir-status-stage stage files update-function)))
|
||||
|
||||
(defun vc-git-dir-status (_dir update-function)
|
||||
"Return a list of (FILE STATE EXTRA) entries for DIR."
|
||||
|
@ -726,7 +726,7 @@ for the Git command to run."
|
|||
command (cadr args)
|
||||
args (cddr args)))
|
||||
(apply 'vc-do-async-command buffer root git-program command args)
|
||||
(with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'git)))
|
||||
(with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git)))
|
||||
(vc-set-async-update buffer)))
|
||||
|
||||
(defun vc-git-merge-branch ()
|
||||
|
@ -746,7 +746,7 @@ This prompts for a branch to merge from."
|
|||
nil t)))
|
||||
(apply 'vc-do-async-command buffer root vc-git-program "merge"
|
||||
(list merge-source))
|
||||
(with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'git)))
|
||||
(with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git)))
|
||||
(vc-set-async-update buffer)))
|
||||
|
||||
;;; HISTORY FUNCTIONS
|
||||
|
|
|
@ -608,13 +608,13 @@ REV is the revision to check out into WORKFILE."
|
|||
|
||||
(defun vc-hg-dir-status (dir update-function)
|
||||
(vc-hg-command (current-buffer) 'async dir "status" "-C")
|
||||
(vc-exec-after
|
||||
`(vc-hg-after-dir-status (quote ,update-function))))
|
||||
(vc-run-delayed
|
||||
(vc-hg-after-dir-status update-function)))
|
||||
|
||||
(defun vc-hg-dir-status-files (dir files _default-state update-function)
|
||||
(apply 'vc-hg-command (current-buffer) 'async dir "status" "-C" files)
|
||||
(vc-exec-after
|
||||
`(vc-hg-after-dir-status (quote ,update-function))))
|
||||
(vc-run-delayed
|
||||
(vc-hg-after-dir-status update-function)))
|
||||
|
||||
(defun vc-hg-dir-extra-header (name &rest commands)
|
||||
(concat (propertize name 'face 'font-lock-type-face)
|
||||
|
@ -708,7 +708,8 @@ then attempts to update the working directory."
|
|||
args (cddr args)))
|
||||
(apply 'vc-do-async-command buffer root hg-program
|
||||
command args)
|
||||
(with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'hg)))
|
||||
(with-current-buffer buffer
|
||||
(vc-run-delayed (vc-compilation-mode 'hg)))
|
||||
(vc-set-async-update buffer)))))
|
||||
|
||||
(defun vc-hg-merge-branch ()
|
||||
|
@ -717,7 +718,7 @@ This runs the command \"hg merge\"."
|
|||
(let* ((root (vc-hg-root default-directory))
|
||||
(buffer (format "*vc-hg : %s*" (expand-file-name root))))
|
||||
(apply 'vc-do-async-command buffer root vc-hg-program '("merge"))
|
||||
(with-current-buffer buffer (vc-exec-after '(vc-compilation-mode 'hg)))
|
||||
(with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg)))
|
||||
(vc-set-async-update buffer)))
|
||||
|
||||
;;; Internal functions
|
||||
|
|
|
@ -128,8 +128,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
|
|||
|
||||
(defun vc-mtn-dir-status (dir update-function)
|
||||
(vc-mtn-command (current-buffer) 'async dir "status")
|
||||
(vc-exec-after
|
||||
`(vc-mtn-after-dir-status (quote ,update-function))))
|
||||
(vc-run-delayed
|
||||
(vc-mtn-after-dir-status update-function)))
|
||||
|
||||
(defun vc-mtn-working-revision (file)
|
||||
;; If `mtn' fails or returns status>0, or if the search fails, just
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; vc-rcs.el --- support for RCS version-control
|
||||
;;; vc-rcs.el --- support for RCS version-control -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -520,7 +520,7 @@ expanded to all registered subfiles in them."
|
|||
;; No, it was some other error: re-signal it.
|
||||
(signal (car err) (cdr err)))))))))
|
||||
|
||||
(defun vc-rcs-revert (file &optional contents-done)
|
||||
(defun vc-rcs-revert (file &optional _contents-done)
|
||||
"Revert FILE to the version it was based on. If FILE is a directory,
|
||||
revert all registered files beneath it."
|
||||
(if (file-directory-p file)
|
||||
|
@ -571,8 +571,8 @@ directory the operation is applied to all registered files beneath it."
|
|||
(when (looking-at "[\b\t\n\v\f\r ]+")
|
||||
(delete-char (- (match-end 0) (match-beginning 0))))))
|
||||
|
||||
(defun vc-rcs-print-log (files buffer &optional shortlog
|
||||
start-revision-ignored limit)
|
||||
(defun vc-rcs-print-log (files buffer &optional _shortlog
|
||||
_start-revision-ignored limit)
|
||||
"Print commit log associated with FILES into specified BUFFER.
|
||||
Remaining arguments are ignored.
|
||||
If FILE is a directory the operation is applied to all registered
|
||||
|
@ -853,7 +853,7 @@ systime, or nil if there is none. Also, reposition point."
|
|||
(string-match "[0-9]+\\'" rev)
|
||||
(substring rev (match-beginning 0) (match-end 0)))
|
||||
|
||||
(defun vc-rcs-previous-revision (file rev)
|
||||
(defun vc-rcs-previous-revision (_file rev)
|
||||
"Return the revision number immediately preceding REV for FILE,
|
||||
or nil if there is no previous revision. This default
|
||||
implementation works for MAJOR.MINOR-style revision numbers as
|
||||
|
@ -1440,8 +1440,8 @@ The `:insn' key is a keyword to distinguish it as a vc-rcs.el extension."
|
|||
;; only the former since it behaves identically to the
|
||||
;; latter in the absence of "@@".)
|
||||
sub)
|
||||
(cl-flet ((incg (beg end)
|
||||
(let ((b beg) (e end) @-holes)
|
||||
(cl-flet ((incg (_beg end)
|
||||
(let ((e end) @-holes)
|
||||
(while (and asc (< (car asc) e))
|
||||
(push (pop asc) @-holes))
|
||||
;; Self-deprecate when work is done.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; vc-sccs.el --- support for SCCS version-control
|
||||
;;; vc-sccs.el --- support for SCCS version-control -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -101,7 +101,7 @@ For a description of possible values, see `vc-check-master-templates'."
|
|||
;;; Properties of the backend
|
||||
|
||||
(defun vc-sccs-revision-granularity () 'file)
|
||||
(defun vc-sccs-checkout-model (files) 'locking)
|
||||
(defun vc-sccs-checkout-model (_files) 'locking)
|
||||
|
||||
;;;
|
||||
;;; State-querying functions
|
||||
|
@ -321,7 +321,7 @@ are expanded to all version-controlled subfiles."
|
|||
(vc-name file) (concat "-r" discard))
|
||||
(vc-sccs-do-command nil 0 "get" (vc-name file) nil))))
|
||||
|
||||
(defun vc-sccs-revert (file &optional contents-done)
|
||||
(defun vc-sccs-revert (file &optional _contents-done)
|
||||
"Revert FILE to the version it was based on. If FILE is a directory,
|
||||
revert all subfiles."
|
||||
(if (file-directory-p file)
|
||||
|
@ -353,7 +353,7 @@ revert all subfiles."
|
|||
;;; History functions
|
||||
;;;
|
||||
|
||||
(defun vc-sccs-print-log (files buffer &optional shortlog start-revision-ignored limit)
|
||||
(defun vc-sccs-print-log (files buffer &optional _shortlog _start-revision-ignored limit)
|
||||
"Print commit log associated with FILES into specified BUFFER.
|
||||
Remaining arguments are ignored."
|
||||
(setq files (vc-expand-dirs files))
|
||||
|
@ -363,6 +363,8 @@ Remaining arguments are ignored."
|
|||
(autoload 'vc-setup-buffer "vc-dispatcher")
|
||||
(autoload 'vc-delistify "vc-dispatcher")
|
||||
|
||||
(defvar w32-quote-process-args)
|
||||
|
||||
;; FIXME use sccsdiff if present?
|
||||
(defun vc-sccs-diff (files &optional oldvers newvers buffer)
|
||||
"Get a difference report using SCCS between two filesets."
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;; vc-svn.el --- non-resident support for Subversion version-control
|
||||
;;; vc-svn.el --- non-resident support for Subversion version-control -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -115,7 +115,7 @@ If you want to force an empty list of arguments, use t."
|
|||
;;; Properties of the backend
|
||||
|
||||
(defun vc-svn-revision-granularity () 'repository)
|
||||
(defun vc-svn-checkout-model (files) 'implicit)
|
||||
(defun vc-svn-checkout-model (_files) 'implicit)
|
||||
|
||||
;;;
|
||||
;;; State-querying functions
|
||||
|
@ -231,13 +231,13 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
|
|||
(remote (or t (not local) (eq local 'only-file))))
|
||||
(vc-svn-command (current-buffer) 'async nil "status"
|
||||
(if remote "-u"))
|
||||
(vc-exec-after
|
||||
`(vc-svn-after-dir-status (quote ,callback) ,remote))))
|
||||
(vc-run-delayed
|
||||
(vc-svn-after-dir-status callback remote))))
|
||||
|
||||
(defun vc-svn-dir-status-files (dir files default-state callback)
|
||||
(defun vc-svn-dir-status-files (dir files _default-state callback)
|
||||
(apply 'vc-svn-command (current-buffer) 'async nil "status" files)
|
||||
(vc-exec-after
|
||||
`(vc-svn-after-dir-status (quote ,callback))))
|
||||
(vc-run-delayed
|
||||
(vc-svn-after-dir-status callback)))
|
||||
|
||||
(defun vc-svn-dir-extra-headers (dir)
|
||||
"Generate extra status headers for a Subversion working copy."
|
||||
|
@ -268,7 +268,7 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
|
|||
;; vc-svn-mode-line-string doesn't exist because the default implementation
|
||||
;; works just fine.
|
||||
|
||||
(defun vc-svn-previous-revision (file rev)
|
||||
(defun vc-svn-previous-revision (_file rev)
|
||||
(let ((newrev (1- (string-to-number rev))))
|
||||
(when (< 0 newrev)
|
||||
(number-to-string newrev))))
|
||||
|
@ -298,7 +298,7 @@ RESULT is a list of conses (FILE . STATE) for directory DIR."
|
|||
|
||||
(autoload 'vc-switches "vc")
|
||||
|
||||
(defun vc-svn-register (files &optional rev comment)
|
||||
(defun vc-svn-register (files &optional _rev _comment)
|
||||
"Register FILES into the SVN version-control system.
|
||||
The COMMENT argument is ignored This does an add but not a commit.
|
||||
Passes either `vc-svn-register-switches' or `vc-register-switches'
|
||||
|
@ -314,7 +314,7 @@ to the SVN command."
|
|||
"Return non-nil if FILE could be registered in SVN.
|
||||
This is only possible if SVN is responsible for FILE's directory.")
|
||||
|
||||
(defun vc-svn-checkin (files rev comment &optional extra-args-ignored)
|
||||
(defun vc-svn-checkin (files rev comment &optional _extra-args-ignored)
|
||||
"SVN-specific version of `vc-backend-checkin'."
|
||||
(if rev (error "Committing to a specific revision is unsupported in SVN"))
|
||||
(let ((status (apply
|
||||
|
@ -357,7 +357,7 @@ This is only possible if SVN is responsible for FILE's directory.")
|
|||
FILE is a file wildcard, relative to the root directory of DIRECTORY."
|
||||
(vc-svn-command t 0 file "propedit" "svn:ignore"))
|
||||
|
||||
(defun vc-svn-ignore-completion-table (file)
|
||||
(defun vc-svn-ignore-completion-table (_file)
|
||||
"Return the list of ignored files."
|
||||
)
|
||||
|
||||
|
@ -368,7 +368,7 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY."
|
|||
(vc-mode-line file 'SVN)
|
||||
(message "Checking out %s...done" file))
|
||||
|
||||
(defun vc-svn-update (file editable rev switches)
|
||||
(defun vc-svn-update (file _editable rev switches)
|
||||
(if (and (file-exists-p file) (not rev))
|
||||
;; If no revision was specified, there's nothing to do.
|
||||
nil
|
||||
|
@ -457,7 +457,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
|
|||
(error "Couldn't analyze svn update result")))
|
||||
(message "Merging changes into %s...done" file))))
|
||||
|
||||
(defun vc-svn-modify-change-comment (files rev comment)
|
||||
(defun vc-svn-modify-change-comment (_files rev comment)
|
||||
"Modify the change comments for a specified REV.
|
||||
You must have ssh access to the repository host, and the directory Emacs
|
||||
uses locally for temp files must also be writable by you on that host.
|
||||
|
@ -509,7 +509,7 @@ or svn+ssh://."
|
|||
|
||||
(autoload 'vc-setup-buffer "vc-dispatcher")
|
||||
|
||||
(defun vc-svn-print-log (files buffer &optional shortlog start-revision limit)
|
||||
(defun vc-svn-print-log (files buffer &optional _shortlog start-revision limit)
|
||||
"Print commit log associated with FILES into specified BUFFER.
|
||||
SHORTLOG is ignored.
|
||||
If START-REVISION is non-nil, it is the newest revision to show.
|
||||
|
|
|
@ -1536,11 +1536,11 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
|
|||
;; (vc-file-tree-walk
|
||||
;; default-directory
|
||||
;; (lambda (f)
|
||||
;; (vc-exec-after
|
||||
;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f)))
|
||||
;; (message "Looking at %s" ',f)
|
||||
;; (vc-call-backend ',(vc-backend f)
|
||||
;; 'diff (list ',f) ',rev1 ',rev2))))))
|
||||
;; (vc-run-delayed
|
||||
;; (let ((coding-system-for-read (vc-coding-system-for-diff f)))
|
||||
;; (message "Looking at %s" f)
|
||||
;; (vc-call-backend (vc-backend f)
|
||||
;; 'diff (list f) rev1 rev2))))))
|
||||
|
||||
(defvar vc-coding-system-inherit-eol t
|
||||
"When non-nil, inherit the EOL format for reading Diff output from the file.
|
||||
|
@ -1678,8 +1678,8 @@ Return t if the buffer had changes, nil otherwise."
|
|||
(diff-mode)
|
||||
(set (make-local-variable 'diff-vc-backend) (car vc-fileset))
|
||||
(set (make-local-variable 'revert-buffer-function)
|
||||
`(lambda (ignore-auto noconfirm)
|
||||
(vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose)))
|
||||
(lambda (_ignore-auto _noconfirm)
|
||||
(vc-diff-internal async vc-fileset rev1 rev2 verbose)))
|
||||
;; Make the *vc-diff* buffer read only, the diff-mode key
|
||||
;; bindings are nicer for read only buffers. pcl-cvs does the
|
||||
;; same thing.
|
||||
|
@ -1695,8 +1695,8 @@ Return t if the buffer had changes, nil otherwise."
|
|||
;; The diff process may finish early, so call `vc-diff-finish'
|
||||
;; after `pop-to-buffer'; the former assumes the diff buffer is
|
||||
;; shown in some window.
|
||||
(vc-exec-after `(vc-diff-finish ,(current-buffer)
|
||||
',(when verbose messages)))
|
||||
(let ((buf (current-buffer)))
|
||||
(vc-run-delayed (vc-diff-finish buf (when verbose messages))))
|
||||
;; In the async case, we return t even if there are no differences
|
||||
;; because we don't know that yet.
|
||||
t)))
|
||||
|
@ -2230,6 +2230,7 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
|
|||
(defvar vc-log-view-type nil
|
||||
"Set this to differentiate the different types of logs.")
|
||||
(put 'vc-log-view-type 'permanent-local t)
|
||||
(defvar vc-sentinel-movepoint)
|
||||
|
||||
(defun vc-log-internal-common (backend
|
||||
buffer-name
|
||||
|
@ -2252,13 +2253,13 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
|
|||
(set (make-local-variable 'log-view-vc-fileset) files)
|
||||
(set (make-local-variable 'revert-buffer-function)
|
||||
rev-buff-func))
|
||||
(vc-exec-after
|
||||
`(let ((inhibit-read-only t))
|
||||
(funcall ',setup-buttons-func ',backend ',files ',retval)
|
||||
(shrink-window-if-larger-than-buffer)
|
||||
(funcall ',goto-location-func ',backend)
|
||||
(setq vc-sentinel-movepoint (point))
|
||||
(set-buffer-modified-p nil)))))
|
||||
(vc-run-delayed
|
||||
(let ((inhibit-read-only t))
|
||||
(funcall setup-buttons-func backend files retval)
|
||||
(shrink-window-if-larger-than-buffer)
|
||||
(funcall goto-location-func backend)
|
||||
(setq vc-sentinel-movepoint (point))
|
||||
(set-buffer-modified-p nil)))))
|
||||
|
||||
(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type)
|
||||
(vc-log-internal-common
|
||||
|
|
Loading…
Add table
Reference in a new issue