diff --git a/p4-lowlevel.el b/p4-lowlevel.el index 7434b67..8dc295f 100644 --- a/p4-lowlevel.el +++ b/p4-lowlevel.el @@ -663,9 +663,11 @@ resolve. Raises an error if the command fails." ;; Do NOT need to support "-c". ;; Do NOT need to support the specification of multiple files. -(defun p4-lowlevel-revert (file) +(cl-defun p4-lowlevel-revert (file &key client) "Tell Perforce to unedit FILE." - (p4-lowlevel-command-or-error (list "revert" file))) + (let* ((client-args (if client (list "-c" client))) + (args (append client-args (list "revert" file)))) + (p4-lowlevel-command-or-error args))) ;; Here's what we need to support from the "p4 submit" command, at least for the ;; time being: diff --git a/vc-p4.el b/vc-p4.el index 04fc093..d741481 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -265,10 +265,10 @@ special case of a Perforce file that is added but not yet committed." (if (yes-or-no-p "Preserve current contents? ") (let ((tempfile (format "%s.vc-register~" file))) (rename-file file tempfile) - (p4-lowlevel-revert file) + (p4-lowlevel-revert file :client vc-p4-client) (delete-file file) (rename-file tempfile file)) - (p4-lowlevel-revert file)) + (p4-lowlevel-revert file :client vc-p4-client)) (p4-lowlevel-edit file)) (error "File %s already opened for delete." file)) (p4-lowlevel-add file)))) @@ -350,7 +350,7 @@ comment COMMENT." ;; to use sync instead of revert. (p4-lowlevel-sync file (vc-workfile-version file) t)) (t - (p4-lowlevel-revert file))) + (p4-lowlevel-revert file :client vc-p4-client))) (if (string= action "add") (vc-file-clearprops file) (vc-p4-state file nil t))))