summaryrefslogtreecommitdiff
path: root/lisp/vc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/compare-w.el4
-rw-r--r--lisp/vc/ediff-init.el6
-rw-r--r--lisp/vc/ediff-wind.el2
-rw-r--r--lisp/vc/log-edit.el4
-rw-r--r--lisp/vc/pcvs.el2
-rw-r--r--lisp/vc/smerge-mode.el6
-rw-r--r--lisp/vc/vc-cvs.el20
-rw-r--r--lisp/vc/vc-dispatcher.el20
-rw-r--r--lisp/vc/vc-git.el4
-rw-r--r--lisp/vc/vc-hg.el16
-rw-r--r--lisp/vc/vc-hooks.el10
-rw-r--r--lisp/vc/vc-mtn.el4
-rw-r--r--lisp/vc/vc-rcs.el5
-rw-r--r--lisp/vc/vc-svn.el10
-rw-r--r--lisp/vc/vc.el18
15 files changed, 79 insertions, 52 deletions
diff --git a/lisp/vc/compare-w.el b/lisp/vc/compare-w.el
index cec16446984..d6e3240eaf7 100644
--- a/lisp/vc/compare-w.el
+++ b/lisp/vc/compare-w.el
@@ -132,13 +132,13 @@ out all highlighting later with the command `compare-windows-dehighlight'."
(defface compare-windows-removed
'((t :inherit diff-removed))
- "Face for highlighting of compare-windows removed regions."
+ "Face for highlighting `compare-windows' differing regions in the other window."
:group 'compare-windows
:version "25.1")
(defface compare-windows-added
'((t :inherit diff-added))
- "Face for highlighting of compare-windows added regions."
+ "Face for highlighting `compare-windows' differing regions in current window."
:group 'compare-windows
:version "25.1")
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index bf211599b9f..a1d405ac2a1 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -718,9 +718,9 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
(defcustom ediff-coding-system-for-read 'raw-text
"The coding system for read to use when running the diff program as a subprocess.
In most cases, the default will do. However, under certain circumstances in
-MS-Windows you might need to use something like 'raw-text-dos here.
+MS-Windows you might need to use something like `raw-text-dos' here.
So, if the output that your diff program sends to Emacs contains extra ^M's,
-you might need to experiment here, if the default or 'raw-text-dos doesn't
+you might need to experiment here, if the default or `raw-text-dos' doesn't
work."
:type 'symbol
:group 'ediff)
@@ -750,7 +750,7 @@ to temp files in buffer jobs and when Ediff needs to find fine differences."
(defun ediff-check-version (op major minor &optional type-of-emacs)
"Check the current version against MAJOR and MINOR version numbers.
The comparison uses operator OP, which may be any of: =, >, >=, <, <=.
-TYPE-OF-EMACS is either 'xemacs or 'emacs."
+TYPE-OF-EMACS is either `emacs' or `xemacs'."
(declare (obsolete version< "23.1"))
(and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs))
((eq type-of-emacs 'emacs) (featurep 'emacs))
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index e0887f03b62..8da752a1529 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -201,7 +201,7 @@ Used internally---not a user option.")
(defcustom ediff-grab-mouse t
"If t, Ediff will always grab the mouse and put it in the control frame.
-If 'maybe, Ediff will do it sometimes, but not after operations that require
+If `maybe', Ediff will do it sometimes, but not after operations that require
relatively long time. If nil, the mouse will be entirely user's
responsibility."
:type 'boolean
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index 9857116e2d4..2bdd7a5be2b 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -97,7 +97,7 @@
(defcustom log-edit-confirm 'changed
"If non-nil, `log-edit-done' will request confirmation.
-If 'changed, only request confirmation if the list of files has
+If `changed', only request confirmation if the list of files has
changed since the beginning of the log-edit session."
:group 'log-edit
:type '(choice (const changed) (const t) (const nil)))
@@ -115,7 +115,7 @@ Enforce it silently if t, query if non-nil and don't do anything if nil."
(defcustom log-edit-setup-invert nil
"Non-nil means `log-edit' should invert the meaning of its SETUP arg.
-If SETUP is 'force, this variable has no effect."
+If SETUP is `force', this variable has no effect."
:group 'log-edit
:type 'boolean)
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el
index 3fdee100d44..ba8425824f9 100644
--- a/lisp/vc/pcvs.el
+++ b/lisp/vc/pcvs.el
@@ -2209,7 +2209,7 @@ With prefix argument, prompt for cvs flags."
;; Byte compile files.
(defun-cvs-mode cvs-mode-byte-compile-files ()
- "Run byte-compile-file on all selected files with '.el' extension."
+ "Run byte-compile-file on all selected files with `.el' extension."
(interactive)
(let ((marked (cvs-get-marked (cvs-ignore-marks-p "byte-compile"))))
(dolist (fi marked)
diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el
index 9f9224c226c..e9bfffd0354 100644
--- a/lisp/vc/smerge-mode.el
+++ b/lisp/vc/smerge-mode.el
@@ -735,17 +735,17 @@ major modes. Uses `smerge-resolve-function' to do the actual work."
(smerge-auto-leave))))))
(defun smerge-diff-base-mine ()
- "Diff 'base' and 'mine' version in current conflict region."
+ "Diff `base' and `mine' version in current conflict region."
(interactive)
(smerge-diff 2 1))
(defun smerge-diff-base-other ()
- "Diff 'base' and 'other' version in current conflict region."
+ "Diff `base' and `other' version in current conflict region."
(interactive)
(smerge-diff 2 3))
(defun smerge-diff-mine-other ()
- "Diff 'mine' and 'other' version in current conflict region."
+ "Diff `mine' and `other' version in current conflict region."
(interactive)
(smerge-diff 1 3))
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index 5f5807fb3c6..e21aece85ae 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -161,7 +161,7 @@ Format is according to `format-time-string'. Only used if
"Specify the mode-line display of sticky tags.
Value t means default display, nil means no display at all. If the
value is a function or macro, it is called with the sticky tag and
-its' type as parameters, in that order. TYPE can have three different
+its type as parameters, in that order. TYPE can have three different
values: `symbolic-name' (TAG is a string), `revision-number' (TAG is a
string) and `date' (TAG is a date as returned by `encode-time'). The
return value of the function or macro will be displayed as a string.
@@ -170,10 +170,10 @@ Here's an example that will display the formatted date for sticky
dates and the word \"Sticky\" for sticky tag names and revisions.
(lambda (tag type)
- (cond ((eq type 'date) (format-time-string
+ (cond ((eq type \\='date) (format-time-string
vc-cvs-sticky-date-format-string tag))
- ((eq type 'revision-number) \"Sticky\")
- ((eq type 'symbolic-name) \"Sticky\")))
+ ((eq type \\='revision-number) \"Sticky\")
+ ((eq type \\='symbolic-name) \"Sticky\")))
Here's an example that will abbreviate to the first character only,
any text before the first occurrence of `-' for sticky symbolic tags.
@@ -181,9 +181,9 @@ If the sticky tag is a revision number, the word \"Sticky\" is
displayed. Date and time is displayed for sticky dates.
(lambda (tag type)
- (cond ((eq type 'date) (format-time-string \"%Y%m%d %H:%M\" tag))
- ((eq type 'revision-number) \"Sticky\")
- ((eq type 'symbolic-name)
+ (cond ((eq type \\='date) (format-time-string \"%Y%m%d %H:%M\" tag))
+ ((eq type \\='revision-number) \"Sticky\")
+ ((eq type \\='symbolic-name)
(condition-case nil
(progn
(string-match \"\\\\([^-]*\\\\)\\\\(.*\\\\)\" tag)
@@ -882,11 +882,11 @@ For an empty string, nil is returned (invalid CVS root)."
(setq host uhost))
;; Remove empty HOST
(and (equal host "")
- (setq host))
+ (setq host nil))
;; Fix windows style CVS root `:local:C:\\project\\cvs\\some\\dir'
(and host
(equal method "local")
- (setq root (concat host ":" root) host))
+ (setq root (concat host ":" root) host nil))
;; Normalize CVS root record
(list method user host root)))))
@@ -899,7 +899,7 @@ For an empty string, nil is returned (invalid CVS root)."
(defun vc-cvs-parse-status (&optional full)
"Parse output of \"cvs status\" command in the current buffer.
Set file properties accordingly. Unless FULL is t, parse only
-essential information. Note that this can never set the 'ignored
+essential information. Note that this can never set the `ignored'
state."
(let (file status missing)
(goto-char (point-min))
diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el
index ec55867fcfe..b8593e30a54 100644
--- a/lisp/vc/vc-dispatcher.el
+++ b/lisp/vc/vc-dispatcher.el
@@ -580,12 +580,20 @@ editing!"
(defun vc-buffer-sync (&optional not-urgent)
"Make sure the current buffer and its working file are in sync.
NOT-URGENT means it is ok to continue if the user says not to save."
- (when (buffer-modified-p)
- (if (or vc-suppress-confirm
- (y-or-n-p (format "Buffer %s modified; save it? " (buffer-name))))
- (save-buffer)
- (unless not-urgent
- (error "Aborted")))))
+ (let (missing)
+ (when (cond
+ ((buffer-modified-p))
+ ((not (file-exists-p buffer-file-name))
+ (setq missing t)))
+ (if (or vc-suppress-confirm
+ (y-or-n-p (format "Buffer %s %s; save it? "
+ (buffer-name)
+ (if missing
+ "is missing on disk"
+ "modified"))))
+ (save-buffer)
+ (unless not-urgent
+ (error "Aborted"))))))
;; Command closures
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 8bf37f09dc2..99084183a8c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1050,7 +1050,7 @@ or BRANCH^ (where \"^\" can be repeated)."
(autoload 'vc-switches "vc")
-(defun vc-git-diff (files &optional rev1 rev2 buffer async)
+(defun vc-git-diff (files &optional rev1 rev2 buffer _async)
"Get a difference report using Git between two revisions of FILES."
(let (process-file-side-effects
(command "diff-tree"))
@@ -1061,7 +1061,7 @@ or BRANCH^ (where \"^\" can be repeated)."
(unless rev1 (setq rev1 "HEAD")))
(if vc-git-diff-switches
(apply #'vc-git-command (or buffer "*vc-diff*")
- (if async 'async 1)
+ 1 ; bug#21969
files
command
"--exit-code"
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 92b0c3169c1..62fbfde5f87 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -335,7 +335,7 @@ If LIMIT is non-nil, show no more than this many entries."
(autoload 'vc-switches "vc")
-(defun vc-hg-diff (files &optional oldvers newvers buffer async)
+(defun vc-hg-diff (files &optional oldvers newvers buffer _async)
"Get a difference report using hg between two revisions of FILES."
(let* ((firstfile (car files))
(working (and firstfile (vc-working-revision firstfile))))
@@ -345,8 +345,8 @@ If LIMIT is non-nil, show no more than this many entries."
(setq oldvers working))
(apply #'vc-hg-command
(or buffer "*vc-diff*")
- (if async 'async nil)
- files "diff"
+ nil ; bug#21969
+ files "diff"
(append
(vc-switches 'hg 'diff)
(when oldvers
@@ -430,9 +430,13 @@ Optional arg REVISION is a revision to annotate from."
;;; Miscellaneous
(defun vc-hg-previous-revision (_file rev)
- (let ((newrev (1- (string-to-number rev))))
- (when (>= newrev 0)
- (number-to-string newrev))))
+ ;; We can't simply decrement by 1, because that revision might be
+ ;; e.g. on a different branch (bug#22032).
+ (with-temp-buffer
+ (and (eq 0
+ (vc-hg-command t nil nil "id" "-n" "-r" (concat rev "^")))
+ ;; Trim the trailing newline.
+ (buffer-substring (point-min) (1- (point-max))))))
(defun vc-hg-next-revision (_file rev)
(let ((newrev (1+ (string-to-number rev)))
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 3e6d2a95051..93d2dc0ee89 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -243,12 +243,12 @@ if that doesn't exist either, return nil."
"Call for BACKEND the implementation of FUNCTION-NAME with the given ARGS.
Calls
- (apply 'vc-BACKEND-FUN ARGS)
+ (apply \\='vc-BACKEND-FUN ARGS)
if vc-BACKEND-FUN exists (after trying to find it in vc-BACKEND.el)
and else calls
- (apply 'vc-default-FUN BACKEND ARGS)
+ (apply \\='vc-default-FUN BACKEND ARGS)
It is usually called via the `vc-call' macro."
(let ((f (assoc function-name (get backend 'vc-functions))))
@@ -791,7 +791,11 @@ current, and kill the buffer that visits the link."
nil)
(defun vc-refresh-state ()
- "Activate or deactivate VC mode as appropriate."
+ "Refresh the VC state of the current buffer's file.
+
+This command is more thorough than `vc-state-refresh', in that it
+also supports switching a back-end or removing the file from VC.
+In the latter case, VC mode is deactivated for this buffer."
(interactive)
;; Recompute whether file is version controlled,
;; if user has killed the buffer and revisited.
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index b56a08f2a9e..3b59c61eb78 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -253,10 +253,10 @@ If LIMIT is non-nil, show no more than this many entries."
(autoload 'vc-switches "vc")
-(defun vc-mtn-diff (files &optional rev1 rev2 buffer async)
+(defun vc-mtn-diff (files &optional rev1 rev2 buffer _async)
"Get a difference report using monotone between two revisions of FILES."
(apply 'vc-mtn-command (or buffer "*vc-diff*")
- (if async 'async 1)
+ 1 ; bug#21969
files "diff"
(append
(vc-switches 'mtn 'diff)
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index ba1336424ea..3e43546967c 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -534,10 +534,11 @@ files beneath it."
(vc-rcs-print-log-cleanup))
(when limit 'limit-unsupported))
-(defun vc-rcs-diff (files &optional oldvers newvers buffer async)
+(defun vc-rcs-diff (files &optional oldvers newvers buffer _async)
"Get a difference report using RCS between two sets of files."
(apply #'vc-do-command (or buffer "*vc-diff*")
- (if async 'async 1)
+ ;; The repo is local, so this is fast anyway.
+ 1 ; bug#21969
"rcsdiff" (vc-expand-dirs files 'RCS)
(append (list "-q"
(and oldvers (concat "-r" oldvers))
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index de58fb91c62..a50befa9e4c 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -147,7 +147,8 @@ switches."
(defun vc-svn-registered (file)
"Check if FILE is SVN registered."
(setq file (expand-file-name file))
- (when (vc-svn-root file)
+ (when (and (vc-svn-root file)
+ (file-accessible-directory-p (file-name-directory file)))
(with-temp-buffer
(cd (file-name-directory file))
(let* (process-file-side-effects
@@ -309,11 +310,14 @@ to the SVN command."
(defalias 'vc-svn-responsible-p 'vc-svn-root)
+(declare-function log-edit-extract-headers "log-edit" (headers string))
+
(defun vc-svn-checkin (files comment &optional _extra-args-ignored)
"SVN-specific version of `vc-backend-checkin'."
(let ((status (apply
'vc-svn-command nil 1 files "ci"
- (nconc (list "-m" comment) (vc-switches 'SVN 'checkin)))))
+ (nconc (cons "-m" (log-edit-extract-headers nil comment))
+ (vc-switches 'SVN 'checkin)))))
(set-buffer "*vc*")
(goto-char (point-min))
(unless (equal status 0)
@@ -400,6 +404,8 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY."
(unless contents-done
(vc-svn-command nil 0 file "revert")))
+(autoload 'vc-read-revision "vc")
+
(defun vc-svn-merge-file (file)
"Accept a file merge request, prompting for revisions."
(let* ((first-revision
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 178b5f0c0ce..f05d45cabc1 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1026,9 +1026,6 @@ BEWARE: this function may change the current buffer."
(if observer
(vc-dired-deduce-fileset)
(error "State changing VC operations not supported in `dired-mode'")))
- ((and (derived-mode-p 'log-view-mode)
- (setq backend (vc-responsible-backend default-directory)))
- (list backend default-directory))
((setq backend (vc-backend buffer-file-name))
(if state-model-only-files
(list backend (list buffer-file-name)
@@ -1044,6 +1041,9 @@ BEWARE: this function may change the current buffer."
(progn ;FIXME: Why not `with-current-buffer'? --Stef.
(set-buffer vc-parent-buffer)
(vc-deduce-fileset observer allow-unregistered state-model-only-files)))
+ ((and (derived-mode-p 'log-view-mode)
+ (setq backend (vc-responsible-backend default-directory)))
+ (list backend nil))
((not buffer-file-name)
(error "Buffer %s is not associated with a file" (buffer-name)))
((and allow-unregistered (not (vc-registered buffer-file-name)))
@@ -2200,7 +2200,7 @@ Not all VC backends support short logs!")
In the new log, leave point at WORKING-REVISION (if non-nil).
LIMIT is the number of entries currently shown.
Does nothing if IS-START-REVISION is non-nil, or if LIMIT is nil,
-or if PL-RETURN is 'limit-unsupported."
+or if PL-RETURN is `limit-unsupported'."
(when (and limit (not (eq 'limit-unsupported pl-return))
(not is-start-revision))
(goto-char (point-max))
@@ -2467,7 +2467,8 @@ to the working revision (except for keyword expansion)."
You must be visiting a version controlled file, or in a `vc-dir' buffer.
On a distributed version control system, this runs a \"pull\"
operation to update the current branch, prompting for an argument
-list if required. Optional prefix ARG forces a prompt.
+list if required. Optional prefix ARG forces a prompt for the VCS
+command to run.
On a non-distributed version control system, update the current
fileset to the tip revisions. For each unchanged and unlocked
@@ -2511,8 +2512,11 @@ tip revision are merged into the working file."
You must be visiting a version controlled file, or in a `vc-dir' buffer.
On a distributed version control system, this runs a \"push\"
operation on the current branch, prompting for the precise command
-if required. Optional prefix ARG non-nil forces a prompt.
-On a non-distributed version control system, this signals an error."
+if required. Optional prefix ARG non-nil forces a prompt for the
+VCS command to run.
+
+On a non-distributed version control system, this signals an error.
+It also signals an error in a Bazaar bound branch."
(interactive "P")
(let* ((vc-fileset (vc-deduce-fileset t))
(backend (car vc-fileset)))