]> code.delx.au - gnu-emacs/blobdiff - lisp/vc-hooks.el
Fix a typo in a comment. Reported by Michel de Ruiter <Michel@smr.nl>.
[gnu-emacs] / lisp / vc-hooks.el
index bb110c1e3e0933f2dfae61582f5c74cd163ec91e..5591d4908109fc1a9c8bbd91dacf05c2227ef035 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author:     Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
 
-;; $Id: vc-hooks.el,v 1.111 1998/08/08 07:11:40 rms Exp fx $
+;; $Id: vc-hooks.el,v 1.1 2000/01/10 13:25:12 gerd Exp gerd $
 
 ;; This file is part of GNU Emacs.
 
@@ -194,7 +194,7 @@ similarly for other version control systems."
   ;; number of the subexpression that should be returned. If there's
   ;; a third element (also the number of a subexpression), that 
   ;; subexpression is assumed to be a date field and we want the most
-  ;; recent entry matching the template.
+  ;; recent entry matching the template; this works for RCS format dates only.
   ;; If FILE and PROPERTIES are given, the latter must be a list of
   ;; properties of the same length as PATTERNS; each property is assigned 
   ;; the corresponding value.
@@ -213,6 +213,13 @@ similarly for other version control systems."
              (let ((latest-date "") (latest-val))
                (while (re-search-forward (car p) nil t)
                  (let ((date (vc-match-substring (elt p 2))))
+                   ;; Most (but not all) versions of RCS use two-digit years
+                   ;; to represent dates in the range 1900 through 1999.
+                   ;; The two-digit and four-digit notations can both appear
+                   ;; in the same file.  Normalize the two-digit versions.
+                   (save-match-data
+                     (if (string-match "\\`[0-9][0-9]\\." date)
+                          (setq date (concat "19" date))))
                    (if (string< latest-date date)
                        (progn
                          (setq latest-date date)
@@ -879,15 +886,16 @@ For CVS, the full name of CVS/Entries is returned."
           (file-directory-p (concat dirname "CVS/"))
           (file-readable-p (concat dirname "CVS/Entries")))
       (let ((file (concat dirname basename))
-            ;; make sure that the file name is searched 
-            ;; case-sensitively
-            (case-fold-search nil)
             buffer)
        (unwind-protect
            (save-excursion
              (setq buffer (set-buffer (get-buffer-create "*vc-info*")))
              (vc-insert-file (concat dirname "CVS/Entries"))
              (goto-char (point-min))
+             ;; make sure that the file name is searched 
+             ;; case-sensitively - case-fold-search is a buffer-local
+             ;; variable, so setting it here won't affect any other buffers
+             (setq case-fold-search nil)
              (cond
               ;; entry for a "locally added" file (not yet committed)
               ((re-search-forward
@@ -962,7 +970,10 @@ For CVS, the full name of CVS/Entries is returned."
   "Change read-only status of current buffer, perhaps via version control.
 If the buffer is visiting a file registered with version control,
 then check the file in or out.  Otherwise, just change the read-only flag
-of the buffer.  With prefix argument, ask for version number."
+of the buffer.
+With prefix argument, ask for version number to check in or check out.
+Check-out of a specified version number does not lock the file;
+to do that, use this command a second time with no argument."
   (interactive "P")
   (if (or (and (boundp 'vc-dired-mode) vc-dired-mode)
           ;; use boundp because vc.el might not be loaded