diff options
| author | Tom Tromey | 2017-02-15 05:19:50 -0700 |
|---|---|---|
| committer | Tom Tromey | 2017-02-25 10:46:13 -0700 |
| commit | 9e9d381ff0c83283278f43a65d3ecefd0cde8041 (patch) | |
| tree | c3738014788c19eb95c7948afe5a9bc3410041f7 /lisp/vc | |
| parent | 54319e7a2418690508f29cd6833c9fd9ecbc2fa3 (diff) | |
| download | emacs-9e9d381ff0c83283278f43a65d3ecefd0cde8041.tar.gz emacs-9e9d381ff0c83283278f43a65d3ecefd0cde8041.zip | |
Add more branch support to vc-dir
Bug#25859:
* lisp/vc/vc-dir.el (vc-dir-mode-map) Add "B" bindings.
* lisp/vc/vc.el (vc-revision-history): New defvar.
(vc-read-revision): Use vc-revision-history.
(vc-print-branch-log): New function.
* doc/emacs/maintaining.texi (VC Directory Commands): Document new
bindings.
* etc/NEWS: Mention new vc-dir bindings.
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/vc-dir.el | 6 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 16 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 21bd21e15de..0363aab8407 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el | |||
| @@ -297,6 +297,12 @@ See `run-hooks'." | |||
| 297 | (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp) | 297 | (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp) |
| 298 | (define-key map "G" 'vc-dir-ignore) | 298 | (define-key map "G" 'vc-dir-ignore) |
| 299 | 299 | ||
| 300 | (let ((branch-map (make-sparse-keymap))) | ||
| 301 | (define-key map "B" branch-map) | ||
| 302 | (define-key branch-map "c" 'vc-create-tag) | ||
| 303 | (define-key branch-map "l" 'vc-print-branch-log) | ||
| 304 | (define-key branch-map "s" 'vc-retrieve-tag)) | ||
| 305 | |||
| 300 | ;; Hook up the menu. | 306 | ;; Hook up the menu. |
| 301 | (define-key map [menu-bar vc-dir-mode] | 307 | (define-key map [menu-bar vc-dir-mode] |
| 302 | `(menu-item | 308 | `(menu-item |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0c8492d021e..c5fe8aa6b1f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -1757,6 +1757,9 @@ Return t if the buffer had changes, nil otherwise." | |||
| 1757 | ;; because we don't know that yet. | 1757 | ;; because we don't know that yet. |
| 1758 | t))) | 1758 | t))) |
| 1759 | 1759 | ||
| 1760 | (defvar vc-revision-history nil | ||
| 1761 | "History for `vc-read-revision'.") | ||
| 1762 | |||
| 1760 | (defun vc-read-revision (prompt &optional files backend default initial-input) | 1763 | (defun vc-read-revision (prompt &optional files backend default initial-input) |
| 1761 | (cond | 1764 | (cond |
| 1762 | ((null files) | 1765 | ((null files) |
| @@ -1768,7 +1771,7 @@ Return t if the buffer had changes, nil otherwise." | |||
| 1768 | (vc-call-backend backend 'revision-completion-table files))) | 1771 | (vc-call-backend backend 'revision-completion-table files))) |
| 1769 | (if completion-table | 1772 | (if completion-table |
| 1770 | (completing-read prompt completion-table | 1773 | (completing-read prompt completion-table |
| 1771 | nil nil initial-input nil default) | 1774 | nil nil initial-input 'vc-revision-history default) |
| 1772 | (read-string prompt initial-input nil default)))) | 1775 | (read-string prompt initial-input nil default)))) |
| 1773 | 1776 | ||
| 1774 | (defun vc-diff-build-argument-list-internal () | 1777 | (defun vc-diff-build-argument-list-internal () |
| @@ -2373,6 +2376,17 @@ When called interactively with a prefix argument, prompt for LIMIT." | |||
| 2373 | (vc-print-log-internal backend (list rootdir) nil nil limit))) | 2376 | (vc-print-log-internal backend (list rootdir) nil nil limit))) |
| 2374 | 2377 | ||
| 2375 | ;;;###autoload | 2378 | ;;;###autoload |
| 2379 | (defun vc-print-branch-log (branch) | ||
| 2380 | (interactive | ||
| 2381 | (list | ||
| 2382 | (vc-read-revision "Branch to log: "))) | ||
| 2383 | (when (equal branch "") | ||
| 2384 | (error "No branch specified")) | ||
| 2385 | (vc-print-log-internal (vc-responsible-backend default-directory) | ||
| 2386 | (list default-directory) branch t | ||
| 2387 | (when (> vc-log-show-limit 0) vc-log-show-limit))) | ||
| 2388 | |||
| 2389 | ;;;###autoload | ||
| 2376 | (defun vc-log-incoming (&optional remote-location) | 2390 | (defun vc-log-incoming (&optional remote-location) |
| 2377 | "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION. | 2391 | "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION. |
| 2378 | When called interactively with a prefix argument, prompt for REMOTE-LOCATION." | 2392 | When called interactively with a prefix argument, prompt for REMOTE-LOCATION." |