summaryrefslogtreecommitdiff
path: root/lisp/vc/vc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/vc.el')
-rw-r--r--lisp/vc/vc.el45
1 files changed, 30 insertions, 15 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index b8cc44fc3dc..f26e5cc751d 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -935,7 +935,7 @@ is sensitive to blank lines."
(defun vc-clear-context ()
"Clear all cached file properties."
(interactive)
- (fillarray vc-file-prop-obarray 0))
+ (obarray-clear vc-file-prop-obarray))
(defmacro with-vc-properties (files form settings)
"Execute FORM, then maybe set per-file properties for FILES.
@@ -2703,20 +2703,22 @@ Not all VC backends support short logs!")
(defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return)
"Insert at the end of the current buffer buttons to show more log entries.
In the new log, leave point at WORKING-REVISION (if non-nil).
-LIMIT is the current maximum number of entries shown. Does
-nothing if IS-START-REVISION is non-nil and LIMIT is 1, or if
-LIMIT is nil, or if PL-RETURN is `limit-unsupported'."
+LIMIT is the current maximum number of entries shown, or the
+revision (string) before which to stop. Does nothing if
+IS-START-REVISION is non-nil and LIMIT is 1, or if LIMIT is nil,
+or if PL-RETURN is `limit-unsupported'."
;; LIMIT=1 is set by vc-annotate-show-log-revision-at-line
;; or by vc-print-root-log with current-prefix-arg=1.
;; In either case only one revision is wanted, no buttons.
(when (and limit (not (eq 'limit-unsupported pl-return))
(not (and is-start-revision
- (= limit 1))))
+ (eql limit 1))))
(let ((entries 0))
(goto-char (point-min))
(while (re-search-forward log-view-message-re nil t)
(cl-incf entries))
- (if (< entries limit)
+ (if (or (stringp limit)
+ (< entries limit))
;; The log has been printed in full. Perhaps it started
;; with a copy or rename?
;; FIXME: We'd probably still want this button even when
@@ -2811,7 +2813,8 @@ button for. Same for CURRENT-REVISION. LIMIT means the usual."
Leave point at WORKING-REVISION, if it is non-nil.
If IS-START-REVISION is non-nil, start the log from WORKING-REVISION
\(not all backends support this); i.e., show only WORKING-REVISION and
-earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
+earlier revisions. Show up to LIMIT entries (nil means unlimited).
+LIMIT can also be a string, which means the revision before which to stop."
;; Don't switch to the output buffer before running the command,
;; so that any buffer-local settings in the vc-controlled
;; buffer can be accessed by the command.
@@ -3620,7 +3623,15 @@ revisions.
When invoked interactively in a Log View buffer with
marked revisions, use those."
(interactive
- (let ((revs (vc-prepare-patch-prompt-revisions)) to)
+ (let* ((revs (vc-prepare-patch-prompt-revisions))
+ (subject
+ (and (length= revs 1)
+ (plist-get
+ (vc-call-backend
+ (vc-responsible-backend default-directory)
+ 'prepare-patch (car revs))
+ :subject)))
+ to)
(require 'message)
(while (null (setq to (completing-read-multiple
(format-prompt
@@ -3633,10 +3644,9 @@ marked revisions, use those."
(sit-for blink-matching-delay))
(list (string-join to ", ")
(and (not vc-prepare-patches-separately)
- (read-string "Subject: " "[PATCH] " nil nil t))
+ (read-string "Subject: " (or subject "[PATCH] ") nil nil t))
revs)))
(save-current-buffer
- (vc-ensure-vc-buffer)
(let ((patches (mapcar (lambda (rev)
(vc-call-backend
(vc-responsible-backend default-directory)
@@ -3791,11 +3801,16 @@ to provide the `find-revision' operation instead."
(vc-call-backend (vc-backend buffer-file-name) 'check-headers))
(defun vc-clone (remote &optional backend directory rev)
- "Use BACKEND to clone REMOTE into DIRECTORY.
-If successful, returns the string with the directory of the
-checkout. If BACKEND is nil, iterate through every known backend
-in `vc-handled-backends' until one succeeds. If REV is non-nil,
-it indicates a specific revision to check out."
+ "Clone repository REMOTE using version-control BACKEND, into DIRECTORY.
+If successful, return the string with the directory of the checkout;
+otherwise return nil.
+REMOTE should be a string, the URL of the remote repository or the name
+of a directory (if the repository is local).
+If DIRECTORY is nil or omitted, it defaults to `default-directory'.
+If BACKEND is nil or omitted, the function iterates through every known
+backend in `vc-handled-backends' until one succeeds to clone REMOTE.
+If REV is non-nil, it indicates a specific revision to check out after
+cloning; the syntax of REV depends on what BACKEND accepts."
(setq directory (expand-file-name (or directory default-directory)))
(if backend
(progn