]> gitweb.factorcode.org Git - factor.git/commitdiff
zealot: Get a list of changed vocabs from the last run until now.
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 5 Jul 2018 01:20:20 +0000 (20:20 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 5 Jul 2018 01:20:20 +0000 (20:20 -0500)
Also add a word to get a list of vocabs that changed between any two git revs.

extra/zealot/cli-changed-vocabs/authors.txt [new file with mode: 0644]
extra/zealot/cli-changed-vocabs/cli-changed-vocabs.factor [new file with mode: 0644]
extra/zealot/factor/factor.factor

diff --git a/extra/zealot/cli-changed-vocabs/authors.txt b/extra/zealot/cli-changed-vocabs/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/extra/zealot/cli-changed-vocabs/cli-changed-vocabs.factor b/extra/zealot/cli-changed-vocabs/cli-changed-vocabs.factor
new file mode 100644 (file)
index 0000000..c14bbed
--- /dev/null
@@ -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
\ No newline at end of file
index 0fdaffcfb72bcae7a824e5f715b4005df025d1bc..a4fc2a7e1557dc5ca42682c94fcce261d8ed3508 100644 (file)
@@ -4,9 +4,9 @@ USING: accessors arrays bootstrap.image calendar cli.git
 combinators concurrency.combinators formatting fry http.client
 io io.directories io.launcher io.pathnames kernel math.parser
 memory modern.paths namespaces parser.notes prettyprint
-sequences sequences.extras system system-info threads tools.test
-tools.test.private vocabs vocabs.hierarchy
-vocabs.hierarchy.private vocabs.loader zealot ;
+sequences sequences.extras sets splitting system system-info
+threads tools.test tools.test.private vocabs vocabs.hierarchy
+vocabs.hierarchy.private vocabs.loader vocabs.metadata zealot ;
 IN: zealot.factor
 
 : 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 TESTING ROOTS" print flush drop zealot-test-commands ]
     } 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 ;
\ No newline at end of file