zealot: Get a list of changed vocabs from the last run until now.

Also add a word to get a list of vocabs that changed between any two git revs.
elevate-erg
Doug Coleman 2018-07-04 20:20:20 -05:00
parent d35df269d8
commit 96f2470e5d
3 changed files with 38 additions and 3 deletions

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1,8 @@
! Copyright (C) 2018 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: io sequences zealot.factor ;
IN: zealot.cli-changed-vocabs
: zealot-changed-vocabs ( -- ) ci-vocabs-to-test [ print ] each ;
MAIN: zealot-changed-vocabs

View File

@ -4,9 +4,9 @@ USING: accessors arrays bootstrap.image calendar cli.git
combinators concurrency.combinators formatting fry http.client combinators concurrency.combinators formatting fry http.client
io io.directories io.launcher io.pathnames kernel math.parser io io.directories io.launcher io.pathnames kernel math.parser
memory modern.paths namespaces parser.notes prettyprint memory modern.paths namespaces parser.notes prettyprint
sequences sequences.extras system system-info threads tools.test sequences sequences.extras sets splitting system system-info
tools.test.private vocabs vocabs.hierarchy threads tools.test tools.test.private vocabs vocabs.hierarchy
vocabs.hierarchy.private vocabs.loader zealot ; vocabs.hierarchy.private vocabs.loader vocabs.metadata zealot ;
IN: zealot.factor IN: zealot.factor
: download-boot-checksums ( path branch -- ) : download-boot-checksums ( path branch -- )
@ -168,3 +168,29 @@ M: windows factor-path "./factor.com" ;
[ "ZEALOT LOADING ROOTS" print flush drop zealot-load-commands ] [ "ZEALOT LOADING ROOTS" print flush drop zealot-load-commands ]
[ "ZEALOT TESTING ROOTS" print flush drop zealot-test-commands ] [ "ZEALOT TESTING ROOTS" print flush drop zealot-test-commands ]
} 2cleave ; } 2cleave ;
: vocab-path>vocab ( path -- vocab )
[ parent-directory ] map
[ "/" split1 nip ] map
[ path-separator split harvest "." join ] map ;
: changed-factor-vocabs ( old-rev new-rev -- vocabs )
[
default-vocab-roots
[ ":" split1 nip ] map
[ "/" append ] map
] 2dip git-diff-name-only*
[ ".factor" tail? ] filter
[ swap [ head? ] with any? ] with filter
[ parent-directory ] map
[ "/" split1 nip ] map
[ path-separator split harvest "." join ] map members ;
: changed-factor-vocabs-from-master ( -- vocabs )
"master" "origin/master" changed-factor-vocabs ;
: reject-unloadable-vocabs ( vocabs -- vocabs' )
[ don't-load? ] reject ;
: ci-vocabs-to-test ( -- vocabs )
changed-factor-vocabs-from-master reject-unloadable-vocabs ;