Add a magit-current-range variable for diff and log buffers.

This commit is contained in:
Nathan Weizenbaum 2010-06-24 18:02:49 -07:00
parent 81e2d01d03
commit abe8a031ff

View file

@ -565,6 +565,16 @@ return nil."
;;; Revisions and ranges
(defvar magit-current-range nil
"The range described by the current buffer.
This is only non-nil in diff and log buffers.
This has three possible (non-nil) forms. If it's a string REF or
a singleton list (REF), then the range is from REF to the current
working directory state (or HEAD in a log buffer). If it's a
pair (START . END), then the range is START..END.")
(make-variable-buffer-local 'magit-current-range)
(defun magit-list-interesting-refs ()
(let ((refs ()))
(dolist (line (magit-git-lines "show-ref"))
@ -3577,6 +3587,7 @@ With a non numeric prefix ARG, show all entries"
(defun magit-refresh-log-buffer (range style args)
(magit-configure-have-graph)
(magit-configure-have-decorate)
(setq magit-current-range range)
(magit-create-log-buffer-sections
(apply #'magit-git-section nil
(magit-rev-range-describe range "Commits")
@ -3688,6 +3699,7 @@ level commits."
;;; Diffing
(defun magit-refresh-diff-buffer (range args)
(setq magit-current-range range)
(magit-create-buffer-sections
(magit-git-section 'diffbuf
(magit-rev-range-describe range "Changes")