Fixing github links re samth

This commit is contained in:
Jay McCarthy 2010-08-13 12:02:54 -06:00
parent 339681018a
commit fa576a5886
2 changed files with 14 additions and 2 deletions

View File

@ -106,7 +106,7 @@
(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)))
(format "http://github.com/plt/racket/compare/~a...~a" (git-push-previous-commit log) end-commit)))
(define (format-commit-msg)
(define pth (revision-commit-msg (current-rev)))
@ -116,11 +116,14 @@
(define bdate/s (timestamp "checkout-done"))
(define bdate/e (timestamp "integrated"))
(match (read-cache* pth)
[(struct git-push (num author commits))
[(and gp (struct git-push (num author commits)))
(define start-commit (git-push-start-commit gp))
(define end-commit (git-push-end-commit gp))
`(table ([class "data"])
(tr ([class "author"]) (td "Author:") (td ,author))
(tr ([class "date"]) (td "Build Start:") (td ,bdate/s))
(tr ([class "date"]) (td "Build End:") (td ,bdate/e))
(tr ([class "hash"]) (td "Diff:") (td (a ([href ,(log->url gp)]) ,(substring start-commit 0 8) ".." ,(substring end-commit 0 8))))
,@(append-map
(match-lambda
[(struct git-merge (hash author date msg from to))

View File

@ -1,6 +1,7 @@
#lang scheme
(require "svn.ss"
"path-utils.ss"
"dirstruct.ss"
net/url
scheme/system)
(provide
@ -146,11 +147,19 @@
[to string?])]
[get-scm-commit-msg (exact-nonnegative-integer? path-string? . -> . git-push?)])
(define (git-push-previous-commit gp)
(define start (git-push-start-commit gp))
(parameterize ([current-directory (plt-repository)])
(system/output-port
#:k (λ (port) (read-line port))
(git-path)
"--no-pager" "log" "--format=format:%P" start "-1")))
(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-previous-commit (git-push? . -> . string?)]
[git-push-start-commit (git-push? . -> . string?)]
[git-push-end-commit (git-push? . -> . string?)])