changeset 67547:76b136e1750a

(vc-svn-registered): Fix problem of visiting non-writable Subversion-controlled files by saving window configuration before calling vc-do-command. vc-do-command calls pop-to-buffer on error which is unexpected during registration.
author Bill Wohler <wohler@newt.com>
date Tue, 13 Dec 2005 00:48:04 +0000
parents 30cce788b053
children 3ce7783b56bc
files lisp/ChangeLog lisp/vc-svn.el
diffstat 2 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Dec 12 20:27:13 2005 +0000
+++ b/lisp/ChangeLog	Tue Dec 13 00:48:04 2005 +0000
@@ -1,8 +1,14 @@
+2005-12-12  Bill Wohler  <wohler@newt.com>
+
+	* vc-svn.el (vc-svn-registered): Fix problem of visiting
+	non-writable Subversion-controlled files by saving window
+	configuration before calling vc-do-command. vc-do-command calls
+	pop-to-buffer on error which is unexpected during registration.
+
 2005-12-12  Jay Belanger  <belanger@truman.edu>
 
 	* calc/README: Update the summary of changes.
 
-
 2005-12-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* descr-text.el (describe-char): Rework last fix to solve the problem
--- a/lisp/vc-svn.el	Mon Dec 12 20:27:13 2005 +0000
+++ b/lisp/vc-svn.el	Tue Dec 13 00:48:04 2005 +0000
@@ -114,13 +114,18 @@
 					   (file-name-directory file)))
     (with-temp-buffer
       (cd (file-name-directory file))
-      (condition-case nil
-	  (vc-svn-command t 0 file "status" "-v")
-	;; Some problem happened.  E.g. We can't find an `svn' executable.
-        ;; We used to only catch `file-error' but when the process is run on
-        ;; a remote host via Tramp, the error is only reported via the
-        ;; exit status which is turned into an `error' by vc-do-command.
-	(error nil))
+        (condition-case nil
+            ;; Save configuration since vc-do-command calls pop-to-buffer on
+            ;; error (such as visiting a Subversion-controlled file that you
+            ;; don't have permission to edit). This causes later problems
+            ;; during registration.
+            (save-window-excursion
+              (vc-svn-command t 0 file "status" "-v"))
+          ;; Some problem happened.  E.g. We can't find an `svn' executable.
+          ;; We used to only catch `file-error' but when the process is run on
+          ;; a remote host via Tramp, the error is only reported via the
+          ;; exit status which is turned into an `error' by vc-do-command.
+          (error nil))
       (vc-svn-parse-status t)
       (eq 'SVN (vc-file-getprop file 'vc-backend)))))