- Timestamp:
- 08/13/09 17:58:14 (12 years ago)
- Location:
- release/4/qwiki/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
release/4/qwiki/trunk/qwiki-svn.scm
r15431 r15437 87 87 (qwiki-repos-username) (qwiki-repos-password))) 88 88 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))))) 89 (define (store-changes! source-path message username password) 90 (let* ((user (or username (qwiki-repos-username))) 91 (pass (or password (qwiki-repos-password))) 92 (get-info 93 (lambda (path) 94 (let ((info '())) 95 (svn-client-info path 96 svn-opt-revision-unspecified 97 svn-opt-revision-unspecified 98 (lambda (path i) (set! info (cons i info))) 99 #f user pass) 100 (and (not (null? info)) (car info)))))) 101 (let loop ((source-path source-path)) 102 (if (get-info source-path) 103 (svn-commit source-path user pass message) 104 (begin 105 (loop (pathname-directory source-path)) ; Add parent dirs if needed 106 (svn-add source-path user pass) 107 (svn-commit source-path user pass message)))))) 109 108 110 109 ) -
release/4/qwiki/trunk/qwiki.scm
r15432 r15437 136 136 (with-input-from-file source-file read-string)) 137 137 "")) 138 (comment (alist-ref 'comment postdata eq? "")) 139 (username (alist-ref 'username postdata eq? "")) 140 (password (alist-ref 'password postdata eq? "")) 141 (auth (alist-ref 'auth postdata eq?)) 138 142 ;; TODO: Clean this up, maybe put it in a transformation rule so 139 143 ;; it can be extended by plugins. The names of the buttons are … … 146 150 ,(wiki-parse source)) 147 151 "") 152 (p "username: " ,username " password: " ,password " auth: " ,auth) 148 153 (form (@ (method "post")) 149 (textarea (@ (name "source")) 150 ,source) 154 (label "Article contents:" 155 (textarea (@ (name "source")) 156 ,source)) 157 (label "Description of your changes:" 158 (textarea (@ (name "comment")) 159 ,comment)) 160 (label "I would like to authenticate" 161 (input (@ (type "checkbox") 162 (name "auth") 163 ,@(if auth 164 '((checked "checked")) 165 '())))) 166 (label "Username:" 167 (input (@ (type "text") 168 (name "username") 169 (value ,username)))) 170 (label "Password:" 171 (input (@ (type "password") 172 (name "password") 173 (value ,password)))) 151 174 (input (@ (type "submit") 152 175 (name "save") … … 158 181 (begin 159 182 (with-output-to-path source-file (lambda () (display source))) 160 (store-changes! source-file "qwiki commit") 183 (store-changes! source-file comment 184 (and auth username) (and auth password)) 161 185 (redirect-to-qwiki-page req action: "show")) 162 186 (send-content content))))
Note: See TracChangeset
for help on using the changeset viewer.