emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vc-bzr sha1sum dependency patch #2


From: Mike Mattie
Subject: vc-bzr sha1sum dependency patch #2
Date: Thu, 23 Apr 2009 12:36:00 -0700
User-agent: Mutt/1.5.16 (2007-06-09)

Here is a corrected version of the patch I sent in the message vc-bzr sha1sum 
dependency

--- emacs-2009-4-21/lisp/vc-bzr.el      2009-04-06 21:06:42.000000000 -0700
+++ vc-bzr.el   2009-04-23 12:32:51.574872930 -0700
@@ -141,7 +141,24 @@
       (apply 'process-file prog (file-relative-name file) t nil args)
       (buffer-substring (point-min) (+ (point-min) 40)))))
 
+(defvar vc-bzr-optimized-status (executable-find "sha1sum")
+  "enable the bzr status optimization only if the sha1sum program exists")
+
 (defun vc-bzr-state-heuristic (file)
+  "a wrapper for two methods of determining the bzr status of a file."
+  (condition-case trap-status
+    (funcall (if vc-bzr-optimized-status
+               'vc-bzr-state-fast
+               'vc-bzr-state) file)
+    (error
+      (if vc-bzr-optimized-status
+        (progn
+          (setq vc-bzr-optimized-status nil)
+          (message "vc-bzr: error %s determining status of %s ; retrying with 
optimization disabled." (princ trap-status) file)
+          (vc-bzr-state file))
+        (message "vc-bzr-registered could not determine status of %s even with 
optimization disabled." file))) ))
+
+(defun vc-bzr-state-fast (file)
   "Like `vc-bzr-state' but hopefully without running Bzr."
   ;; `bzr status' is excrutiatingly slow with large histories and
   ;; pending merges, so try to avoid using it until they fix their


-- 
GnuPG Key: B9012279 is available from HKP server pgp.mit.edu

Attachment: pgpJG2s2roLxI.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]