Function: vc-revert-file

vc-revert-file is a byte-compiled function defined in vc.el.gz.

Signature

(vc-revert-file FILE)

Documentation

Revert FILE back to the repository working revision it was based on.

If FILE is a directory, revert all files inside that directory.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
(defun vc-revert-file (file)
  "Revert FILE back to the repository working revision it was based on.
If FILE is a directory, revert all files inside that directory."
  (with-vc-properties
   (list file)
   (let* ((dir (file-directory-p file))
          (backup-file (and (not dir) (vc-version-backup-file file))))
     (when backup-file
       (copy-file backup-file file 'ok-if-already-exists)
       (vc-delete-automatic-version-backups file))
     (vc-call-backend (if dir
                          (vc-responsible-backend file)
                        (vc-backend file))
                      'revert file backup-file))
   `((vc-state . up-to-date)
     (vc-checkout-time . ,(file-attribute-modification-time
			   (file-attributes file)))))
  (vc-resynch-buffer file t t))