]> code.delx.au - gnu-emacs/blobdiff - lisp/vc-svn.el
(pop-up-frame-function): Remove choice nil since it
[gnu-emacs] / lisp / vc-svn.el
index cfbc8496433951eed885ea594366545698664831..6eeb8985bfd125c094ad34a82baa9d5b19a511fe 100644 (file)
@@ -164,7 +164,7 @@ want to force an empty list of arguments, use t."
                      (?? . unregistered)
                      ;; This is what vc-svn-parse-status does.
                      (?~ . edited)))
-       (re (if remote "^\\(.\\)..... \\([ *]\\) +[-0-9]+ +\\(.*\\)$"
+       (re (if remote "^\\(.\\)..... \\([ *]\\) +\\(?:[-0-9]+\\)?   \\(.*\\)$"
              ;; Subexp 2 is a dummy in this case, so the numbers match.
              "^\\(.\\)....\\(.\\) \\(.*\\)$"))
        result)
@@ -176,7 +176,7 @@ want to force an empty list of arguments, use t."
             ;; FIXME are there other possible combinations?
             (cond ((eq state 'edited) (setq state 'needs-merge))
                   ((not state) (setq state 'needs-update))))
-       (when state
+       (when (and state (not (string= "." filename)))
          (setq result (cons (list filename state) result)))))
     (funcall callback result)))
 
@@ -185,8 +185,12 @@ want to force an empty list of arguments, use t."
 CALLBACK is called as (CALLBACK RESULT BUFFER), where
 RESULT is a list of conses (FILE . STATE) for directory DIR."
   ;; FIXME should this rather be all the files in dir?
-  (let* ((local (vc-stay-local-p dir))
-        (remote (or (not local) (eq local 'only-file))))
+  ;; FIXME: the vc-stay-local-p logic below is disabled, it ends up
+  ;; calling synchronously (vc-svn-registered DIR) => calling svn status -v DIR
+  ;; which is VERY SLOW for big trees and it makes emacs
+  ;; completely unresponsive during that time.
+  (let* ((local (and nil (vc-stay-local-p dir)))
+        (remote (or t (not local) (eq local 'only-file))))
     (vc-svn-command (current-buffer) 'async nil "status"
                    (if remote "-u"))
   (vc-exec-after
@@ -479,6 +483,19 @@ or svn+ssh://."
 
 (defun vc-svn-diff (files &optional oldvers newvers buffer)
   "Get a difference report using SVN between two revisions of fileset FILES."
+  (and oldvers
+       (not newvers)
+       files
+       (catch 'no
+        (dolist (f files)
+          (or (equal oldvers (vc-working-revision f))
+              (throw 'no nil)))
+        t)
+       ;; Use nil rather than the current revision because svn handles
+       ;; it better (i.e. locally).  Note that if _any_ of the files
+       ;; has a different revision, we fetch the lot, which is
+       ;; obviously sub-optimal.
+       (setq oldvers nil))
   (let* ((switches
            (if vc-svn-diff-switches
                (vc-switches 'SVN 'diff)