aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-04-13 15:18:11 +0000
committerStefan Monnier2001-04-13 15:18:11 +0000
commitbe0add3033b1409e10cc8645eff5cc596726303f (patch)
tree5a69a4425279bb1bb4b8319c07eb54afbea9e296
parent0c8f5eddc228e5999bffd120bfda6224bd216572 (diff)
downloademacs-be0add3033b1409e10cc8645eff5cc596726303f.tar.gz
emacs-be0add3033b1409e10cc8645eff5cc596726303f.zip
(cvs-addto-collection): Don't merge MESSAGE fileinfos.
(cvs-update-filter): Only advertise `cvs-mode-delete-lock' if the lock file appears to be reachable from Emacs. (cvs-mode-mark-on-state, cvs-mode-display-file): New functions. (cvs-mode-find-file): Look for cvs-header-face rather than cvs-dirname-face (which doesn't exist). (cvs-mode-find-file): Allow `other' to be set to `dont-select'.
-rw-r--r--lisp/pcvs.el90
1 files changed, 64 insertions, 26 deletions
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 19d87737c81..2ccafbd3c16 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -13,7 +13,7 @@
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.25 2001/01/29 20:22:28 monnier Exp $ 16;; Revision: $Id: pcvs.el,v 1.26 2001/03/07 00:20:30 monnier Exp $
17 17
18;; This file is part of GNU Emacs. 18;; This file is part of GNU Emacs.
19 19
@@ -78,6 +78,8 @@
78;; - marking 78;; - marking
79;; marking directories should jump to just after the dir. 79;; marking directories should jump to just after the dir.
80;; allow (un)marking directories at a time with the mouse. 80;; allow (un)marking directories at a time with the mouse.
81;; allow cvs-cmd-do to either clear the marks or not.
82;; add a "marks active" notion, like transient-mark-mode does.
81;; - liveness indicator 83;; - liveness indicator
82;; - indicate in docstring if the cmd understands the `b' prefix(es). 84;; - indicate in docstring if the cmd understands the `b' prefix(es).
83;; - call smerge-mode when opening CONFLICT files. 85;; - call smerge-mode when opening CONFLICT files.
@@ -97,7 +99,6 @@
97;; - does "cvs -n tag LAST_VENDOR" to find old files into *cvs* 99;; - does "cvs -n tag LAST_VENDOR" to find old files into *cvs*
98;; cvs-export 100;; cvs-export
99;; (with completion on tag names and hooks to help generate full releases) 101;; (with completion on tag names and hooks to help generate full releases)
100;; - allow cvs-cmd-do to either clear the marks or not.
101;; - display stickiness information. And current CVS/Tag as well. 102;; - display stickiness information. And current CVS/Tag as well.
102;; - write 'cvs-mode-admin' to do arbitrary 'cvs admin' commands 103;; - write 'cvs-mode-admin' to do arbitrary 'cvs admin' commands
103;; Most interesting would be version removal and log message replacement. 104;; Most interesting would be version removal and log message replacement.
@@ -628,7 +629,7 @@ it is finished."
628 (set-buffer obuf))))) 629 (set-buffer obuf)))))
629 630
630(defun cvs-parse-process (dcd &optional subdir) 631(defun cvs-parse-process (dcd &optional subdir)
631 "FIXME: bad name, no doc" 632 "FIXME: bad name, no doc."
632 (let* ((from-buf (current-buffer)) 633 (let* ((from-buf (current-buffer))
633 (fileinfos (cvs-parse-buffer 'cvs-parse-table dcd subdir)) 634 (fileinfos (cvs-parse-buffer 'cvs-parse-table dcd subdir))
634 (_ (set-buffer cvs-buffer)) 635 (_ (set-buffer cvs-buffer))
@@ -713,9 +714,9 @@ before calling the real function `" (symbol-name fun-1) "'.\n")
713 (let ((proc (get-buffer-process cvs-temp-buffer))) 714 (let ((proc (get-buffer-process cvs-temp-buffer)))
714 (when proc (delete-process proc))))) 715 (when proc (delete-process proc)))))
715 716
716;;; 717;;
717;;; Maintaining the collection in the face of updates 718;; Maintaining the collection in the face of updates
718;;; 719;;
719 720
720(defun cvs-addto-collection (c fi &optional tin) 721(defun cvs-addto-collection (c fi &optional tin)
721 "Add FI to C and return FI's corresponding tin. 722 "Add FI to C and return FI's corresponding tin.
@@ -731,7 +732,8 @@ TIN specifies an optional starting point."
731 (while (not (or (null next-tin) 732 (while (not (or (null next-tin)
732 (cvs-fileinfo< fi (ewoc-data next-tin)))) 733 (cvs-fileinfo< fi (ewoc-data next-tin))))
733 (setq tin next-tin next-tin (ewoc-next c next-tin))) 734 (setq tin next-tin next-tin (ewoc-next c next-tin)))
734 (if (cvs-fileinfo< (ewoc-data tin) fi) 735 (if (or (cvs-fileinfo< (ewoc-data tin) fi)
736 (eq (cvs-fileinfo->type fi) 'MESSAGE))
735 ;; tin < fi < next-tin 737 ;; tin < fi < next-tin
736 (ewoc-enter-after c tin fi) 738 (ewoc-enter-after c tin fi)
737 ;; fi == tin 739 ;; fi == tin
@@ -990,8 +992,9 @@ for a lock file. If so, it inserts a message cookie in the *cvs* buffer."
990 (cvs-create-fileinfo 992 (cvs-create-fileinfo
991 'MESSAGE "" " " 993 'MESSAGE "" " "
992 (concat msg 994 (concat msg
993 (substitute-command-keys 995 (when (file-exists-p lock)
994 "\n\t(type \\[cvs-mode-delete-lock] to delete it)")) 996 (substitute-command-keys
997 "\n\t(type \\[cvs-mode-delete-lock] to delete it)")))
995 :subtype 'TEMP)) 998 :subtype 'TEMP))
996 (pop-to-buffer (current-buffer)) 999 (pop-to-buffer (current-buffer))
997 (goto-char (point-max)) 1000 (goto-char (point-max))
@@ -1137,6 +1140,31 @@ marked instead. A directory can never be marked."
1137 (setf (cvs-fileinfo->marked cookie) t))) 1140 (setf (cvs-fileinfo->marked cookie) t)))
1138 cvs-cookies)) 1141 cvs-cookies))
1139 1142
1143(defun-cvs-mode (cvs-mode-mark-on-state . SIMPLE) (state)
1144 "Mark all files in state STATE."
1145 (interactive
1146 (list
1147 (let ((default
1148 (condition-case nil
1149 (downcase
1150 (symbol-name
1151 (cvs-fileinfo->type
1152 (cvs-mode-marked nil nil :read-only t :one t :noquery t))))
1153 (error nil))))
1154 (intern
1155 (upcase
1156 (completing-read
1157 (concat
1158 "Mark files in state" (if default (concat " [" default "]")) ": ")
1159 (mapcar (lambda (x)
1160 (list (downcase (symbol-name (car x)))))
1161 cvs-states)
1162 nil t nil nil default))))))
1163 (ewoc-map (lambda (fi)
1164 (when (eq (cvs-fileinfo->type fi) state)
1165 (setf (cvs-fileinfo->marked fi) t)))
1166 cvs-cookies))
1167
1140(defun-cvs-mode cvs-mode-mark-matching-files (regex) 1168(defun-cvs-mode cvs-mode-mark-matching-files (regex)
1141 "Mark all files matching REGEX." 1169 "Mark all files matching REGEX."
1142 (interactive "sMark files matching: ") 1170 (interactive "sMark files matching: ")
@@ -1276,9 +1304,9 @@ If FILE is non-nil, directory entries won't be selected."
1276 (mapcar 'cvs-fileinfo->full-path 1304 (mapcar 'cvs-fileinfo->full-path
1277 (apply 'cvs-mode-marked -cvs-mode-files-args))))) 1305 (apply 'cvs-mode-marked -cvs-mode-files-args)))))
1278 1306
1279;;; 1307;;
1280;;; Interface between Log-Edit and PCL-CVS 1308;; Interface between Log-Edit and PCL-CVS
1281;;; 1309;;
1282 1310
1283(defun cvs-mode-commit-setup () 1311(defun cvs-mode-commit-setup ()
1284 "Run `cvs-mode-commit' with setup." 1312 "Run `cvs-mode-commit' with setup."
@@ -1329,15 +1357,16 @@ The POSTPROC specified there (typically `log-edit') is then called,
1329(defun-cvs-mode (cvs-mode-insert . NOARGS) (file) 1357(defun-cvs-mode (cvs-mode-insert . NOARGS) (file)
1330 "Insert an entry for a specific file." 1358 "Insert an entry for a specific file."
1331 (interactive 1359 (interactive
1332 (list (read-file-name "File to insert: " 1360 (list (read-file-name
1333 ;; Can't use ignore-errors here because interactive 1361 "File to insert: "
1334 ;; specs aren't byte-compiled. 1362 ;; Can't use ignore-errors here because interactive
1335 (condition-case nil 1363 ;; specs aren't byte-compiled.
1336 (file-name-as-directory 1364 (condition-case nil
1337 (expand-file-name 1365 (file-name-as-directory
1338 (cvs-fileinfo->dir 1366 (expand-file-name
1339 (car (cvs-mode-marked nil nil :read-only t))))) 1367 (cvs-fileinfo->dir
1340 (error nil))))) 1368 (cvs-mode-marked nil nil :read-only t :one t :noquery t))))
1369 (error nil)))))
1341 (cvs-insert-file file)) 1370 (cvs-insert-file file))
1342 1371
1343(defun cvs-insert-file (file) 1372(defun cvs-insert-file (file)
@@ -1734,6 +1763,12 @@ This command ignores files that are not flagged as `Unknown'."
1734 (cvs-mode-find-file e t)) 1763 (cvs-mode-find-file e t))
1735 1764
1736 1765
1766(defun cvs-mode-display-file (e)
1767 "Show a buffer containing the file in another window."
1768 (interactive (list last-input-event))
1769 (cvs-mode-find-file e 'dont-select))
1770
1771
1737(defun cvs-find-modif (fi) 1772(defun cvs-find-modif (fi)
1738 (with-temp-buffer 1773 (with-temp-buffer
1739 (call-process cvs-program nil (current-buffer) nil 1774 (call-process cvs-program nil (current-buffer) nil
@@ -1750,7 +1785,7 @@ With a prefix, opens the buffer in an OTHER window."
1750 (interactive (list last-input-event current-prefix-arg)) 1785 (interactive (list last-input-event current-prefix-arg))
1751 (when (ignore-errors (mouse-set-point e) t) ;for invocation via the mouse 1786 (when (ignore-errors (mouse-set-point e) t) ;for invocation via the mouse
1752 (unless (memq (get-text-property (point) 'face) 1787 (unless (memq (get-text-property (point) 'face)
1753 '(cvs-dirname-face cvs-filename-face)) 1788 '(cvs-header-face cvs-filename-face))
1754 (error "Not a file name"))) 1789 (error "Not a file name")))
1755 (cvs-mode! 1790 (cvs-mode!
1756 (lambda (&optional rev) 1791 (lambda (&optional rev)
@@ -1761,14 +1796,17 @@ With a prefix, opens the buffer in an OTHER window."
1761 (let ((odir default-directory)) 1796 (let ((odir default-directory))
1762 (setq default-directory 1797 (setq default-directory
1763 (cvs-expand-dir-name (cvs-fileinfo->dir fi))) 1798 (cvs-expand-dir-name (cvs-fileinfo->dir fi)))
1764 (if other 1799 (cond ((eq other 'dont-select)
1765 (dired-other-window default-directory) 1800 (display-buffer (find-file-noselect default-directory)))
1766 (dired default-directory)) 1801 (other (dired-other-window default-directory))
1802 (t (dired default-directory)))
1767 (set-buffer cvs-buf) 1803 (set-buffer cvs-buf)
1768 (setq default-directory odir)) 1804 (setq default-directory odir))
1769 (let ((buf (if rev (cvs-retrieve-revision fi rev) 1805 (let ((buf (if rev (cvs-retrieve-revision fi rev)
1770 (find-file-noselect (cvs-fileinfo->full-path fi))))) 1806 (find-file-noselect (cvs-fileinfo->full-path fi)))))
1771 (funcall (if other 'switch-to-buffer-other-window 'switch-to-buffer) 1807 (funcall (cond ((eq other 'dont-select) 'display-buffer)
1808 (other 'switch-to-buffer-other-window)
1809 (t 'switch-to-buffer))
1772 buf) 1810 buf)
1773 (when (and cvs-find-file-and-jump (cvs-applicable-p fi 'diff-base)) 1811 (when (and cvs-find-file-and-jump (cvs-applicable-p fi 'diff-base))
1774 (goto-line (cvs-find-modif fi))) 1812 (goto-line (cvs-find-modif fi)))