From: Glenn Morris Date: Sun, 4 Nov 2012 04:13:13 +0000 (-0700) Subject: * lisp/vc/vc-svn.el (vc-svn-state-heuristic): Avoid calling svn. X-Git-Tag: emacs-24.3.90~173^2~9^2~165 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9749e2b071a93101b1f3199fcc8634b9cf99a088;p=emacs.git * lisp/vc/vc-svn.el (vc-svn-state-heuristic): Avoid calling svn. Fixes: debbugs:7850 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ce4919afa2b..09f3a586b4f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-11-04 Glenn Morris + + * vc/vc-svn.el (vc-svn-state-heuristic): Avoid calling svn. (Bug#7850) + 2012-11-04 Chong Yidong * bookmark.el (bookmark-bmenu-switch-other-window): Avoid binding diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 6c2367c7ba6..3becd8950f1 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -155,9 +155,24 @@ If you want to force an empty list of arguments, use t." (vc-svn-command t 0 file "status" (if localp "-v" "-u")) (vc-svn-parse-status file)))) +;; NB this does not handle svn properties, which can be changed +;; without changing the file timestamp. +;; Note that unlike vc-cvs-state-heuristic, this is not called from +;; vc-svn-state. AFAICS, it is only called from vc-state-refresh via +;; vc-after-save (bug#7850). Therefore the fact that it ignores +;; properties is irrelevant. If you want to make vc-svn-state call +;; this, it should be extended to handle svn properties. (defun vc-svn-state-heuristic (file) "SVN-specific state heuristic." - (vc-svn-state file 'local)) + ;; If the file has not changed since checkout, consider it `up-to-date'. + ;; Otherwise consider it `edited'. Copied from vc-cvs-state-heuristic. + (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) + (lastmod (nth 5 (file-attributes file)))) + (cond + ((equal checkout-time lastmod) 'up-to-date) + ((string= (vc-working-revision file) "0") 'added) + ((null checkout-time) 'unregistered) + (t 'edited)))) ;; FIXME it would be better not to have the "remote" argument, ;; but to distinguish the two output formats based on content.