comparison lisp/vc.el @ 33548:714a4c4917cd

(vc-revert-buffer): Ask for confirmation if file seems up-to-date.
author André Spiegel <spiegel@gnu.org>
date Thu, 16 Nov 2000 15:26:37 +0000
parents 4f99fed47d24
children 840460ecad6f
comparison
equal deleted inserted replaced
33547:1a45cc116462 33548:714a4c4917cd
1 ;;; vc.el --- drive a version-control system from within Emacs 1 ;; vc.el --- drive a version-control system from within Emacs
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 7
8 ;; $Id: vc.el,v 1.285 2000/10/27 12:13:19 spiegel Exp $ 8 ;; $Id: vc.el,v 1.286 2000/11/16 13:39:10 spiegel Exp $
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; 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
13 ;; 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
2185 (let ((file buffer-file-name) 2185 (let ((file buffer-file-name)
2186 ;; This operation should always ask for confirmation. 2186 ;; This operation should always ask for confirmation.
2187 (vc-suppress-confirm nil) 2187 (vc-suppress-confirm nil)
2188 (obuf (current-buffer)) 2188 (obuf (current-buffer))
2189 status) 2189 status)
2190 (if (vc-up-to-date-p file)
2191 (unless (yes-or-no-p "File seems up-to-date. Revert anyway? ")
2192 (error "Revert canceled")))
2190 (unless (vc-workfile-unchanged-p file) 2193 (unless (vc-workfile-unchanged-p file)
2191 ;; vc-diff selects the new window, which is not what we want: 2194 ;; vc-diff selects the new window, which is not what we want:
2192 ;; if the new window is on another frame, that'd require the user 2195 ;; if the new window is on another frame, that'd require the user
2193 ;; moving her mouse to answer the yes-or-no-p question. 2196 ;; moving her mouse to answer the yes-or-no-p question.
2194 (let ((win (save-selected-window 2197 (let ((win (save-selected-window
2798 comment upon first checkin of the file. 2801 comment upon first checkin of the file.
2799 2802
2800 `vc-keep-workfiles' Non-nil value prevents workfiles from being 2803 `vc-keep-workfiles' Non-nil value prevents workfiles from being
2801 deleted when changes are checked in 2804 deleted when changes are checked in
2802 2805
2803 `vc-suppress-confirm' Suppresses some confirmation prompts, 2806 `vc-suppress-confirm' Suppresses some confirmation prompts.
2804 notably for reversions.
2805 2807
2806 vc-BACKEND-header Which keywords to insert when adding headers 2808 vc-BACKEND-header Which keywords to insert when adding headers
2807 with \\[vc-insert-headers]. Defaults to 2809 with \\[vc-insert-headers]. Defaults to
2808 '(\"\%\W\%\") under SCCS, '(\"\$Id\$\") under 2810 '(\"\%\W\%\") under SCCS, '(\"\$Id\$\") under
2809 RCS and CVS. 2811 RCS and CVS.