39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
"fossil json timeline checkin -n 0"
json-read)))
(timeline (aref (aref data "payload") "timeline")) ;; extract the timeline alists
(start-flag #f)
(end-flag #f))
;; now we have all needed data as a list of alists in time order, extract the
;; messages for given branch starting at start-tag and ending at end-tag
(filter
(lambda (x) x)
(map
(lambda (entry)
(let ((tags (aref entry "tags")))
(if (or (not tags) ;; eh?
(not (list? tags)))
(begin
;; (with-output-to-port (current-error-port)
;; (lambda ()
;; (print "ERROR: bad entry. tags: " tags)))
#f)
(let* ((btag (car tags)) ;; first tag is the primary branch
(tags (cdr tags)) ;; remainder are actual tags
(cmt (aref entry "comment"))
(usr (aref entry "user"))
(tms (aref entry "timestamp")))
;; (print "btag: " btag " tags: " tags " usr: " usr)
(if (equal? btag branch) ;; we are on the branch
(begin
(if (member start-tag tags)(set! start-flag #t))
(let ((res (if (and start-flag
(not end-flag))
`(,usr
,(time->string (seconds->local-time tms) "WW%U.%w %H:%M")
,cmt)
#f)))
(if (member end-tag tags)(set! end-flag #t))
res))
#f)))))
(reverse timeline)))))
(define (process-fossil branch start-tag end-tag)
(print-rows
(extract-history branch start-tag end-tag)))
;; process command line args and dispatch the call to fossil processing
;;
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
"fossil json timeline checkin -n 0"
json-read)))
(timeline (aref (aref data "payload") "timeline")) ;; extract the timeline alists
(start-flag #f)
(end-flag #f))
;; now we have all needed data as a list of alists in time order, extract the
;; messages for given branch starting at start-tag and ending at end-tag
(reverse ;; return results oldest to newest
(filter
(lambda (x) x)
(map
(lambda (entry)
(let ((tags (aref entry "tags")))
(if (or (not tags) ;; eh?
(not (list? tags)))
(begin
;; (with-output-to-port (current-error-port)
;; (lambda ()
;; (print "ERROR: bad entry. tags: " tags)))
#f)
(let* ((btag (car tags)) ;; first tag is the primary branch
(tags (cdr tags)) ;; remainder are actual tags
(cmt (aref entry "comment"))
(usr (aref entry "user"))
(tms (aref entry "timestamp")))
;; (print "btag: " btag " tags: " tags " usr: " usr)
(if (equal? btag branch) ;; we are on the branch
(begin
(if (member start-tag tags)(set! start-flag #t))
(let ((res (if (and start-flag
(not end-flag))
`(,usr
,(time->string (seconds->local-time tms) "WW%U.%w %H:%M")
,cmt)
#f)))
(if (member end-tag tags)(set! end-flag #t))
res))
#f)))))
(reverse timeline))))))
(define (process-fossil branch start-tag end-tag)
(print-rows
(extract-history branch start-tag end-tag)))
;; process command line args and dispatch the call to fossil processing
;;
|