aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-06-27 19:06:15 +0000
committerRichard M. Stallman1995-06-27 19:06:15 +0000
commitce27f2642eec3e03f4cac171634c2dd494c2636a (patch)
treec6bf59724daa0601b4069930073cc8c629fb4713
parenteb6a9dca6cd446d0bcbe4073f0b99b70bfa4352a (diff)
downloademacs-ce27f2642eec3e03f4cac171634c2dd494c2636a.tar.gz
emacs-ce27f2642eec3e03f4cac171634c2dd494c2636a.zip
(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 "\\=...
-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.")
346 (let ((rev (buffer-substring (match-beginning 1) 346 (let ((rev (buffer-substring (match-beginning 1)
347 (match-end 1)))) 347 (match-end 1))))
348 ;; ... and check for the locking state 348 ;; ... and check for the locking state
349 (if (re-search-forward 349 (cond
350 (concat "\\=[0-9]+[/-][0-9]+[/-][0-9]+ " ; date 350 ((looking-at
351 "[0-9]+:[0-9]+:[0-9]+\\([+-][0-9:]+\\)? " ; time 351 (concat "[0-9]+[/-][01][0-9][/-][0-3][0-9] " ; date
352 "[^ ]+ [^ ]+ ") ; author & state 352 "[0-2][0-9]:[0-5][0-9]+:[0-6][0-9]+\\([+-][0-9:]+\\)? " ; time
353 nil t) 353 "[^ ]+ [^ ]+ ")) ; author & state
354 (cond 354 (goto-char (match-end 0)) ; [0-6] in regexp handles leap seconds
355 ;; unlocked revision 355 (cond
356 ((looking-at "\\$") 356 ;; unlocked revision
357 (vc-file-setprop file 'vc-workfile-version rev) 357 ((looking-at "\\$")
358 (vc-file-setprop file 'vc-locking-user 'none) 358 (vc-file-setprop file 'vc-workfile-version rev)
359 'rev-and-lock) 359 (vc-file-setprop file 'vc-locking-user 'none)
360 ;; revision is locked by some user 360 'rev-and-lock)
361 ((looking-at "\\([^ ]+\\) \\$") 361 ;; revision is locked by some user
362 (vc-file-setprop file 'vc-workfile-version rev) 362 ((looking-at "\\([^ ]+\\) \\$")
363 (vc-file-setprop file 'vc-locking-user 363 (vc-file-setprop file 'vc-workfile-version rev)
364 (buffer-substring (match-beginning 1) 364 (vc-file-setprop file 'vc-locking-user
365 (match-end 1))) 365 (buffer-substring (match-beginning 1)
366 'rev-and-lock) 366 (match-end 1)))
367 ;; everything else: false 367 'rev-and-lock)
368 (nil)) 368 ;; everything else: false
369 ;; unexpected information in 369 (nil)))
370 ;; keyword string --> quit 370 ;; unexpected information in
371 nil))) 371 ;; keyword string --> quit
372 (nil))))
372 ;; search for $Revision 373 ;; search for $Revision
373 ;; -------------------- 374 ;; --------------------
374 ((re-search-forward (concat "\\$" 375 ((re-search-forward (concat "\\$"