diff options
| author | André Spiegel | 2000-10-03 11:22:13 +0000 |
|---|---|---|
| committer | André Spiegel | 2000-10-03 11:22:13 +0000 |
| commit | 045e1aa59e4e54967fe86f67dd927331edd6ed3c (patch) | |
| tree | f1d0c656139ab79bf9f39faf19ba34bb4805e4a9 | |
| parent | 1be1456864f586f71dde26495b8a3ad11568eaa4 (diff) | |
| download | emacs-045e1aa59e4e54967fe86f67dd927331edd6ed3c.tar.gz emacs-045e1aa59e4e54967fe86f67dd927331edd6ed3c.zip | |
(vc-revert-file): New function.
(vc-revert-buffer): Delegate some of the work to it.
| -rw-r--r-- | lisp/vc.el | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index d020162332e..3984c44470a 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | ;; Author: FSF (see below for full credits) | 5 | ;; Author: FSF (see below for full credits) |
| 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
| 7 | 7 | ||
| 8 | ;; $Id$ | ||
| 9 | |||
| 8 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 9 | 11 | ||
| 10 | ;; GNU Emacs is free software; you can redistribute it and/or modify | 12 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| @@ -2177,14 +2179,20 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action] | |||
| 2177 | (set-buffer obuf) | 2179 | (set-buffer obuf) |
| 2178 | ;; Do the reverting | 2180 | ;; Do the reverting |
| 2179 | (message "Reverting %s..." file) | 2181 | (message "Reverting %s..." file) |
| 2180 | (with-vc-properties | 2182 | (vc-revert-file file) |
| 2181 | file | ||
| 2182 | (vc-call revert file) | ||
| 2183 | `((vc-state up-to-date) | ||
| 2184 | (vc-checkout-time ,(nth 5 (file-attributes file))))) | ||
| 2185 | (vc-resynch-buffer file t t) | ||
| 2186 | (message "Reverting %s...done" file))) | 2183 | (message "Reverting %s...done" file))) |
| 2187 | 2184 | ||
| 2185 | (defun vc-revert-file (file) | ||
| 2186 | "Revert FILE back to the version it was based on." | ||
| 2187 | ;; TODO: With local version caching, this function will get the | ||
| 2188 | ;; base version locally and not from the server. | ||
| 2189 | (with-vc-properties | ||
| 2190 | file | ||
| 2191 | (vc-call revert file) | ||
| 2192 | `((vc-state up-to-date) | ||
| 2193 | (vc-checkout-time ,(nth 5 (file-attributes file))))) | ||
| 2194 | (vc-resynch-buffer file t t)) | ||
| 2195 | |||
| 2188 | ;;;###autoload | 2196 | ;;;###autoload |
| 2189 | (defun vc-cancel-version (norevert) | 2197 | (defun vc-cancel-version (norevert) |
| 2190 | "Get rid of most recently checked in version of this file. | 2198 | "Get rid of most recently checked in version of this file. |