changeset 81446:774e9d2142bd

* vc-bzr.el (vc-bzr-root): Cache the output of shell command execution.
author Masatake YAMATO <jet@gyve.org>
date Fri, 15 Jun 2007 19:40:47 +0000
parents 4d58251a76e1
children 697178a8197c
files lisp/ChangeLog lisp/vc-bzr.el
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jun 15 18:50:19 2007 +0000
+++ b/lisp/ChangeLog	Fri Jun 15 19:40:47 2007 +0000
@@ -1,6 +1,9 @@
 2007-06-15  Masatake YAMATO  <jet@gyve.org>
 
-	* vc.el (vc-dired-hook): check the backend returned from 
+	* vc-bzr.el (vc-bzr-root): Cache the output of shell command
+	execution.
+
+	* vc.el (vc-dired-hook): Check the backend returned from 
 	`vc-responsible-backend' can really handle `subdir'.
 
 2007-06-15  Chong Yidong  <cyd@stupidchicken.com>
--- a/lisp/vc-bzr.el	Fri Jun 15 18:50:19 2007 +0000
+++ b/lisp/vc-bzr.el	Fri Jun 15 19:40:47 2007 +0000
@@ -463,8 +463,12 @@
 ;; if there are any symbolic links.
 (defun vc-bzr-root (dir)
   "Return the root directory of the bzr repository containing DIR."
-  (substring 
-   (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1))
+  ;; Cache technique copied from vc-arch.el.
+  (or (vc-file-getprop dir 'bzr-root)
+      (vc-file-setprop
+       dir 'bzr-root
+       (substring 
+	(shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1))))
 
 ;; TODO: it would be nice to mark the conflicted files in  VC Dired,
 ;; and implement a command to run ediff and `bzr resolve' once the