commit 6f9a168c624f20668aa5f32c2926d3690addd543 Author: Tom Tromey Date: Wed Feb 15 05:19:50 2017 -0700 Add more branch support to vc-dir * 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. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 21bd21e..0363aab 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -297,6 +297,12 @@ vc-dir-mode-map (define-key map (kbd "M-s a M-C-s") 'vc-dir-isearch-regexp) (define-key map "G" 'vc-dir-ignore) + (let ((branch-map (make-sparse-keymap))) + (define-key map "B" branch-map) + (define-key branch-map "c" 'vc-create-tag) + (define-key branch-map "l" 'vc-print-branch-log) + (define-key branch-map "s" 'vc-retrieve-tag)) + ;; Hook up the menu. (define-key map [menu-bar vc-dir-mode] `(menu-item diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0c8492d..c5fe8aa 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1757,6 +1757,9 @@ vc-diff-internal ;; because we don't know that yet. t))) +(defvar vc-revision-history nil + "History for `vc-read-revision'.") + (defun vc-read-revision (prompt &optional files backend default initial-input) (cond ((null files) @@ -1768,7 +1771,7 @@ vc-read-revision (vc-call-backend backend 'revision-completion-table files))) (if completion-table (completing-read prompt completion-table - nil nil initial-input nil default) + nil nil initial-input 'vc-revision-history default) (read-string prompt initial-input nil default)))) (defun vc-diff-build-argument-list-internal () @@ -2373,6 +2376,17 @@ vc-print-root-log (vc-print-log-internal backend (list rootdir) nil nil limit))) ;;;###autoload +(defun vc-print-branch-log (branch) + (interactive + (list + (vc-read-revision "Branch to log: "))) + (when (equal branch "") + (error "No branch specified")) + (vc-print-log-internal (vc-responsible-backend default-directory) + (list default-directory) branch t + (when (> vc-log-show-limit 0) vc-log-show-limit))) + +;;;###autoload (defun vc-log-incoming (&optional remote-location) "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION. When called interactively with a prefix argument, prompt for REMOTE-LOCATION."