summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Spiegel <spiegel@gnu.org>2000-11-19 09:58:38 +0000
committerAndré Spiegel <spiegel@gnu.org>2000-11-19 09:58:38 +0000
commit19a79b62ec4cf92172b122a8c0e4fab96ec42021 (patch)
tree2575039c4540b88fbcafd47e51aa8af2517f80b5
parent5675c431ba46f1ac0dcf27759ca2f9c1df3df6b6 (diff)
downloademacs-19a79b62ec4cf92172b122a8c0e4fab96ec42021.tar.gz
(vc-workfile-unchanged-p, vc-default-workfile-unchanged-p): Moved here
from vc.el.
-rw-r--r--lisp/vc-hooks.el18
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index a91f76740d3..53108653f04 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -5,7 +5,7 @@
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <spiegel@gnu.org>
-;; $Id: vc-hooks.el,v 1.127 2000/11/04 18:24:50 spiegel Exp $
+;; $Id: vc-hooks.el,v 1.128 2000/11/06 13:19:38 monnier Exp $
;; This file is part of GNU Emacs.
@@ -365,14 +365,26 @@ It simply calls the real state computation function `vc-BACKEND-state'
and does not employ any heuristic at all."
(vc-call-backend backend 'state file))
+(defun vc-workfile-unchanged-p (file)
+ "Has FILE changed since last checkout?"
+ (let ((checkout-time (vc-file-getprop file 'vc-checkout-time))
+ (lastmod (nth 5 (file-attributes file))))
+ (if checkout-time
+ (equal checkout-time lastmod)
+ (let ((unchanged (vc-call workfile-unchanged-p file)))
+ (vc-file-setprop file 'vc-checkout-time (if unchanged lastmod 0))
+ unchanged))))
+
+(defun vc-default-workfile-unchanged-p (file)
+ "Default check whether FILE is unchanged: diff against master version."
+ (zerop (vc-call diff file (vc-workfile-version file))))
+
(defun vc-workfile-version (file)
"Return version level of the current workfile FILE."
(or (vc-file-getprop file 'vc-workfile-version)
(vc-file-setprop file 'vc-workfile-version
(vc-call workfile-version file))))
-;;; actual version-control code starts here
-
(defun vc-default-registered (backend file)
"Check if FILE is registered in BACKEND using vc-BACKEND-master-templates."
(let ((sym (vc-make-backend-sym backend 'master-templates)))