comparison lisp/pcvs.el @ 45325:8b7e7b9551fe

(cvs-cmd-do): Accept non-CVS dirs with CVS-ctrl'd subdirs. (cvs-mode-add-change-log-entry-other-window): Work on multiple files. (cvs-mode-set-flags): Don't cons unnecessarily.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 16 May 2002 20:03:52 +0000
parents 3626a12fe452
children 4c3a4e9f96e7
comparison
equal deleted inserted replaced
45324:76c4660660ec 45325:8b7e7b9551fe
11 ;; (Stefan Monnier) monnier@cs.yale.edu 11 ;; (Stefan Monnier) monnier@cs.yale.edu
12 ;; (Greg Klanderman) greg@alphatech.com 12 ;; (Greg Klanderman) greg@alphatech.com
13 ;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com 13 ;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com
14 ;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu 14 ;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu
15 ;; Keywords: CVS, version control, release management 15 ;; Keywords: CVS, version control, release management
16 ;; Revision: $Id: pcvs.el,v 1.33 2002/01/25 22:41:28 monnier Exp $ 16 ;; Revision: $Id: pcvs.el,v 1.34 2002/04/03 16:56:36 kai Exp $
17 17
18 ;; This file is part of GNU Emacs. 18 ;; This file is part of GNU Emacs.
19 19
20 ;; GNU Emacs is free software; you can redistribute it and/or modify 20 ;; GNU Emacs is free software; you can redistribute it and/or modify
21 ;; it under the terms of the GNU General Public License as published by 21 ;; it under the terms of the GNU General Public License as published by
470 (abbreviate-file-name (expand-file-name dir)))) 470 (abbreviate-file-name (expand-file-name dir))))
471 (cvsbuf (cvs-make-cvs-buffer dir new))) 471 (cvsbuf (cvs-make-cvs-buffer dir new)))
472 ;; Check that dir is under CVS control. 472 ;; Check that dir is under CVS control.
473 (unless (file-directory-p dir) 473 (unless (file-directory-p dir)
474 (error "%s is not a directory" dir)) 474 (error "%s is not a directory" dir))
475 (unless (or noexist (file-directory-p (expand-file-name "CVS" dir))) 475 (unless (or noexist (file-directory-p (expand-file-name "CVS" dir))
476 (file-expand-wildcards (expand-file-name "*/CVS" dir)))
476 (error "%s does not contain CVS controlled files" dir)) 477 (error "%s does not contain CVS controlled files" dir))
477 478
478 (set-buffer cvsbuf) 479 (set-buffer cvsbuf)
479 (cvs-mode-run cmd flags fis 480 (cvs-mode-run cmd flags fis
480 :cvsargs cvsargs :dont-change-disc dont-change-disc) 481 :cvsargs cvsargs :dont-change-disc dont-change-disc)
1375 ;;;; 1376 ;;;;
1376 ;;;; CVS Mode commands 1377 ;;;; CVS Mode commands
1377 ;;;; 1378 ;;;;
1378 1379
1379 (defun-cvs-mode (cvs-mode-insert . NOARGS) (file) 1380 (defun-cvs-mode (cvs-mode-insert . NOARGS) (file)
1380 "Insert an entry for a specific file." 1381 "Insert an entry for a specific file into the current listing.
1382 This is typically used if the file is up-to-date (or has been added
1383 outside of PCL-CVS) and one wants to do some operation on it."
1381 (interactive 1384 (interactive
1382 (list (read-file-name 1385 (list (read-file-name
1383 "File to insert: " 1386 "File to insert: "
1384 ;; Can't use ignore-errors here because interactive 1387 ;; Can't use ignore-errors here because interactive
1385 ;; specs aren't byte-compiled. 1388 ;; specs aren't byte-compiled.
1978 ;; ChangeLog support. 1981 ;; ChangeLog support.
1979 1982
1980 (defun-cvs-mode cvs-mode-add-change-log-entry-other-window () 1983 (defun-cvs-mode cvs-mode-add-change-log-entry-other-window ()
1981 "Add a ChangeLog entry in the ChangeLog of the current directory." 1984 "Add a ChangeLog entry in the ChangeLog of the current directory."
1982 (interactive) 1985 (interactive)
1983 (let* ((fi (cvs-mode-marked nil nil :one t)) 1986 (dolist (fi (cvs-mode-marked nil nil))
1984 (default-directory (cvs-expand-dir-name (cvs-fileinfo->dir fi))) 1987 (let ((default-directory (cvs-expand-dir-name (cvs-fileinfo->dir fi)))
1985 (buffer-file-name (expand-file-name (cvs-fileinfo->file fi)))) 1988 (buffer-file-name (expand-file-name (cvs-fileinfo->file fi))))
1986 (kill-local-variable 'change-log-default-name) 1989 (kill-local-variable 'change-log-default-name)
1987 (add-change-log-entry-other-window))) 1990 (save-excursion (add-change-log-entry-other-window)))))
1988 1991
1989 ;; interactive commands to set optional flags 1992 ;; interactive commands to set optional flags
1990 1993
1991 (defun cvs-mode-set-flags (flag) 1994 (defun cvs-mode-set-flags (flag)
1992 "Ask for new setting of cvs-FLAG-flags." 1995 "Ask for new setting of cvs-FLAG-flags."
1993 (interactive 1996 (interactive
1994 (list (completing-read 1997 (list (completing-read
1995 "Which flag: " 1998 "Which flag: "
1996 (mapcar 'list '("cvs" "diff" "update" "status" "log" "tag" ;"rtag" 1999 '("cvs" "diff" "update" "status" "log" "tag" ;"rtag"
1997 "commit" "remove" "undo" "checkout")) 2000 "commit" "remove" "undo" "checkout")
1998 nil t))) 2001 nil t)))
1999 (let* ((sym (intern (concat "cvs-" flag "-flags")))) 2002 (let* ((sym (intern (concat "cvs-" flag "-flags"))))
2000 (let ((current-prefix-arg '(16))) 2003 (let ((current-prefix-arg '(16)))
2001 (cvs-flags-query sym (concat flag " flags"))))) 2004 (cvs-flags-query sym (concat flag " flags")))))
2002 2005