diff --git a/p4-lowlevel.el b/p4-lowlevel.el index b17a2c2..5fb22f8 100644 --- a/p4-lowlevel.el +++ b/p4-lowlevel.el @@ -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 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. Optional CHANGELIST specifies the changelist to which to move it." - (p4-lowlevel-command-or-error (append (list "reopen") - (if changelist (list "-c" changelist) nil) - (list file)))) + (let* ((client-args (if client (list "-c" client))) + (changelist-args (if changelist (list "-c" changelist))) + (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 ;; the time being: diff --git a/vc-p4.el b/vc-p4.el index fd1a4a8..17ae79b 100644 --- a/vc-p4.el +++ b/vc-p4.el @@ -407,8 +407,10 @@ comment COMMENT." (error "Can't specify version when stealing Perforce lock.")) ;; 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. - (let ((default-directory (file-name-directory file))) - (p4-lowlevel-reopen file))) + (let ((default-directory (file-name-directory 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) "Print Perforce log for FILE into *vc* buffer."