From 553914a5aca3ad3ff6503336869dbe05c9a6a854 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 23 Jan 2021 09:39:24 -0800 Subject: [PATCH] Fix using client for registering new files --- p4-lowlevel.el | 6 ++++-- vc-p4.el | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/p4-lowlevel.el b/p4-lowlevel.el index 86b5ae2..e5f1e51 100644 --- a/p4-lowlevel.el +++ b/p4-lowlevel.el @@ -603,9 +603,11 @@ files, then returns a list of lists of field-name/value elements." (car lists) lists))) -(defun p4-lowlevel-info () +(cl-defun p4-lowlevel-info (&key client) "Return an alist representing the output of `p4 info'." - (let* ((base-alist (p4-lowlevel-command-or-error "info" nil nil t)) + (let* ((client-args (if client (list "-c" client))) + (args (append client-args (list "info"))) + (base-alist (p4-lowlevel-command-or-error args nil nil t)) (info-elements (p4-lowlevel-re-assoc "^info" base-alist)) line tag value info-alist element) (while info-elements diff --git a/vc-p4.el b/vc-p4.el index 1a6759c..6fe9c8f 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -913,7 +913,7 @@ If DIRNAME is not specified, uses `default-directory'." (defun vc-p4-is-in-client (file) "Return true if FILE is inside the p4 client hierarchy." (let* ((default-directory (file-name-directory file)) - (info (p4-lowlevel-info)) + (info (p4-lowlevel-info :client vc-p4-client)) (root (alist-get "Client root" info nil nil #'string=)) (cwd (alist-get "Current directory" info nil nil #'string=))) (string-prefix-p root cwd)))