From: Chris Hanson Date: Fri, 31 Mar 2000 19:20:54 +0000 (+0000) Subject: In VC-Dired buffer, don't prompt for comment string unless one is X-Git-Tag: 20090517-FFI~4126 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d4773884ad1d89196f50e4548e7604fc894bc8f0;p=mit-scheme.git In VC-Dired buffer, don't prompt for comment string unless one is needed. --- diff --git a/v7/src/edwin/vc.scm b/v7/src/edwin/vc.scm index c2f1fb80e..4de7607dd 100644 --- a/v7/src/edwin/vc.scm +++ b/v7/src/edwin/vc.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: vc.scm,v 1.51 2000/03/31 19:08:27 cph Exp $ +;;; $Id: vc.scm,v 1.52 2000/03/31 19:20:54 cph Exp $ ;;; ;;; Copyright (c) 1994-2000 Massachusetts Institute of Technology ;;; @@ -453,22 +453,12 @@ with the logmessage as change commentary. A writable file is retained. merge in the changes into your working copy." "P" (lambda (revision?) - (if (vc-dired-buffer? (selected-buffer)) - (let ((files - (let ((files (dired-marked-files))) - (if (pair? files) - files - (dired-next-files 1))))) - (if (pair? files) - (if (pair? (cdr files)) - (vc-start-entry - #f "Enter a change comment for the marked files." #f - (vc-next-action-dired (selected-buffer)) - #f) - (vc-next-action-on-file (caar files) #t #f #f)))) - (vc-next-action-on-file (or (buffer-pathname (selected-buffer)) - (vc-registration-error #f)) - #f revision? #f)))) + (let ((buffer (selected-buffer))) + (if (vc-dired-buffer? buffer) + (vc-next-action-dired buffer) + (vc-next-action-on-file (or (buffer-pathname buffer) + (vc-registration-error #f)) + #f revision? #f))))) (define-command vc-register "Register the current file into your version-control system." @@ -546,15 +536,42 @@ merge in the changes into your working copy." ((string=? owner (current-user-name)) (do-checkin)) (else (vc-steal-lock master revision? comment owner)))))) (vc-register workfile revision? comment 'LOCK)))) - + (define (vc-next-action-dired buffer) - (lambda (comment) - (for-each-dired-mark buffer - (lambda (file) - (let ((msg (string-append "Processing " (->namestring file) "..."))) - (message msg) - (vc-next-action-on-file file #t #f comment) - (message msg "done")))))) + (let ((files + (let ((files (dired-marked-files buffer))) + (if (pair? files) + files + (dired-next-files 1))))) + (if (pair? files) + (if (pair? (cdr files)) + (vc-start-entry + #f + "Enter a change comment for the marked files." + (and (there-exists? files + (lambda (file) + (let ((master (file-vc-master file #f))) + (and master + (if (eq? vc-type:cvs (vc-master-type master)) + (memq (cvs-status master) + '(LOCALLY-MODIFIED + LOCALLY-ADDED + LOCALLY-REMOVED)) + (vc-backend-locking-user master #f)))))) + "") + #f + (lambda (comment) + (for-each-dired-mark buffer + (lambda (file) + (let ((msg + (string-append "Processing " + (->namestring file) + "..."))) + (message msg) + (vc-next-action-on-file file #t #f comment) + (message msg "done"))))) + #f) + (vc-next-action-on-file (caar files) #t #f #f))))) (define (vc-register workfile revision? comment keep?) (let ((buffer (pathname->buffer workfile)))