comparison lisp/vc-cvs.el @ 41520:143b4b27b6c9

(vc-cvs-parse-entry): Rewrite, comparing the string- rather than integer- representation of dates.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 25 Nov 2001 23:52:51 +0000
parents 91eda91380cb
children 94df6eb103b3
comparison
equal deleted inserted replaced
41519:e89a31ff7deb 41520:143b4b27b6c9
3 ;; Copyright (C) 1995,98,99,2000,2001 Free Software Foundation, Inc. 3 ;; Copyright (C) 1995,98,99,2000,2001 Free Software Foundation, Inc.
4 4
5 ;; Author: FSF (see vc.el for full credits) 5 ;; Author: FSF (see vc.el for full credits)
6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8 ;; $Id: vc-cvs.el,v 1.25 2001/10/21 12:21:29 spiegel Exp $ 8 ;; $Id: vc-cvs.el,v 1.26 2001/10/22 07:57:00 spiegel Exp $
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify 12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by 13 ;; it under the terms of the GNU General Public License as published by
734 ((looking-at 734 ((looking-at
735 (concat "/[^/]+" 735 (concat "/[^/]+"
736 ;; revision 736 ;; revision
737 "/\\([^/]*\\)" 737 "/\\([^/]*\\)"
738 ;; timestamp 738 ;; timestamp
739 "/[A-Z][a-z][a-z]" ;; week day (irrelevant) 739 "/\\([^/]*\\)"))
740 " \\([A-Z][a-z][a-z]\\)" ;; month name
741 " *\\([0-9]*\\)" ;; day of month
742 " \\([0-9]*\\):\\([0-9]*\\):\\([0-9]*\\)" ;; hms
743 " \\([0-9]*\\)" ;; year
744 ;; optional conflict field
745 "\\(+[^/]*\\)?/"))
746 (vc-file-setprop file 'vc-workfile-version (match-string 1)) 740 (vc-file-setprop file 'vc-workfile-version (match-string 1))
747 ;; compare checkout time and modification time 741 ;; compare checkout time and modification time
748 (let ((second (string-to-number (match-string 6))) 742 (let ((mtime (nth 5 (file-attributes file)))
749 (minute (string-to-number (match-string 5))) 743 (system-time-locale "C"))
750 (hour (string-to-number (match-string 4))) 744 (cond ((equal (format-time-string "%c" mtime 'utc) (match-string 2))
751 (day (string-to-number (match-string 3)))
752 (year (string-to-number (match-string 7)))
753 (month (/ (string-match
754 (match-string 2)
755 "xxxJanFebMarAprMayJunJulAugSepOctNovDec")
756 3))
757 (mtime (nth 5 (file-attributes file))))
758 (cond ((equal mtime
759 (encode-time second minute hour day month year 0))
760 (vc-file-setprop file 'vc-checkout-time mtime) 745 (vc-file-setprop file 'vc-checkout-time mtime)
761 (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) 746 (if set-state (vc-file-setprop file 'vc-state 'up-to-date)))
762 (t 747 (t
763 (vc-file-setprop file 'vc-checkout-time 0) 748 (vc-file-setprop file 'vc-checkout-time 0)
764 (if set-state (vc-file-setprop file 'vc-state 'edited)))))) 749 (if set-state (vc-file-setprop file 'vc-state 'edited))))))))
765 ;; entry with arbitrary text as timestamp 750
766 ;; (this means we should consider it modified)
767 ((looking-at
768 (concat "/[^/]+"
769 ;; revision
770 "/\\([^/]*\\)"
771 ;; timestamp (arbitrary text)
772 "/[^/]*"
773 ;; optional conflict field
774 "\\(+[^/]*\\)?/"))
775 (vc-file-setprop file 'vc-workfile-version (match-string 1))
776 (vc-file-setprop file 'vc-checkout-time 0)
777 (if set-state (vc-file-setprop file 'vc-state 'edited)))))
778
779 (provide 'vc-cvs) 751 (provide 'vc-cvs)
780 752
781 ;;; vc-cvs.el ends here 753 ;;; vc-cvs.el ends here