mirror of
https://github.com/correl/melpa.git
synced 2024-11-14 19:19:32 +00:00
Handle newer CVS date formats like "2001/08/26 22:16:22" which break date-to-time
This commit is contained in:
parent
a69ee2af7e
commit
4b451f5dc7
1 changed files with 8 additions and 1 deletions
|
@ -82,7 +82,13 @@
|
|||
"Parse STR as a time, and format as a YYYYMMDD.HHMM string."
|
||||
;; We remove zero-padding the HH portion, as it is lost
|
||||
;; when stored in the archive-contents
|
||||
(let ((time (date-to-time (substring-no-properties str))))
|
||||
(let* ((s (substring-no-properties str))
|
||||
(time (condition-case nil
|
||||
(date-to-time s)
|
||||
('error
|
||||
;; Handle newer CVS formats like "2001/08/26 22:16:22"
|
||||
;; which break date-to-time
|
||||
(date-to-time (replace-regexp-in-string "/" "-" s))))))
|
||||
(concat (format-time-string "%Y%m%d." time)
|
||||
(format "%d" (or (parse-integer (format-time-string "%H%M" time)) 0)))))
|
||||
|
||||
|
@ -286,6 +292,7 @@ Return a cons cell whose `car' is the root and whose `cdr' is the repository."
|
|||
(apply 'pb/run-process dir "cvs" "log"
|
||||
(pb/expand-source-file-list dir config))
|
||||
(or (pb/find-parse-time-latest "date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\} \\+[0-9]\\{2\\}[0-9]\\{2\\}\\)")
|
||||
(pb/find-parse-time-latest "date: \\([0-9]\\{4\\}/[0-9]\\{2\\}/[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\);")
|
||||
(error "No valid timestamps found!"))
|
||||
)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue