diff lisp/vc.el @ 86248:cde7fc4f5945

(vc-find-revision): Set the parent buffer. Use when instead of if.
author Dan Nicolaescu <dann@ics.uci.edu>
date Tue, 20 Nov 2007 08:15:00 +0000
parents ac69f23a84ce
children 36ff364fc708
line wrap: on
line diff
--- a/lisp/vc.el	Tue Nov 20 07:56:02 2007 +0000
+++ b/lisp/vc.el	Tue Nov 20 08:15:00 2007 +0000
@@ -2069,11 +2069,16 @@
 		      (with-current-buffer filebuf
 			(vc-call find-revision file revision outbuf))))
 		  (setq failed nil))
-	      (if (and failed (file-exists-p filename))
-		  (delete-file filename))))
+	      (when (and failed (file-exists-p filename))
+		(delete-file filename))))
 	  (vc-mode-line file))
 	(message "Checking out %s...done" filename)))
-    (find-file-noselect filename)))
+    (let ((result-buf (find-file-noselect filename)))
+      (with-current-buffer result-buf
+	;; Set the parent buffer so that things like 
+	;; C-x v g, C-x v l, ... etc work.
+	(setq vc-parent-buffer filebuf))
+      result-buf)))
 
 ;; Header-insertion code