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.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 38209ef39ed..c8d28c144b5 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -448,6 +448,11 @@
;; - mergebase (rev1 &optional rev2)
;;
;; Return the common ancestor between REV1 and REV2 revisions.
+;;
+;; - last-change (from to)
+;;
+;; Return the most recent revision that made a change between FROM
+;; and TO.
;; TAG/BRANCH SYSTEM
;;
@@ -3584,6 +3589,19 @@ it indicates a specific revision to check out."
remote directory rev)))
(throw 'ok res)))))))
+(declare-function log-view-current-tag "log-view" (&optional pos))
+(defun vc-default-last-change (_backend from to)
+ "Default `last-change' implementation.
+FROM and TO are used as region markers"
+ (save-window-excursion
+ (let* ((buf (window-buffer (vc-region-history from to)))
+ (proc (get-buffer-process buf)))
+ (cl-assert (processp proc))
+ (while (accept-process-output proc))
+ (with-current-buffer buf
+ (prog1 (log-view-current-tag)
+ (kill-buffer))))))
+
;; These things should probably be generally available