(vc-p4-checkin): Multiple files commit.

[git-p4: depot-paths = "//guest/Ben_Key/vc-p4/,//guest/jonathan_kamens/vc-p4/,//guest/magnus_henoch/vc-p4/": change = 7269]
This commit is contained in:
Magnus Henoch 2009-06-05 11:47:35 -08:00
parent c68de18b24
commit 97229d0b82

View file

@ -263,20 +263,18 @@ administered by Perforce."
(p4-lowlevel-print file rev buffer t)) (p4-lowlevel-print file rev buffer t))
(defun vc-p4-checkin (files rev comment) (defun vc-p4-checkin (files rev comment)
"Check FILE into Perforce. Error if REV is non-nil. Check in with "Check FILES into Perforce. Error if REV is non-nil. Check in with
comment COMMENT." comment COMMENT."
(if rev (if rev
(error "Can't specify revision for Perforce checkin.")) (error "Can't specify revision for Perforce checkin."))
;; In emacs-23 vc-checkin has a list of files as a parameter, before (let* (;; XXX: default-directory? this should work for most (all?) cases
;; it used to be just a single file. We don't support that interface (default-directory (file-name-directory (car files)))
;; yet, so just use the first file in the list.
(let* ((file (if (listp files) (car files) files))
(default-directory (file-name-directory file))
(change-buffer (p4-lowlevel-change)) (change-buffer (p4-lowlevel-change))
(indent-tabs-mode 1) (indent-tabs-mode 1)
insertion-start change-number) insertion-start change-number)
(if (vc-p4-has-unresolved-conflicts-p file) (dolist (file files)
(error "File %s has unresolved conflicts" file)) (if (vc-p4-has-unresolved-conflicts-p file)
(error "File %s has unresolved conflicts" file)))
(save-excursion (save-excursion
(set-buffer change-buffer) (set-buffer change-buffer)
(goto-char (point-min)) (goto-char (point-min))
@ -287,13 +285,14 @@ comment COMMENT."
(indent-rigidly insertion-start (point) 8) (indent-rigidly insertion-start (point) 8)
(re-search-forward "^Files:\\s-*\n") (re-search-forward "^Files:\\s-*\n")
(delete-region (point) (point-max)) (delete-region (point) (point-max))
(insert "\t" (vc-file-getprop file 'vc-p4-depot-file) "\n") (dolist (file files)
(insert "\t" (vc-file-getprop file 'vc-p4-depot-file) "\n"))
(setq change-number (p4-lowlevel-change (current-buffer) t)) (setq change-number (p4-lowlevel-change (current-buffer) t))
(p4-lowlevel-change (current-buffer) change-number) (p4-lowlevel-change (current-buffer) change-number)
(p4-lowlevel-submit (current-buffer)) (p4-lowlevel-submit (current-buffer))
; Update its properties ; Update its properties
(vc-p4-state file nil t) (dolist (file files)
(vc-mode-line file)))) (vc-p4-state file nil t)))))
;;; FIXME: this should not have a DESTFILE argument ;;; FIXME: this should not have a DESTFILE argument
(defun vc-p4-checkout (file &optional editable rev destfile) (defun vc-p4-checkout (file &optional editable rev destfile)