From 7726d77a9422ca1178db42979aba9e3666df86ab Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 23 Jan 2021 10:25:34 -0800 Subject: [PATCH] =?UTF-8?q?Add=20client=20argument=20to=20=E2=80=98vc-p4-p?= =?UTF-8?q?rint-log=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- p4-lowlevel.el | 11 ++++++----- vc-p4.el | 6 +++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/p4-lowlevel.el b/p4-lowlevel.el index 5fb22f8..28dff84 100644 --- a/p4-lowlevel.el +++ b/p4-lowlevel.el @@ -544,17 +544,18 @@ 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 limit) +(cl-defun p4-lowlevel-filelog (file &key buffer long follow-branches limit client) "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). 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)) - (limit-flag (when limit (list "-m" (number-to-string limit)))) - (args (append (list "filelog") long-flag branch-flag limit-flag (list file)))) + (let* ((long-flag (if long (list "-l"))) + (branch-flag (if follow-branches (list "-i"))) + (limit-flag (if limit (list "-m" (number-to-string limit)))) + (client-args (if client (list "-c" client))) + (args (append client-args (list "filelog") long-flag branch-flag limit-flag (list file)))) (p4-lowlevel-command-into-buffer args (or buffer "log")))) (cl-defun p4-lowlevel-opened (file &key client) diff --git a/vc-p4.el b/vc-p4.el index 17ae79b..a95e9de 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -430,7 +430,11 @@ comment COMMENT." (default-directory (file-name-directory file))) (with-current-buffer buffer - (p4-lowlevel-filelog file (current-buffer) (not shortlog) nil limit) + (p4-lowlevel-filelog file + :buffer (current-buffer) + :long (not shortlog) + :limit limit + :client vc-p4-client) ;; Insert the file name at the beginning. (goto-char (point-min)) (insert "File: " (file-name-nondirectory file) "\n"))))