@@ -2361,7 +2361,7 @@ or if PL-RETURN is `limit-unsupported'."
2361
2361
'help-echo " Show the log again, including all entries" )))
2362
2362
2363
2363
(defun vc-print-log-internal (backend files working-revision
2364
- &optional is-start-revision limit )
2364
+ &optional is-start-revision limit type )
2365
2365
" For specified BACKEND and FILES, show the VC log.
2366
2366
Leave point at WORKING-REVISION, if it is non-nil.
2367
2367
If IS-START-REVISION is non-nil, start the log from WORKING-REVISION
@@ -2377,7 +2377,7 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
2377
2377
(shortlog (not (null (memq (if dir-present 'directory 'file )
2378
2378
vc-log-short-style))))
2379
2379
(buffer-name " *vc-change-log*" )
2380
- (type (if shortlog 'short 'long )))
2380
+ (type (or type ( if shortlog 'short 'long ) )))
2381
2381
(vc-log-internal-common
2382
2382
backend buffer-name files type
2383
2383
(lambda (bk buf _type-arg files-arg )
@@ -2393,7 +2393,7 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
2393
2393
(vc-call-backend bk 'show-log-entry working-revision)))
2394
2394
(lambda (_ignore-auto _noconfirm )
2395
2395
(vc-print-log-internal backend files working-revision
2396
- is-start-revision limit)))))
2396
+ is-start-revision limit type )))))
2397
2397
2398
2398
(defvar vc-log-view-type nil
2399
2399
" Set this to differentiate the different types of logs." )
@@ -2416,7 +2416,12 @@ earlier revisions. Show up to LIMIT entries (non-nil means unlimited)."
2416
2416
(let ((inhibit-read-only t ))
2417
2417
; ; log-view-mode used to be called with inhibit-read-only bound
2418
2418
; ; to t, so let's keep doing it, just in case.
2419
- (vc-call-backend backend 'log-view-mode )
2419
+ (vc-call-backend backend
2420
+ (if (and (eq type 'with-diff )
2421
+ (vc-find-backend-function
2422
+ backend 'region-history-mode ))
2423
+ 'region-history-mode
2424
+ 'log-view-mode ))
2420
2425
(set (make-local-variable 'log-view-vc-backend ) backend)
2421
2426
(set (make-local-variable 'log-view-vc-fileset ) files )
2422
2427
(set (make-local-variable 'revert-buffer-function )
@@ -2475,13 +2480,26 @@ WORKING-REVISION and LIMIT."
2475
2480
(vc-print-log-internal backend files working-revision nil limit)))
2476
2481
2477
2482
;;;### autoload
2478
- (defun vc-print-root-log (&optional limit )
2483
+ (defun vc-print-root-log (&optional limit revision )
2479
2484
" List the change log for the current VC controlled tree in a window.
2480
2485
If LIMIT is non-nil, it should be a number specifying the maximum
2481
2486
number of revisions to show; the default is `vc-log-show-limit' .
2482
- When called interactively with a prefix argument, prompt for LIMIT."
2487
+ When called interactively with a prefix argument, prompt for LIMIT.
2488
+ When the prefix argument is a number, use it as LIMIT.
2489
+ A special case is when the prefix argument is 1, in this case
2490
+ it asks for the revision and shows it with its diff."
2483
2491
(interactive
2484
2492
(cond
2493
+ ((eq current-prefix-arg 1 )
2494
+ (let* ((default (thing-at-point 'word ))
2495
+ (revision (read-string
2496
+ (if default
2497
+ (format " Revision to show (default %s ): " default )
2498
+ " Revision to show: " )
2499
+ nil nil default )))
2500
+ (list 1 revision)))
2501
+ ((numberp current-prefix-arg)
2502
+ (list current-prefix-arg))
2485
2503
(current-prefix-arg
2486
2504
(let ((lim (string-to-number
2487
2505
(read-from-minibuffer
@@ -2492,17 +2510,20 @@ When called interactively with a prefix argument, prompt for LIMIT."
2492
2510
(list lim)))
2493
2511
(t
2494
2512
(list (when (> vc-log-show-limit 0 ) vc-log-show-limit)))))
2495
- (let ((backend (vc-deduce-backend ))
2496
- (default-directory default-directory)
2497
- rootdir)
2513
+ (let* ((backend (vc-deduce-backend ))
2514
+ (default-directory default-directory)
2515
+ (with-diff (and (eq limit 1 ) revision))
2516
+ (vc-log-short-style (unless with-diff vc-log-short-style))
2517
+ rootdir)
2498
2518
(if backend
2499
2519
(setq rootdir (vc-call-backend backend 'root default-directory))
2500
2520
(setq rootdir (read-directory-name " Directory for VC root-log: " ))
2501
2521
(setq backend (vc-responsible-backend rootdir))
2502
2522
(unless backend
2503
2523
(error " Directory is not version controlled " )))
2504
2524
(setq default-directory rootdir)
2505
- (vc-print-log-internal backend (list rootdir) nil nil limit)))
2525
+ (vc-print-log-internal backend (list rootdir) revision revision limit
2526
+ (when with-diff 'with-diff ))))
2506
2527
2507
2528
;;;### autoload
2508
2529
(defun vc-print-branch-log (branch )
0 commit comments