all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* vc-bzr sha1sum dependency patch #2
@ 2009-04-23 19:36 Mike Mattie
  2009-04-23 21:15 ` Chong Yidong
  2009-05-07  3:20 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Mike Mattie @ 2009-04-23 19:36 UTC (permalink / raw
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]

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 #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-05-17  3:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-23 19:36 vc-bzr sha1sum dependency patch #2 Mike Mattie
2009-04-23 21:15 ` Chong Yidong
2009-04-23 21:42   ` Stefan Monnier
2009-05-07  3:20 ` Stefan Monnier
2009-05-14  5:25   ` Mike Mattie
2009-05-17  3:39     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.