Implement editor variable vc-cvs-stay-local which tells VC to trust
authorChris Hanson <org/chris-hanson/cph>
Mon, 9 Dec 2002 06:04:58 +0000 (06:04 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 9 Dec 2002 06:04:58 +0000 (06:04 +0000)
the CVS timestamps when trying to see whether a file has been
modified, rather than querying the repository.

v7/src/edwin/edwin.pkg
v7/src/edwin/vc.scm

index 72cc4ec60801ba676b6161ffa9b6e6a7bb69ebdc..82a8e214869cee15499b1d0295f687c50c377596 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: edwin.pkg,v 1.282 2002/11/20 19:45:59 cph Exp $
+$Id: edwin.pkg,v 1.283 2002/12/09 06:04:58 cph Exp $
 
 Copyright (c) 1989-2002 Massachusetts Institute of Technology
 
@@ -1136,6 +1136,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
            edwin-variable$vc-checkin-hooks
            edwin-variable$vc-checkout-carefully
            edwin-variable$vc-command-messages
+           edwin-variable$vc-cvs-stay-local
            edwin-variable$vc-default-init-version
            edwin-variable$vc-delete-logbuf-window
            edwin-variable$vc-display-status
index 5838b38e2fedaad76fabe91a46cf2a28caf70a90..7121113cd4944d7cc2215b1671e28cfe78c1fb4a 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: vc.scm,v 1.80 2002/11/20 19:46:04 cph Exp $
+;;; $Id: vc.scm,v 1.81 2002/12/09 06:04:43 cph Exp $
 ;;;
-;;; Copyright (c) 1994-2001 Massachusetts Institute of Technology
+;;; Copyright (c) 1994-2002 Massachusetts Institute of Technology
 ;;;
 ;;; This file is part of MIT Scheme.
 ;;;
@@ -130,6 +130,12 @@ Otherwise, not displayed."
 Otherwise, the mod time of the file is the checkout time."
   #t
   boolean?)
+
+(define-variable vc-cvs-stay-local
+  "If true, use only the CVS timestamp to tell if a file has been modified.
+Otherwise, VC will compare the file to the copy in the repository."
+  #t
+  boolean?)
 \f
 ;;;; VC-TYPE datatype
 
@@ -982,13 +988,15 @@ Normally shows only locked files; prefix arg says to show all files."
                           #f)
                          ((cvs-master? master)
                           (and (vc-workfile-modified? master)
-                               (case (cvs-status master)
-                                 ((LOCALLY-MODIFIED) "modified")
-                                 ((LOCALLY-ADDED) "added")
-                                 ((NEEDS-CHECKOUT) "patch")
-                                 ((NEEDS-MERGE) "merge")
-                                 ((UNRESOLVED-CONFLICT) "conflict")
-                                 (else #f))))
+                               (if (vc-cvs-stay-local? master)
+                                   "modified"
+                                   (case (cvs-status master)
+                                     ((LOCALLY-MODIFIED) "modified")
+                                     ((LOCALLY-ADDED) "added")
+                                     ((NEEDS-CHECKOUT) "patch")
+                                     ((NEEDS-MERGE) "merge")
+                                     ((UNRESOLVED-CONFLICT) "conflict")
+                                     (else #f)))))
                          (else
                           (vc-backend-locking-user master #f))))))
             (if (or status all-files?)
@@ -2123,11 +2131,15 @@ the value of vc-log-mode-hook."
                     (and ts
                          (string=? ts (file-time->global-ctime-string tw)))))
              #f
-             (let ((modified? (vc-backend-diff master #f #f #t)))
-               (set-vc-cvs-workfile-mtime-string! master tm tw modified?)
-               modified?))
+             (or (vc-cvs-stay-local? master)
+                 (let ((modified? (vc-backend-diff master #f #f #t)))
+                   (set-vc-cvs-workfile-mtime-string! master tm tw modified?)
+                   modified?)))
          (vc-backend-diff master #f #f #t)))))
 
+(define (vc-cvs-stay-local? master)
+  (ref-variable vc-cvs-stay-local (vc-workfile-buffer master #f)))
+
 (define (vc-cvs-workfile-mtime-string master)
   (read-cached-value-2 master 'CVS-MTIME-STRING
                       (vc-master-pathname master)