Changeset 36041 in project


Ignore:
Timestamp:
08/05/18 20:55:37 (14 months ago)
Author:
sjamaan
Message:

Initial port of svn-client to CHICKEN 5

Location:
release/5/svn-client
Files:
2 added
1 deleted
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • release/5/svn-client/trunk/svn-client.egg

    r36037 r36041  
    1 ;;; svn-client.meta -*- Hen -*-
    2 ((files "svn-client.release-info" "svn-client-base.c" "tests/run.scm" "svn-client.scm" "svn-client.setup" "svn-client.meta")
    3  (doc-from-wiki)
    4  (author "Alejandro Forero Cuervo")
     1;;; svn-client.meta -*- scheme -*-
     2((author "Alejandro Forero Cuervo")
    53 (maintainer "Peter Bex")
    6  (synopsis
    7    "A wrapper around Subversion's libsvn_client C library.")
     4 (synopsis "A wrapper around Subversion's libsvn_client C library.")
    85 (category misc)
    9  (test-depends test)
    10  (license "Public Domain"))
     6 (test-dependencies test)
     7 (license "Public Domain")
     8 (components (extension svn-client
     9                        (custom-build "build-svn-client"))))
  • release/5/svn-client/trunk/svn-client.scm

    r33980 r36041  
    2424   )
    2525
    26 (import chicken scheme foreign)
    27 (use lolevel)
     26(import scheme (chicken base) (chicken foreign) (chicken memory)
     27        (chicken gc))
    2828
    2929(foreign-declare "#include \"svn-client-base.c\"")
     
    9696  (c-pointer "svn_log_entry_t"))
    9797
     98(define-foreign-type svn-revnum-type long)
     99
    98100(define svn-log-entry-changed-paths
    99101  (foreign-lambda* apr-hash-type ((svn-log-entry-type log))
     
    150152  (foreign-lambda* unsigned-int ((svn-opt-revision-type rev))
    151153    "C_return(rev->kind);"))
    152 
    153 (define-foreign-type svn-revnum-type long)
    154154
    155155;;; svn_log_changed_path_t
  • release/5/svn-client/trunk/tests/run.scm

    r33980 r36041  
    1 (use test svn-client posix srfi-1 utils)
    2 
    3 (when (file-exists? "testrepo") ; This probably doesn't work under Windows ;)
    4   (system "rm -rf testrepo"))
    5 
    6 (when (file-exists? "testcheckout")
    7   (system "rm -rf testcheckout"))
    8 
    9 (when (file-exists? "testcheckout2")
    10   (system "rm -rf testcheckout2"))
     1(import test svn-client (chicken file) (chicken pathname)
     2        (chicken process-context) (chicken io) (chicken process)
     3        (chicken sort))
     4
     5(when (directory-exists? "testrepo")
     6  (delete-directory "testrepo" #t))
     7
     8(when (directory-exists? "testcheckout")
     9  (delete-directory "testcheckout" #t))
     10
     11(when (directory-exists? "testcheckout2")
     12  (delete-directory "testcheckout2" #t))
    1113
    1214(define repo-dir (make-pathname (current-directory) "testrepo"))
    13 (define repo-uri (conc "file://" repo-dir))
     15(define repo-uri (string-append "file://" repo-dir))
    1416(define checkout-dir (make-pathname (current-directory) "testcheckout"))
    1517(define checkout-dir2 (make-pathname (current-directory) "testcheckout2"))
     
    2022
    2123(define (svn-file f) (make-pathname checkout-dir f))
    22 (define (repo-file f) (conc "file://" (make-pathname repo-dir f)))
     24(define (repo-file f) (string-append "file://" (make-pathname repo-dir f)))
    2325(define (write-svn-file file data)
    2426  (with-output-to-file (svn-file file) (lambda () (print data))))
     
    3133
    3234(test "Make another checkout of revision 0, using a non-canonicalized uri"
    33       0 (svn-checkout (conc repo-uri "/") checkout-dir2 svn-opt-revision-head #t user pass))
     35      0 (svn-checkout (string-append repo-uri "/") checkout-dir2 svn-opt-revision-head #t user pass))
    3436
    3537(test-group "initial state"
     
    8486             (svn-client-list checkout-dir svn-opt-revision-head #t user pass)))
    8587  (test "Files are marked as such"
    86         '("foo" "testdir/bar")
    87         (filter-map (lambda (f) (and (eq? (svn-file-kind f) 'file)
    88                                      (svn-file-path f)))
    89                     (svn-client-list checkout-dir svn-opt-revision-head #t user pass)))
     88        '(#f "foo" #f "testdir/bar")
     89        (map (lambda (f) (and (eq? (svn-file-kind f) 'file)
     90                              (svn-file-path f)))
     91             (svn-client-list checkout-dir svn-opt-revision-head #t user pass)))
    9092  (test "secondary checkout still empty"
    9193        '("")
     
    209211(test-group "catenation"
    210212  (let* ((f (svn-client-cat (svn-file "testdir/bar") svn-opt-revision-unspecified user pass))
    211          (contents (read-all f)))
     213         (contents (with-input-from-file f read-string)))
    212214    (delete-file* f)
    213215    (test "Working dir" "Changed\n" contents))
    214216  (let* ((f (svn-client-cat (svn-file "testdir/bar") (make-svn-opt-revision-number 2) user pass))
    215          (contents (read-all f)))
     217         (contents (with-input-from-file f read-string)))
    216218    (delete-file* f)
    217219    (test "Historical revision" "Also just added\n" contents)))
Note: See TracChangeset for help on using the changeset viewer.