Changeset 15431 in project


Ignore:
Timestamp:
08/13/09 17:06:59 (10 years ago)
Author:
sjamaan
Message:

Implement commit functionality

Location:
release/4/qwiki/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/qwiki/trunk/qwiki-svn.scm

    r15421 r15431  
    3838(module qwiki-svn
    3939  (qwiki-repos-uri qwiki-repos-username qwiki-repos-password
    40    get-history call-with-input-revision checkout-sources! update-sources!)
     40   get-history call-with-input-revision checkout-sources! update-sources!
     41   store-changes!)
    4142
    4243(import chicken scheme)
     
    8687              (qwiki-repos-username) (qwiki-repos-password)))
    8788
     89(define (store-changes! source-path message)
     90  (define (get-info path)
     91    (let ((info '()))
     92      (svn-client-info path
     93                       svn-opt-revision-unspecified
     94                       svn-opt-revision-unspecified
     95                       (lambda (path i) (set! info (cons i info)))
     96                       #f (qwiki-repos-username) (qwiki-repos-password))
     97      (and (not (null? info)) (car info))))
     98  (let loop ((source-path source-path))
     99    (if (get-info source-path)
     100        (svn-commit source-path
     101                    (qwiki-repos-username) (qwiki-repos-password)
     102                    message)
     103        (begin
     104          (loop (pathname-directory source-path))  ; Add parent dirs if needed
     105          (svn-add source-path (qwiki-repos-username) (qwiki-repos-password))
     106          (svn-commit source-path
     107                      (qwiki-repos-username) (qwiki-repos-password)
     108                      message)))))
     109
    88110)
  • release/4/qwiki/trunk/qwiki.scm

    r15426 r15431  
    158158        (begin
    159159          (with-output-to-path source-file (lambda () (display source)))
     160          (store-changes! source-file "qwiki commit")
    160161          (redirect-to-qwiki-page req action: "show"))
    161162        (send-content content))))
Note: See TracChangeset for help on using the changeset viewer.