Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add-r-commits now adds nil relation to unreadable project.clj's

Without this the missing relation was interpreted as unread project.clj,
triggering re-reading and flagging the db as dirty. It would also likely cause
problems for our core.logic queries.
  • Loading branch information...
commit a138cfd5eac1e8ae7f69b9c4bbdedfcd37e2352c 1 parent e6857d4
Chris Houser Chouser authored
Showing with 16 additions and 18 deletions.
  1. +16 −18 src/leiningen/voom.clj
34 src/leiningen/voom.clj
View
@@ -938,12 +938,6 @@
%) (reverse vnums))]
[vmajor vminor vinc vqual]))
-(defn reduce-db
- [db coll f]
- (if (empty? coll)
- db
- (reduce f (vary-meta db assoc ::dirty true) coll)))
-
(defn add-r-commits
[db gitdir]
(let [old-branches (into {} (vdb/get-facts db r-branch))
@@ -1011,18 +1005,22 @@
(l/run* [blob-sha]
(l/fresh [proj-dir-sha]
(r-tree proj-dir-sha "project.clj" :blob blob-sha))))
- read-blobs (vdb/get-column db r-proj 0)]
- (reduce-db
- db (apply disj (set proj-blobs) read-blobs)
- (fn [db blob-sha]
- (if-let [proj (robust-read-proj-blob gitdir blob-sha)]
- (let [proj-name (symbol (:group proj) (:name proj))
- has-snaps? (some #(.contains ^String % "-SNAPSHOT")
- (map second (:dependencies proj)))
- [vmajor vminor vinc vqual] (sem-ver-parse (:version proj))]
- (pldb/db-fact db r-proj blob-sha proj-name
- vmajor vminor vinc vqual has-snaps?))
- db)))))
+ read-blobs (vdb/get-column db r-proj 0)
+ blobs-to-read (apply disj (set proj-blobs) read-blobs)]
+ (if (empty? blobs-to-read)
+ db
+ (reduce
+ (fn [db blob-sha]
+ (if-let [proj (robust-read-proj-blob gitdir blob-sha)]
+ (let [proj-name (symbol (:group proj) (:name proj))
+ has-snaps? (some #(.contains ^String % "-SNAPSHOT")
+ (map second (:dependencies proj)))
+ [vmajor vminor vinc vqual] (sem-ver-parse (:version proj))]
+ (pldb/db-fact db r-proj blob-sha proj-name
+ vmajor vminor vinc vqual has-snaps?))
+ (pldb/db-fact db r-proj blob-sha nil nil nil nil nil nil)))
+ (vary-meta db assoc ::dirty true)
+ blobs-to-read))))
(defn update-git-db
[db gitdir]
Please sign in to comment.
Something went wrong with that request. Please try again.