aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert1996-01-20 20:42:06 +0000
committerPaul Eggert1996-01-20 20:42:06 +0000
commitc18381d187ef35fa274da3132759b1acbeef4f2c (patch)
treeee9bd60664d5ffc0a4d916261186fd9cfca9f352
parent7999547d03264fbd1f2b15e4276c35a65ecacd5d (diff)
downloademacs-c18381d187ef35fa274da3132759b1acbeef4f2c.tar.gz
emacs-c18381d187ef35fa274da3132759b1acbeef4f2c.zip
(vc-utc-string): Remove; it wasn't reliable near DST or leap-second
transitions. (vc-find-cvs-master): Convert UTC string to encoded time and compare the results to the file attributes, rather than attempting to convert file attributes to UTC string (which wasn't reliable).
-rw-r--r--lisp/vc-hooks.el32
1 files changed, 15 insertions, 17 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 9fbe79508a7..27b57e17de1 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -764,20 +764,6 @@ For CVS, the full name of CVS/Entries is returned."
764 vc-master-templates) 764 vc-master-templates)
765 nil))))) 765 nil)))))
766 766
767(defun vc-utc-string (timeval)
768 ;; Convert a time value into universal time, and return it as a
769 ;; human-readable string. This is for comparing CVS checkout times
770 ;; with file modification times.
771 (let (utc (high (car timeval)) (low (nth 1 timeval))
772 (offset (car (current-time-zone timeval))))
773 (setq low (- low offset))
774 (setq utc (if (> low 65535)
775 (list (1+ high) (- low 65536))
776 (if (< low 0)
777 (list (1- high) (+ 65536 low))
778 (list high low))))
779 (current-time-string utc)))
780
781(defun vc-find-cvs-master (dirname basename) 767(defun vc-find-cvs-master (dirname basename)
782 ;; Check if DIRNAME/BASENAME is handled by CVS. 768 ;; Check if DIRNAME/BASENAME is handled by CVS.
783 ;; If it is, do a (throw 'found (cons MASTER 'CVS)). 769 ;; If it is, do a (throw 'found (cons MASTER 'CVS)).
@@ -801,7 +787,7 @@ For CVS, the full name of CVS/Entries is returned."
801 (cond 787 (cond
802 ((re-search-forward 788 ((re-search-forward
803 (concat "^/" (regexp-quote basename) 789 (concat "^/" (regexp-quote basename)
804 "/\\([^/]*\\)/\\([^/]*\\)/") 790 "/\\([^/]*\\)/[^ /]* \\([A-Z][a-z][a-z]\\) *\\([0-9]*\\) \\([0-9]*\\):\\([0-9]*\\):\\([0-9]*\\) \\([0-9]*\\)/")
805 nil t) 791 nil t)
806 (setq case-fold-search fold) ;; restore the old value 792 (setq case-fold-search fold) ;; restore the old value
807 ;; We found it. Store away version number now that we 793 ;; We found it. Store away version number now that we
@@ -811,8 +797,20 @@ For CVS, the full name of CVS/Entries is returned."
811 (match-string 1)) 797 (match-string 1))
812 ;; If the file hasn't been modified since checkout, 798 ;; If the file hasn't been modified since checkout,
813 ;; store the checkout-time. 799 ;; store the checkout-time.
814 (let ((mtime (nth 5 (file-attributes file)))) 800 (let ((mtime (nth 5 (file-attributes file)))
815 (if (string= (match-string 2) (vc-utc-string mtime)) 801 (second (string-to-number (match-string 6)))
802 (minute (string-to-number (match-string 5)))
803 (hour (string-to-number (match-string 4)))
804 (day (string-to-number (match-string 3)))
805 (year (string-to-number (match-string 7))))
806 (if (equal mtime
807 (encode-time
808 second minute hour day
809 (/ (string-match
810 (match-string 2)
811 "xxxJanFebMarAprMayJunJulAugSepOctNovDec")
812 3)
813 year 0))
816 (vc-file-setprop file 'vc-checkout-time mtime) 814 (vc-file-setprop file 'vc-checkout-time mtime)
817 (vc-file-setprop file 'vc-checkout-time 0))) 815 (vc-file-setprop file 'vc-checkout-time 0)))
818 (throw 'found (cons (concat dirname "CVS/Entries") 'CVS))) 816 (throw 'found (cons (concat dirname "CVS/Entries") 'CVS)))