comparison lisp/vc.el @ 21329:58dc75416c30

(vc-revert-buffer): Rewrote handling of vc-diff buffer, so that the file's buffer is always current when the actual revert is done.
author André Spiegel <spiegel@gnu.org>
date Wed, 01 Apr 1998 12:26:43 +0000
parents 8b4db8ce1da3
children b0e5a2784761
comparison
equal deleted inserted replaced
21328:d5ffccfcea21 21329:58dc75416c30
3 ;; Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
4 4
5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
6 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> 6 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
7 7
8 ;; $Id: vc.el,v 1.213 1998/03/31 17:19:32 spiegel Exp spiegel $ 8 ;; $Id: vc.el,v 1.214 1998/03/31 18:08:36 spiegel Exp spiegel $
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
1938 (pop-to-buffer vc-parent-buffer)) 1938 (pop-to-buffer vc-parent-buffer))
1939 (let ((file buffer-file-name) 1939 (let ((file buffer-file-name)
1940 ;; This operation should always ask for confirmation. 1940 ;; This operation should always ask for confirmation.
1941 (vc-suppress-confirm nil) 1941 (vc-suppress-confirm nil)
1942 (obuf (current-buffer)) (changed (vc-diff nil t))) 1942 (obuf (current-buffer)) (changed (vc-diff nil t)))
1943 (if (and changed (not (yes-or-no-p "Discard changes? "))) 1943 (if changed
1944 (progn 1944 (unwind-protect
1945 (if (not (yes-or-no-p "Discard changes? "))
1946 (error "Revert cancelled"))
1945 (if (and (window-dedicated-p (selected-window)) 1947 (if (and (window-dedicated-p (selected-window))
1946 (one-window-p t 'selected-frame)) 1948 (one-window-p t 'selected-frame))
1947 (make-frame-invisible (selected-frame)) 1949 (make-frame-invisible (selected-frame))
1948 (delete-window)) 1950 (delete-window))))
1949 (error "Revert cancelled")) 1951 (set-buffer obuf)
1950 (set-buffer obuf))
1951 (if changed
1952 (if (and (window-dedicated-p (selected-window))
1953 (one-window-p t 'selected-frame))
1954 (make-frame-invisible (selected-frame))
1955 (delete-window)))
1956 (vc-backend-revert file) 1952 (vc-backend-revert file)
1957 (vc-resynch-window file t t) 1953 (vc-resynch-window file t t)))
1958 )
1959 )
1960 1954
1961 ;;;###autoload 1955 ;;;###autoload
1962 (defun vc-cancel-version (norevert) 1956 (defun vc-cancel-version (norevert)
1963 "Get rid of most recently checked in version of this file. 1957 "Get rid of most recently checked in version of this file.
1964 A prefix argument means do not revert the buffer afterwards." 1958 A prefix argument means do not revert the buffer afterwards."