Commit ce27f264 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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 "\\=...
parent eb6a9dca
...@@ -346,29 +346,30 @@ value of this flag.") ...@@ -346,29 +346,30 @@ value of this flag.")
(let ((rev (buffer-substring (match-beginning 1) (let ((rev (buffer-substring (match-beginning 1)
(match-end 1)))) (match-end 1))))
;; ... and check for the locking state ;; ... and check for the locking state
(if (re-search-forward (cond
(concat "\\=[0-9]+[/-][0-9]+[/-][0-9]+ " ; date ((looking-at
"[0-9]+:[0-9]+:[0-9]+\\([+-][0-9:]+\\)? " ; time (concat "[0-9]+[/-][01][0-9][/-][0-3][0-9] " ; date
"[^ ]+ [^ ]+ ") ; author & state "[0-2][0-9]:[0-5][0-9]+:[0-6][0-9]+\\([+-][0-9:]+\\)? " ; time
nil t) "[^ ]+ [^ ]+ ")) ; author & state
(cond (goto-char (match-end 0)) ; [0-6] in regexp handles leap seconds
;; unlocked revision (cond
((looking-at "\\$") ;; unlocked revision
(vc-file-setprop file 'vc-workfile-version rev) ((looking-at "\\$")
(vc-file-setprop file 'vc-locking-user 'none) (vc-file-setprop file 'vc-workfile-version rev)
'rev-and-lock) (vc-file-setprop file 'vc-locking-user 'none)
;; revision is locked by some user 'rev-and-lock)
((looking-at "\\([^ ]+\\) \\$") ;; revision is locked by some user
(vc-file-setprop file 'vc-workfile-version rev) ((looking-at "\\([^ ]+\\) \\$")
(vc-file-setprop file 'vc-locking-user (vc-file-setprop file 'vc-workfile-version rev)
(buffer-substring (match-beginning 1) (vc-file-setprop file 'vc-locking-user
(match-end 1))) (buffer-substring (match-beginning 1)
'rev-and-lock) (match-end 1)))
;; everything else: false 'rev-and-lock)
(nil)) ;; everything else: false
;; unexpected information in (nil)))
;; keyword string --> quit ;; unexpected information in
nil))) ;; keyword string --> quit
(nil))))
;; search for $Revision ;; search for $Revision
;; -------------------- ;; --------------------
((re-search-forward (concat "\\$" ((re-search-forward (concat "\\$"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment