Changeset 12622 in project


Ignore:
Timestamp:
11/28/08 02:20:56 (13 years ago)
Author:
azul
Message:

Fixed: use base for notify-subscribers-normal. Also use the commit timestamp as the email's Date.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/svnwiki-mail/trunk/svnwiki-mail.scm

    r12580 r12622  
    879879  (notify-subscribers-generic
    880880    (lambda (env rev)
    881       (let-from-environment env (path)
    882         ; paths in the subversion logs start with a slash.
    883         (let ((entry (assoc (format #f "/~A" path) (first rev))))
     881      (let-from-environment env (path base)
     882        (let* ((path-normal (svnwiki-mail-path-canonical (svnwiki-make-pathname base path)))
     883               (entry (find (lambda (data)
     884                              (and (not (svnwiki-is-discuss? (car data)))
     885                                   (string=? (svnwiki-mail-path-canonical (car data)) path-normal)))
     886                            (first rev))))
    884887          (if entry
    885888            (stream
     
    893896    (cut make-mail-gateway-address <> "xsvnwiki-mail/notifications/")
    894897    (lambda (rev address id gateway-address env original-file)
    895       (format #t "From: ~A~%" (make-mail-gateway-address env "xsvnwiki-mail/notifications/"))
    896898      (let ((description
    897899              (string->stream
     
    907909              (stream->string (stream-string-max description 60))))
    908910      (format #t "To: ~A~%" address)
     911      (format #t "From: ~A~%" (make-mail-gateway-address env "xsvnwiki-mail/notifications/"))
     912      (print-mail-date (changed-file-seconds rev))
    909913      (format #t "List-ID: ~A~%" (make-mail-list-id env (format "~A.notifications" id)))
    910914      (format #t "List-Post: NO~%"))
     
    925929                  (stream-lines (string->stream (changed-file-description rev))))
    926930                (newline)
    927                 (format #t "~%Commited on: ~A~%~%" (seconds->string (changed-file-seconds rev)))
    928931                (mail-footnote (environment env ((path path-subscribed))) address)))))))))
     932
     933(define (print-mail-date seconds)
     934  (svnwiki-format #t "Date: ~A~%"
     935                  (strftime
     936                    "%a, %d %b %Y %H:%M:%S +0000"
     937                    seconds)))
    929938
    930939(define notify-subscribers-discuss
    931940  (notify-subscribers-generic
    932941    (lambda (env rev)
    933       (format (current-error-port) "Get list (~S, ~S)~%" env rev)
    934942      (let-from-environment env (path base)
    935943        (stream-map
     
    960968                          path-discuss
    961969                          (get-nobody-address env)))
    962         (svnwiki-format #t "Date: ~A~%"
    963                         (strftime
    964                           "%a, %d %b %Y %H:%M:%S +0000"
    965                           (string->number (car (string-split
    966                                                  (last (string-split path-discuss "/"))
    967                                                  ":")))))
     970        (print-mail-date (string->number (car (string-split
     971                                                (last (string-split path-discuss "/"))
     972                                                ":"))))
    968973        (svnwiki-format #t "List-ID: ~A~%" (make-mail-list-id env id))
    969974        (svnwiki-format #t "List-Post: ~A~%" gateway-address)))
Note: See TracChangeset for help on using the changeset viewer.