Add client argument to ‘p4-lowlevel-revert’

This commit is contained in:
Tom Willemse 2021-01-21 23:12:22 -08:00
parent 6724d2b827
commit 2b270a93f0
2 changed files with 7 additions and 5 deletions

View file

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

View file

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