From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: vc-bzr sha1sum dependency Date: Tue, 21 Apr 2009 21:24:18 +0100 Organization: University of Cambridge Message-ID: References: <20090421172603.GB6265@reforged> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240345659 22220 80.91.229.12 (21 Apr 2009 20:27:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Apr 2009 20:27:39 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 21 22:28:58 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LwMaJ-000847-75 for ged-emacs-devel@m.gmane.org; Tue, 21 Apr 2009 22:28:51 +0200 Original-Received: from localhost ([127.0.0.1]:36054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwMYu-0006dc-5P for ged-emacs-devel@m.gmane.org; Tue, 21 Apr 2009 16:27:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwMWE-0004wd-Iw for emacs-devel@gnu.org; Tue, 21 Apr 2009 16:24:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwMWA-0004rz-4p for emacs-devel@gnu.org; Tue, 21 Apr 2009 16:24:38 -0400 Original-Received: from [199.232.76.173] (port=56662 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwMW9-0004rr-SL for emacs-devel@gnu.org; Tue, 21 Apr 2009 16:24:33 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:51183 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwMW9-0006Cj-7d for emacs-devel@gnu.org; Tue, 21 Apr 2009 16:24:33 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LwMW6-0000bA-Dm for emacs-devel@gnu.org; Tue, 21 Apr 2009 20:24:30 +0000 Original-Received: from smaug.linux.pwf.cam.ac.uk ([193.60.95.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Apr 2009 20:24:30 +0000 Original-Received: from sdl.web by smaug.linux.pwf.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Apr 2009 20:24:30 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: smaug.linux.pwf.cam.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:bfP4dsZsoCh2ZvHd4uWr3rwGImM= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:110402 Archived-At: On 2009-04-21 18:26 +0100, Mike Mattie wrote: > I was recently bit by the fact that vc-bzr uses sha1sum, and external program > to compute the state of a file in vc-bzr-state-heuristic. > > This depedency is suprising and buried rather deep. I looked at the code in question > and discovered that vc-bzr is picking apart an internal bzr file to find the state > of a file, bypassing the now expensive call to bzr status. I used to use the following code but I no longer use bzr or windows. ;;; re-define vc-bzr-sha1 to work in windows (require 'vc-bzr) (defun vc-bzr-sha1 (file) (let ((sha1-use-external nil)) (with-temp-buffer (set-buffer-multibyte nil) (insert-file-contents file) (sha1-region (point-min) (point-max))))) Best wishes, -- .: Leo :. [ sdl.web AT gmail.com ] .: I use Emacs :. www.git-scm.com git - the one true version control system