 ;; Return a string containing the xml-formatted svn log for the requested
 ;; object.
 
-(defn log [opts object]
-  (print "Fetching log... ")
-  (flush)
-  (let [log (:out (sh "svn" "log" opts shhh "--xml" object))]
-    (println)
-    log))
+(defn log [opts show object]
+  (let [cmd-components (if opts ["svn" "log" shhh "--xml" opts object]
+                                ["svn" "log" shhh "--xml"      object])]
+    (if show (show-cmd cmd-components))
+    (print "Fetching log... ")
+    (flush)
+    (let [result (:out (apply sh cmd-components))]
+      (println)
+      result)))
 
 ;; Obtain a diff from svn for the given object between the specified revisions.
 ;; Break each diff into blocks (delineated by the text "Index: "), where each

        object (first arguments)
        filt (or (second arguments) ".*")
        optsd (:diff-opts options)
        optsl (:log-opts options)]
    (if (:help options) (usage summary 0))
    (if (not object)
      (usage summary 1)
      (let [revpairs (get-revpairs (get-revlist optsl object) object)]
        (diffrevpairs object filt revpairs)
        (shutdown-agents)))))


;; NEED NEW COMMENT HERE

(defn svndiff [r1 r2 filename object show]
  (let [object (baseobject object)
        r (re-pattern (str "^.*/" filename "$"))
        p (if (uri? object)
            (if (re-matches r object) object (str object "/" filename))
            filename)
        v (vpaths r1 r2 p object)
        cmd-components ["svn" "diff" (first v) (second v)]]
    (if show (show-cmd cmd-components))
    (apply sh cmd-components)))

;; Is path a uri? If it contains :// assume it is.

