* vc-p4.el (vc-p4-print-log): Accept optional arguments shortlog

and limit, as required by Emacs 23.1.50.

* p4-lowlevel.el (p4-lowlevel-filelog): Accept limit argument.

[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7487]
This commit is contained in:
Magnus Henoch 2009-11-17 16:35:08 -08:00
parent af857b4d50
commit a0e7fbe5e1
2 changed files with 7 additions and 5 deletions

View file

@ -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)

View file

@ -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"))))