          (log (if match
                   (substring comment (match-end 0))
                   "")))
-    (vc-darcs-do-command 'record 'async nil "-a" "--pipe" file)
+    (apply #'vc-darcs-do-command 'record 'async nil "-a" "--pipe" files)
     (with-current-buffer (get-buffer "*vc*")
       (process-send-string nil
                            (format "%s\n%s\n%s\n%s"

(defun vc-darcs-do-command (command okstatus file &rest flags)
  "Run darcs COMMAND using VC-DO-COMMAND."
  (let ((arguments (cdr (assq command vc-darcs-program-arguments))))
    (apply #'vc-do-command nil okstatus
           vc-darcs-program-name file (symbol-name command)
           (append arguments flags))))


        "darcs"
        (format "darcs/%s" (vc-state file)))))

(defun vc-darcs-register (files &optional rev comment)
  "Add FILES to the darcs repository, and record this.
REV and COMMENT are ignored."
  ;; Emacs 22 compatibility
  (when (stringp files)
    (setq files (list files)))
  (vc-darcs-do-command 'add 0 files))

(defun vc-darcs-checkin (files rev comment)
  "Record FILES to darcs.  COMMENT is the new comment."
  (when (not (null rev))
    (error "Cannot specify check-in revision with darcs."))
  ;; Emacs 22 compatibility
  (when (stringp files)
    (setq files (list files)))
  (let* ((date (format-time-string "%Y%m%d%H%M%S" nil t))
         (match (string-match "\n" comment))
         (patch-name (if match 
