all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mike Mattie <codermattie@gmail.com>
To: emacs-devel@gnu.org
Subject: vc-bzr sha1sum dependency patch #2
Date: Thu, 23 Apr 2009 12:36:00 -0700	[thread overview]
Message-ID: <20090423193557.GA6117@reforged> (raw)

[-- 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 --]

             reply	other threads:[~2009-04-23 19:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 19:36 Mike Mattie [this message]
2009-04-23 21:15 ` vc-bzr sha1sum dependency patch #2 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090423193557.GA6117@reforged \
    --to=codermattie@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.