mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Compare commits
2 commits
c2e2a86d1b
...
5b07a81bed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b07a81bed | ||
|
|
77a57041d0 |
4 changed files with 49 additions and 4 deletions
5
etc/NEWS
5
etc/NEWS
|
|
@ -2529,6 +2529,11 @@ bindings:
|
|||
- 'C-x v O L' is bound to 'vc-log-outgoing'
|
||||
- 'C-x v O D' is bound to 'vc-root-diff-outgoing'.
|
||||
|
||||
---
|
||||
*** New display of outgoing revisions count in VC-Dir.
|
||||
If there are outgoing revisions, VC-Dir now includes a count of how many
|
||||
in its headers, to remind you to push them.
|
||||
|
||||
+++
|
||||
*** New user option 'vc-async-checkin' to enable async checkin operations.
|
||||
Currently only supported by the Git and Mercurial backends.
|
||||
|
|
|
|||
|
|
@ -64,6 +64,11 @@ See `run-hooks'."
|
|||
:group 'vc
|
||||
:version "28.1")
|
||||
|
||||
(defface vc-dir-header-urgent-value '((t :inherit font-lock-warning-face))
|
||||
"Face for urgent header values in VC-Dir buffers."
|
||||
:group 'vc
|
||||
:version "31.1")
|
||||
|
||||
(defface vc-dir-directory '((t :inherit font-lock-comment-delimiter-face))
|
||||
"Face for directories in VC-Dir buffers."
|
||||
:group 'vc
|
||||
|
|
@ -1328,19 +1333,31 @@ the *vc-dir* buffer.
|
|||
(hack-dir-local-variables-non-file-buffer)
|
||||
(vc-dir-refresh)))
|
||||
|
||||
(defvar-keymap vc-dir-outgoing-revisions-map
|
||||
:doc "Local keymap for viewing outgoing revisions."
|
||||
"<down-mouse-1>" #'vc-log-outgoing)
|
||||
|
||||
(defun vc-dir-headers (backend dir)
|
||||
"Display the headers in the *VC dir* buffer.
|
||||
"Display the headers in the *VC-Dir* buffer.
|
||||
It calls the `dir-extra-headers' backend method to display backend
|
||||
specific headers."
|
||||
(concat
|
||||
;; First layout the common headers.
|
||||
(propertize "VC backend : " 'face 'vc-dir-header)
|
||||
(propertize (format "%s\n" backend) 'face 'vc-dir-header-value)
|
||||
(propertize "Working dir: " 'face 'vc-dir-header)
|
||||
(propertize (format "%s\n" (abbreviate-file-name dir))
|
||||
'face 'vc-dir-header-value)
|
||||
;; Then the backend specific ones.
|
||||
(vc-call-backend backend 'dir-extra-headers dir)
|
||||
(and-let* ((count (ignore-errors (vc--count-outgoing backend)))
|
||||
(_ (plusp count)))
|
||||
(concat (propertize "\nOutgoing : "
|
||||
'face 'vc-dir-header)
|
||||
(propertize (format "%d unpushed revisions\n" count)
|
||||
'face 'vc-dir-header-urgent-value
|
||||
'mouse-face 'highlight
|
||||
'keymap vc-dir-outgoing-revisions-map
|
||||
'help-echo "\\<vc-dir-outgoing-revisions-map>\
|
||||
\\[vc-log-outgoing]: List outgoing revisions")))
|
||||
"\n"))
|
||||
|
||||
(defun vc-dir-refresh-files (files)
|
||||
|
|
|
|||
|
|
@ -4077,6 +4077,17 @@ can be a remote branch name."
|
|||
""
|
||||
(vc-call-backend backend 'mergebase incoming)))))
|
||||
|
||||
(defun vc--count-outgoing (backend)
|
||||
"Return number of changes that will be sent with a `vc-push'."
|
||||
(with-temp-buffer
|
||||
(let ((display-buffer-overriding-action
|
||||
'(display-buffer-no-window (allow-no-window . t))))
|
||||
(vc-incoming-outgoing-internal backend nil
|
||||
(current-buffer) 'log-outgoing))
|
||||
(let ((proc (get-buffer-process (current-buffer))))
|
||||
(while (accept-process-output proc)))
|
||||
(how-many log-view-message-re)))
|
||||
|
||||
;;;###autoload
|
||||
(defun vc-log-search (pattern)
|
||||
"Search the VC log of changes for PATTERN and show log of matching changes.
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@
|
|||
(iter-yield-from (time-stamp-test-pattern-sequential))
|
||||
(iter-yield-from (time-stamp-test-pattern-multiply)))
|
||||
|
||||
(ert-deftest time-stamp-custom-start ()
|
||||
(ert-deftest time-stamp-custom-start-0 ()
|
||||
"Test that `time-stamp' isn't stuck by a start matching 0 characters."
|
||||
(with-time-stamp-test-env
|
||||
(with-time-stamp-test-time ref-time1
|
||||
|
|
@ -189,6 +189,18 @@
|
|||
(time-stamp)
|
||||
(should (equal (buffer-string) "::05::05")))))))
|
||||
|
||||
(ert-deftest time-stamp-custom-start-multiline ()
|
||||
"Test `time-stamp-start' matching across multiple lines."
|
||||
(with-time-stamp-test-env
|
||||
(with-time-stamp-test-time ref-time1
|
||||
(let ((time-stamp-pattern "l.1\n%Y-%m-%d<-TS")) ;start includes newline
|
||||
(with-temp-buffer
|
||||
(insert "l.1\n<-TS\n")
|
||||
;; we should look for the end on the line where the start ends,
|
||||
;; not the line where the start starts
|
||||
(time-stamp)
|
||||
(should (equal (buffer-string) "l.1\n2006-01-02<-TS\n")))))))
|
||||
|
||||
(ert-deftest time-stamp-custom-pattern ()
|
||||
"Test that `time-stamp-pattern' is parsed correctly."
|
||||
(iter-do (pattern-parts (time-stamp-test-pattern-all))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue