From: Chris Hanson Date: Mon, 9 Dec 2002 06:04:58 +0000 (+0000) Subject: Implement editor variable vc-cvs-stay-local which tells VC to trust X-Git-Tag: 20090517-FFI~2113 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=76ef237e7a98f99cb874a075067c99ad37b08bb7;p=mit-scheme.git Implement editor variable vc-cvs-stay-local which tells VC to trust the CVS timestamps when trying to see whether a file has been modified, rather than querying the repository. --- diff --git a/v7/src/edwin/edwin.pkg b/v7/src/edwin/edwin.pkg index 72cc4ec60..82a8e2148 100644 --- a/v7/src/edwin/edwin.pkg +++ b/v7/src/edwin/edwin.pkg @@ -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 diff --git a/v7/src/edwin/vc.scm b/v7/src/edwin/vc.scm index 5838b38e2..7121113cd 100644 --- a/v7/src/edwin/vc.scm +++ b/v7/src/edwin/vc.scm @@ -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?) ;;;; 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)