comparison lisp/vc-bzr.el @ 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 a5186dc625d4
children 92dd41bc6130
comparison
equal deleted inserted replaced
81445:4d58251a76e1 81446:774e9d2142bd
461 ;; FIXME: `bzr root' will return the real path to the repository root, 461 ;; FIXME: `bzr root' will return the real path to the repository root,
462 ;; that is, it can differ from the buffer's current directory name 462 ;; that is, it can differ from the buffer's current directory name
463 ;; if there are any symbolic links. 463 ;; if there are any symbolic links.
464 (defun vc-bzr-root (dir) 464 (defun vc-bzr-root (dir)
465 "Return the root directory of the bzr repository containing DIR." 465 "Return the root directory of the bzr repository containing DIR."
466 (substring 466 ;; Cache technique copied from vc-arch.el.
467 (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1)) 467 (or (vc-file-getprop dir 'bzr-root)
468 (vc-file-setprop
469 dir 'bzr-root
470 (substring
471 (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1))))
468 472
469 ;; TODO: it would be nice to mark the conflicted files in VC Dired, 473 ;; TODO: it would be nice to mark the conflicted files in VC Dired,
470 ;; and implement a command to run ediff and `bzr resolve' once the 474 ;; and implement a command to run ediff and `bzr resolve' once the
471 ;; changes have been merged. 475 ;; changes have been merged.
472 (defun vc-bzr-dir-state (dir &optional localp) 476 (defun vc-bzr-dir-state (dir &optional localp)