Add client argument to ‘vc-p4-steal-lock’

This commit is contained in:
Tom Willemse 2021-01-23 10:19:13 -08:00
parent a24331f2cc
commit ed30884133
2 changed files with 9 additions and 6 deletions

View file

@ -642,12 +642,13 @@ QUIET is non-nil, then the `-q' flag is passed to `p4 print'."
;; Do NOT need to support "-t". ;; Do NOT need to support "-t".
;; Do NOT need to support the specification of multiple files. ;; Do NOT need to support the specification of multiple files.
(defun p4-lowlevel-reopen (file &optional changelist) (cl-defun p4-lowlevel-reopen (file &key changelist client)
"Call `p4 reopen' on FILE. "Call `p4 reopen' on FILE.
Optional CHANGELIST specifies the changelist to which to move it." Optional CHANGELIST specifies the changelist to which to move it."
(p4-lowlevel-command-or-error (append (list "reopen") (let* ((client-args (if client (list "-c" client)))
(if changelist (list "-c" changelist) nil) (changelist-args (if changelist (list "-c" changelist)))
(list file)))) (args (append client-args (list "reopen") changelist-args (list file))))
(p4-lowlevel-command-or-error args)))
;; Here's what we need to support from the "p4 resolve" command, at least for ;; Here's what we need to support from the "p4 resolve" command, at least for
;; the time being: ;; the time being:

View file

@ -407,8 +407,10 @@ comment COMMENT."
(error "Can't specify version when stealing Perforce lock.")) (error "Can't specify version when stealing Perforce lock."))
;; Must set default-directory because this is called in a mail send hook and ;; Must set default-directory because this is called in a mail send hook and
;; thus not with the current buffer set to the file being reopened. ;; thus not with the current buffer set to the file being reopened.
(let ((default-directory (file-name-directory file))) (let ((default-directory (file-name-directory file))
(p4-lowlevel-reopen file))) (vc-p4-client (with-current-buffer (find-file file)
vc-p4-client)))
(p4-lowlevel-reopen file :client vc-p4-client)))
(defun vc-p4-print-log (files &optional buffer shortlog revision limit) (defun vc-p4-print-log (files &optional buffer shortlog revision limit)
"Print Perforce log for FILE into *vc* buffer." "Print Perforce log for FILE into *vc* buffer."