summaryrefslogtreecommitdiff
path: root/lisp/vc-hooks.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-06-27 19:06:15 +0000
committerRichard M. Stallman <rms@gnu.org>1995-06-27 19:06:15 +0000
commitce27f2642eec3e03f4cac171634c2dd494c2636a (patch)
treec6bf59724daa0601b4069930073cc8c629fb4713 /lisp/vc-hooks.el
parenteb6a9dca6cd446d0bcbe4073f0b99b70bfa4352a (diff)
downloademacs-ce27f2642eec3e03f4cac171634c2dd494c2636a.tar.gz
(vc-consult-rcs-headers): Use an even more
pedantic regexp to match RCS time strings. Improved efficiency by using looking-at instead of re-search "\\=...
Diffstat (limited to 'lisp/vc-hooks.el')
-rw-r--r--lisp/vc-hooks.el47
1 files changed, 24 insertions, 23 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 1b31024ac8d..1ae9ecfe642 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -346,29 +346,30 @@ value of this flag.")
(let ((rev (buffer-substring (match-beginning 1)
(match-end 1))))
;; ... and check for the locking state
- (if (re-search-forward
- (concat "\\=[0-9]+[/-][0-9]+[/-][0-9]+ " ; date
- "[0-9]+:[0-9]+:[0-9]+\\([+-][0-9:]+\\)? " ; time
- "[^ ]+ [^ ]+ ") ; author & state
- nil t)
- (cond
- ;; unlocked revision
- ((looking-at "\\$")
- (vc-file-setprop file 'vc-workfile-version rev)
- (vc-file-setprop file 'vc-locking-user 'none)
- 'rev-and-lock)
- ;; revision is locked by some user
- ((looking-at "\\([^ ]+\\) \\$")
- (vc-file-setprop file 'vc-workfile-version rev)
- (vc-file-setprop file 'vc-locking-user
- (buffer-substring (match-beginning 1)
- (match-end 1)))
- 'rev-and-lock)
- ;; everything else: false
- (nil))
- ;; unexpected information in
- ;; keyword string --> quit
- nil)))
+ (cond
+ ((looking-at
+ (concat "[0-9]+[/-][01][0-9][/-][0-3][0-9] " ; date
+ "[0-2][0-9]:[0-5][0-9]+:[0-6][0-9]+\\([+-][0-9:]+\\)? " ; time
+ "[^ ]+ [^ ]+ ")) ; author & state
+ (goto-char (match-end 0)) ; [0-6] in regexp handles leap seconds
+ (cond
+ ;; unlocked revision
+ ((looking-at "\\$")
+ (vc-file-setprop file 'vc-workfile-version rev)
+ (vc-file-setprop file 'vc-locking-user 'none)
+ 'rev-and-lock)
+ ;; revision is locked by some user
+ ((looking-at "\\([^ ]+\\) \\$")
+ (vc-file-setprop file 'vc-workfile-version rev)
+ (vc-file-setprop file 'vc-locking-user
+ (buffer-substring (match-beginning 1)
+ (match-end 1)))
+ 'rev-and-lock)
+ ;; everything else: false
+ (nil)))
+ ;; unexpected information in
+ ;; keyword string --> quit
+ (nil))))
;; search for $Revision
;; --------------------
((re-search-forward (concat "\\$"