From 7af739cc7d0a118c191f245a0efb938f5107d4b0 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 23 Jan 2021 10:34:05 -0800 Subject: [PATCH] =?UTF-8?q?Add=20client=20argument=20to=20=E2=80=98vc-p4-d?= =?UTF-8?q?elete=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 68e5b31..74d46b0 100644 --- a/p4-lowlevel.el +++ b/p4-lowlevel.el @@ -384,10 +384,12 @@ Returns nil or raises an error on failure." ;; file which already exists in the repository. (p4-lowlevel-command-or-error args))) -(defun p4-lowlevel-delete (file) +(cl-defun p4-lowlevel-delete (file &key client) "Tell Perforce to delet FILE from the repository. Returns nil or raises an error on failure." - (p4-lowlevel-command-or-error (list "delete" file))) + (let* ((client-args (if client (list "-c" client))) + (args (append client-args (list "delete" file)))) + (p4-lowlevel-command-or-error args))) ;; Here's what we need to support from the "p4 change" command, at least for the ;; time being: diff --git a/vc-p4.el b/vc-p4.el index 83eef69..4ea6d09 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -1015,7 +1015,7 @@ The difference to vc-do-command is that this function always invokes `p4'." (defun vc-p4-delete-file (file) "Tell perforce to delete FILE from the repository." - (p4-lowlevel-delete file)) + (p4-lowlevel-delete file :client vc-p4-client)) (defun vc-p4-switch-client (client) (interactive