diff --git a/p4-lowlevel.el b/p4-lowlevel.el index 61badcb..779f0b0 100644 --- a/p4-lowlevel.el +++ b/p4-lowlevel.el @@ -495,15 +495,17 @@ Returns non-nil on success or nil on failure (or raises an error)." ; Do NOT need to support "-m". ; Do NOT need to support the specification of multiple files. -(defun p4-lowlevel-filelog (file &optional buffer long follow-branches) +(defun p4-lowlevel-filelog (file &optional buffer long follow-branches limit) "Fetch the p4 log of FILE and return a buffer containing it. If optional BUFFER is non-nil, put output in that buffer. If optional LONG is non-nil, return long output (i.e., pass the `-l' flag). If optional FOLLOW-BRANCHES is non-nil, include pre-branch log entries in -output (i.e., pass the `-i' flag)." +output (i.e., pass the `-i' flag). If LIMIT is non-nil, get only the +last LIMIT log entries." (let* ((long-flag (if long (list "-l") nil)) (branch-flag (if follow-branches (list "-i") nil)) - (args (append (list "filelog") long-flag branch-flag (list file)))) + (limit-flag (when limit (list "-m" (number-to-string limit)))) + (args (append (list "filelog") long-flag branch-flag limit-flag (list file)))) (p4-lowlevel-command-into-buffer args (or buffer "log")))) (defun p4-lowlevel-opened (file) diff --git a/vc-p4.el b/vc-p4.el index e1d88bf..817f813 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -381,7 +381,7 @@ comment COMMENT." (let ((default-directory (file-name-directory file))) (p4-lowlevel-reopen file))) -(defun vc-p4-print-log (files &optional buffer) +(defun vc-p4-print-log (files &optional buffer shortlog limit) "Print Perforce log for FILE into *vc* buffer." ;; `log-view-mode' needs to have the file name in order to function ;; correctly. "p4 logview" does not print it, so we insert it here by @@ -399,7 +399,7 @@ comment COMMENT." (default-directory (file-name-directory file))) (with-current-buffer buffer - (p4-lowlevel-filelog file (current-buffer) t t) + (p4-lowlevel-filelog file (current-buffer) (not shortlog) nil limit) ;; Insert the file name at the beginning. (goto-char (point-min)) (insert "File: " (file-name-nondirectory file) "\n"))))