Mercurial > emacs
comparison lisp/vc.el @ 32093:5c36fa51ee96
(vc-revert-file): New function.
(vc-revert-buffer): Delegate some of the work to it.
author | André Spiegel <spiegel@gnu.org> |
---|---|
date | Tue, 03 Oct 2000 11:22:13 +0000 |
parents | 4b577e4fc758 |
children | adf341c172af |
comparison
equal
deleted
inserted
replaced
32092:b0a117b99837 | 32093:5c36fa51ee96 |
---|---|
2 | 2 |
3 ;; Copyright (C) 1992,93,94,95,96,97,98,2000 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1992,93,94,95,96,97,98,2000 Free Software Foundation, Inc. |
4 | 4 |
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 | |
8 ;; $Id$ | |
7 | 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 |
11 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
2175 (make-frame-invisible) | 2177 (make-frame-invisible) |
2176 (delete-window)))) | 2178 (delete-window)))) |
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))) |
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)) | |
2187 | 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. |
2191 A prefix argument NOREVERT means do not revert the buffer afterwards." | 2199 A prefix argument NOREVERT means do not revert the buffer afterwards." |