Fixing prop usage, using rkt suffix, and better commit urls

This commit is contained in:
Jay McCarthy 2010-04-23 12:22:12 -06:00
parent 8e37ccb1bc
commit 3653883b02
3 changed files with 16 additions and 7 deletions

View File

@ -7,7 +7,7 @@
(define suffix (filename-extension pth))
(and suffix
(ormap (lambda (bs) (bytes=? suffix bs))
(list #"ss" #"scm" #"scrbl"))))
(list #"ss" #"scm" #"scrbl" #"rkt"))))
(define PROP:command-line "drdr:command-line")
(define PROP:timeout "drdr:timeout")
@ -65,5 +65,7 @@
(delete-file tmp-file))))))
(unless props:get-prop
(error 'get-prop "Could not load props file for ~e" (current-rev)))
(props:get-prop a-path prop def
#:as-string? as-string?))
; XXX get-prop is stupid and errors when a-path is invalid rather than returning def
(with-handlers ([exn? (lambda (x) def)])
(props:get-prop a-path prop def
#:as-string? as-string?)))

View File

@ -101,7 +101,13 @@
(regexp-replace "^(....-..-..)T(..:..:..).*Z$" date "\\1 \\2"))
(define (git-date->nice-date date)
(regexp-replace "^(....-..-..) (..:..:..).*$" date "\\1 \\2"))
(define (log->url log)
(define start-commit (git-push-start-commit log))
(define end-commit (git-push-end-commit log))
(if (string=? start-commit end-commit)
(format "http://github.com/plt/racket/commit/~a" end-commit)
(format "http://github.com/plt/racket/compare/~a...~a" start-commit end-commit)))
(define (format-commit-msg)
(define pth (revision-commit-msg (current-rev)))
(define (timestamp pth)
@ -608,9 +614,7 @@
(define log (read-cache (future-record-path rev)))
(define-values (committer title)
(log->committer+title log))
(define url
(format "http://github.com/plt/racket/commit/~a"
(git-push-end-commit log)))
(define url (log->url log))
`(tr ([class "dir"]
[title ,title])
(td (a ([href ,url]) ,name))

View File

@ -135,9 +135,12 @@
[to string?])]
[get-scm-commit-msg (exact-nonnegative-integer? path-string? . -> . git-push?)])
(define (git-push-start-commit gp)
(git-commit-hash (last (git-push-commits gp))))
(define (git-push-end-commit gp)
(git-commit-hash (first (git-push-commits gp))))
(provide/contract
[git-push-start-commit (git-push? . -> . string?)]
[git-push-end-commit (git-push? . -> . string?)])
(define scm-commit-author