]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/pcvs.el
Merge from emacs-24; up to 2012-12-17T11:17:34Z!rgm@gnu.org
[gnu-emacs] / lisp / vc / pcvs.el
index 4bc3eaf8c2c0b6ee7190245bc2ee3e522dea1ff3..208b93d9670524d3e037daeaaf54b18f20ebb8a3 100644 (file)
@@ -1,6 +1,6 @@
 ;;; pcvs.el --- a front-end to CVS
 
-;; Copyright (C) 1991-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2013 Free Software Foundation, Inc.
 
 ;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com
 ;;     (Per Cederqvist) ceder@lysator.liu.se
@@ -856,7 +856,8 @@ the problem."
 (defun cvs-cleanup-collection (c rm-handled rm-dirs rm-msgs)
   "Remove undesired entries.
 C is the collection
-RM-HANDLED if non-nil means remove handled entries.
+RM-HANDLED if non-nil means remove handled entries (if file is currently
+  visited, only remove if value is `all').
 RM-DIRS behaves like `cvs-auto-remove-directories'.
 RM-MSGS if non-nil means remove messages."
   (let (last-fi first-dir (rerun t))
@@ -870,16 +871,17 @@ RM-MSGS if non-nil means remove messages."
                  (subtype (cvs-fileinfo->subtype fi))
                  (keep
                   (pcase type
-                    ;; remove temp messages and keep the others
+                    ;; Remove temp messages and keep the others.
                     (`MESSAGE (not (or rm-msgs (eq subtype 'TEMP))))
-                    ;; remove entries
+                    ;; Remove dead entries.
                     (`DEAD nil)
-                    ;; handled also?
+                    ;; Handled also?
                     (`UP-TO-DATE
-                      (if (find-buffer-visiting (cvs-fileinfo->full-name fi))
-                          t
-                        (not rm-handled)))
-                    ;; keep the rest
+                      (not
+                       (if (find-buffer-visiting (cvs-fileinfo->full-name fi))
+                           (eq rm-handled 'all)
+                         rm-handled)))
+                    ;; Keep the rest.
                     (_ (not (run-hook-with-args-until-success
                              'cvs-cleanup-functions fi))))))
 
@@ -2121,7 +2123,7 @@ if you are convinced that the process that created the lock is dead."
 Empty directories are removed."
   (interactive)
   (cvs-cleanup-collection cvs-cookies
-                         t (or cvs-auto-remove-directories 'handled) t))
+                         'all (or cvs-auto-remove-directories 'handled) t))
 
 
 (defun-cvs-mode cvs-mode-acknowledge ()