changeset 73444:ee7eeb5732b2

(vc-svn-parse-status): Remove unused arg `localp'. Add arg `filename' instead. Don't set vc-backend if `filename' is set. Return `filename's status if applicable. Update callers.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 20 Oct 2006 07:56:20 +0000
parents 993286e581a6
children 59e895845146
files lisp/ChangeLog lisp/vc-svn.el
diffstat 2 files changed, 21 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Oct 20 06:43:56 2006 +0000
+++ b/lisp/ChangeLog	Fri Oct 20 07:56:20 2006 +0000
@@ -1,3 +1,9 @@
+2006-10-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc-svn.el (vc-svn-parse-status): Remove unused arg `localp'.
+	Add arg `filename' instead.  Don't set vc-backend if `filename' is set.
+	Return `filename's status if applicable.  Update callers.
+
 2006-10-19  Kenichi Handa  <handa@m17n.org>
 
 	* international/kkc.el (kkc-region): When a key sequence is not
@@ -62,8 +68,8 @@
 
 2006-10-18  Martin Rudalics  <rudalics@gmx.at>
 
-	* textmodes/flyspell.el (flyspell-word-search-backward): Set
-	inhibit-point-motion-hooks to avoid looping due to intangibile
+	* textmodes/flyspell.el (flyspell-word-search-backward):
+	Set inhibit-point-motion-hooks to avoid looping due to intangibile
 	text.
 
 2006-10-16  Richard Stallman  <rms@gnu.org>
@@ -324,7 +330,7 @@
 
 	After 5.10:
 
-	This code may lock Emacs hard!!!  Use on your own risk!
+	This code may lock Emacs hard!!!  Use at your own risk!
 
 	(cperl-font-locking): New internal variable.
 	(cperl-beginning-of-property): New function.
@@ -338,7 +344,7 @@
 			recursively.
 		Bound `next-single-property-change' via `point-max'.
 	(cperl-unwind-to-safe): Bound likewise
-	(cperl-font-lock-fontify-region-function): Likewise
+	(cperl-font-lock-fontify-region-function): Likewise.
 	(cperl-find-pods-heres): Mark as recursive for `cperl-to-comment-or-eol'
 		Initialization of `cperl-font-lock-multiline-start' could be
 		missed if the "main" fontification did not run due to the
--- a/lisp/vc-svn.el	Fri Oct 20 06:43:56 2006 +0000
+++ b/lisp/vc-svn.el	Fri Oct 20 07:56:20 2006 +0000
@@ -125,8 +125,7 @@
                ;; an `error' by vc-do-command.
                (error nil))))
         (when (eq 0 status)
-          (vc-svn-parse-status t)
-          (eq 'SVN (vc-file-getprop file 'vc-backend)))))))
+          (vc-svn-parse-status file))))))
 
 (defun vc-svn-state (file &optional localp)
   "SVN-specific version of `vc-state'."
@@ -134,8 +133,7 @@
   (with-temp-buffer
     (cd (file-name-directory file))
     (vc-svn-command t 0 file "status" (if localp "-v" "-u"))
-    (vc-svn-parse-status localp)
-    (vc-file-getprop file 'vc-state)))
+    (vc-svn-parse-status file)))
 
 (defun vc-svn-state-heuristic (file)
   "SVN-specific state heuristic."
@@ -149,7 +147,7 @@
     ;; enough.  Otherwise it might fail with remote repositories.
     (with-temp-buffer
       (vc-svn-command t 0 nil "status" (if localp "-v" "-u"))
-      (vc-svn-parse-status localp))))
+      (vc-svn-parse-status))))
 
 (defun vc-svn-workfile-version (file)
   "SVN-specific version of `vc-workfile-version'."
@@ -488,10 +486,10 @@
       ;; behavior for different modules on the same server.
       (match-string 1))))
 
-(defun vc-svn-parse-status (localp)
+(defun vc-svn-parse-status (&optional filename)
   "Parse output of \"svn status\" command in the current buffer.
-Set file properties accordingly.  Unless FULL is t, parse only
-essential information."
+Set file properties accordingly.  Unless FILENAME is non-nil, parse only
+information about FILENAME and return its status."
   (let (file status)
     (goto-char (point-min))
     (while (re-search-forward
@@ -500,7 +498,9 @@
 		  (buffer-substring (point) (line-end-position))))
       (setq status (char-after (line-beginning-position)))
       (unless (eq status ??)
-	(vc-file-setprop file 'vc-backend 'SVN)
+	;; `vc-BACKEND-registered' must not set vc-backend,
+	;; which is instead set in vc-registered.
+	(unless filename (vc-file-setprop file 'vc-backend 'SVN))
 	;; Use the last-modified revision, so that searching in vc-print-log
 	;; output works.
 	(vc-file-setprop file 'vc-workfile-version (match-string 3))
@@ -522,7 +522,8 @@
 	   (if (eq (char-after (match-beginning 1)) ?*)
 	       'needs-merge
 	     'edited))
-	  (t 'edited)))))))
+	  (t 'edited)))))
+    (if filename (vc-file-getprop filename 'vc-state))))
 
 (defun vc-svn-dir-state-heuristic (dir)
   "Find the SVN state of all files in DIR, using only local information."