From: Gerd Moellmann Date: Mon, 10 Jan 2000 13:29:53 +0000 (+0000) Subject: (vc-parse-buffer): Handle mixtures of dates X-Git-Tag: emacs-pretest-21.0.90~5404 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8321b22a9337d0b1bea77531f20a315ddf99a9b3;p=emacs.git (vc-parse-buffer): Handle mixtures of dates before and after the year 2000. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c189ab99ac..25d91e02968 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2000-01-10 Gerd Moellmann + * vc-hooks.el (vc-parse-buffer): Handle mixtures of dates + before and after the year 2000. + * textmodes/ispell-merged.el (xemacsp, version18p, version-20p): Add ispell- prefix. diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index da42dcbc12e..5591d490810 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -5,7 +5,7 @@ ;; Author: Eric S. Raymond ;; Maintainer: Andre Spiegel -;; $Id: vc-hooks.el,v 1.113 1998/11/11 18:47:32 kwzh Exp $ +;; $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)