   [tmpfile]
   (tmpd/time tmpfile))
 
-(defn fileset-diff
-  "Returns a new fileset containing files that were added or modified. Removed
-  files are not considered. The optional props arguments can be any of :time,
-  :hash, or both, specifying whether to consider changes to last modified time
-  or content md5 hash of the files (the default is both)."
-  [before after & props]
-  (apply tmpd/diff before after props))
-
-(defn fileset-added
-  "Returns a new fileset containing only files that were added."
-  [before after & props]
-  (apply tmpd/added before after props))
-
-(defn fileset-removed
-  "Returns a new fileset containing only files that were removed."
-  [before after & props]
-  (apply tmpd/removed before after props))
-
-(defn fileset-changed
-  "Returns a new fileset containing only files that were changed."
-  [before after & props]
-  (apply tmpd/changed before after props))
-
 ;; TmpFileSet API
+
+(defn tmpget
+  "Given a fileset and a path, returns the associated TmpFile record. If the
+  not-found argument is specified and the TmpFile is not in the fileset then
+  not-found is returned, otherwise nil."
+  [fileset path & [not-found]]
+  (get-in fileset [:tree path] not-found))
 
 (defn user-dirs
   "Get a list of directories containing files that originated in the project's

         result#))))

(defmacro fileset-reduce
  [fileset get-files & reducers]
  (if-not (seq reducers)
    fileset
    (let [each-reducer (fn [r]
                         [`((juxt identity ~get-files))
                          `(apply reduce ~r)])]
      `(->> ~fileset ~@(mapcat each-reducer reducers)))))

;; Task Configuration Macros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defmacro with-post-wrap
  [bind & body]
  "Given a binding and body expressions, constructs a task handler. The next
  handler is called with the current fileset, and the result is bound to
  binding. The body expressions are then evaluated for side effects and the
  bound fileset is returned up the handler stack. Roughly equivalent to:
  
      (fn [next-handler]
        (fn [fileset]
          (let [binding (next-handler fileset)]
            (do ... ...)
            binding)))
  
  where ... are the given body expressions."
  `(fn [next-task#]
     (fn [fileset#]
       (assert (tmpd/tmpfileset? fileset#)
