Mercurial > emacs
comparison lisp/vc.el @ 33611:d00c8e827c5b
(vc-workfile-unchanged-p, vc-default-workfile-unchanged-p): Moved to
vc-hooks.el.
author | André Spiegel <spiegel@gnu.org> |
---|---|
date | Sun, 19 Nov 2000 09:52:45 +0000 |
parents | d8c822512b62 |
children | c97a649b1987 |
comparison
equal
deleted
inserted
replaced
33610:32bcc6e27e02 | 33611:d00c8e827c5b |
---|---|
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.289 2000/11/16 18:17:26 spiegel Exp $ | 8 ;; $Id: vc.el,v 1.290 2000/11/16 18:28:11 monnier 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 |
822 (if (or vc-suppress-confirm | 822 (if (or vc-suppress-confirm |
823 (y-or-n-p (format "Buffer %s modified; save it? " (buffer-name)))) | 823 (y-or-n-p (format "Buffer %s modified; save it? " (buffer-name)))) |
824 (save-buffer) | 824 (save-buffer) |
825 (unless not-urgent | 825 (unless not-urgent |
826 (error "Aborted"))))) | 826 (error "Aborted"))))) |
827 | |
828 (defun vc-workfile-unchanged-p (file) | |
829 "Has FILE changed since last checkout?" | |
830 (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) | |
831 (lastmod (nth 5 (file-attributes file)))) | |
832 (if checkout-time | |
833 (equal checkout-time lastmod) | |
834 (let ((unchanged (vc-call workfile-unchanged-p file))) | |
835 (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0)) | |
836 unchanged)))) | |
837 | |
838 (defun vc-default-workfile-unchanged-p (file) | |
839 "Default check whether FILE is unchanged: diff against master version." | |
840 (zerop (vc-call diff file (vc-workfile-version file)))) | |
841 | 827 |
842 (defun vc-recompute-state (file) | 828 (defun vc-recompute-state (file) |
843 "Force a recomputation of the version control state of FILE. | 829 "Force a recomputation of the version control state of FILE. |
844 The state is computed using the exact, and possibly expensive | 830 The state is computed using the exact, and possibly expensive |
845 function `vc-BACKEND-state', not the heuristic." | 831 function `vc-BACKEND-state', not the heuristic." |