 
 ;; NEED NEW COMMENT HERE
 
-(defn svndiff [r1 r2 filename object]
+(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)]
-    (sh "svn" "diff" (first v) (second v))))
+        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.
 

;; vector of the names of files where the filter term appears on a changed line.
;; If no filter term is given, a changed file automatically matches.

(defn matching-files [r1 r2 object filt]
  (let [blocks (rest (split (:out (diff r1 r2 object)) #"^Index: |\nIndex: "))]
    (remove nil?
            (into []
                  (for [block blocks]

  [["-h" "--help" "Show usage information"]
   ["-i" "--case-insensitive" "Treat regexp as case-insensitive"]
   ["-d" "--diff-opts options" "Quoted list of options to pass to svn diff"]
   ["-l" "--log-opts options" "Quoted list of options to pass to svn log"]
   ["-s" "--show-cmds" "Show the svn commands taht are issued"]])

;; A string containing the output of "diff" on the two svn revision of object.

(defn diff [r1 r2 object show]
  (let [object (baseobject object)
        v (vpaths r1 r2 object object)
        o1 (first v)
        o2 (second v)
        cmd-components ["svn" "diff" "--diff-cmd" "diff" "-x" "-u0" shhh o1 o2]]
    (if show (show-cmd cmd-components))
    (apply sh cmd-components)))

;; Given a list of revision pairs, diff those for which the given filter term
;; (if any) is present on a changed line in that pair. If no filter term is
;; given, diff all changed files from all revision pairs.

(defn diffrevpairs [object filt revpairs show]
  (when (seq revpairs)
    (let [r1 (first revpairs)
          r2 (first (rest revpairs))
          mf (matching-files r1 r2 object filt show)]
      (println (str "Checking: r" r1 " vs r" r2))
      (doseq [filename mf] (svndiff r1 r2 filename object show))
      (diffrevpairs object filt (rest (rest revpairs)) show))))

;; Try to explain why this has failed.

