aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-04-10 21:16:48 -0400
committerGlenn Morris2012-04-10 21:16:48 -0400
commita38c310cdd714d14c6125ddbdd89bb5bb671dd0d (patch)
tree9a6ad38f75d2dc8831635fb5a292c0179a1baf44
parent453b951e7d7485a01551440d2a163f22b7812fea (diff)
downloademacs-a38c310cdd714d14c6125ddbdd89bb5bb671dd0d.tar.gz
emacs-a38c310cdd714d14c6125ddbdd89bb5bb671dd0d.zip
Use internal sha1 in vc-bzr
* lisp/vc/vc-bzr.el (vc-bzr-sha1-program, sha1-program): Remove. These were only added in 24.1 when sha1.el was removed in favor of an internal sha1 implementation. Frankly, I can't see why the internal sha1 wasn't immediately used here. (vc-bzr-sha1): Use internal sha1. (Comments): Remove reference to abandoned upstream bug report that contains no extra information.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/vc/vc-bzr.el31
2 files changed, 12 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3210bf08604..fb90f095d7c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-04-11 Glenn Morris <rgm@gnu.org>
2
3 * vc/vc-bzr.el (vc-bzr-sha1-program, sha1-program): Remove.
4 (vc-bzr-sha1): Use internal sha1.
5
12012-04-11 Stefan Monnier <monnier@iro.umontreal.ca> 62012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * progmodes/flymake.el (flymake-mode): Beware read-only dirs (bug#8954). 8 * progmodes/flymake.el (flymake-mode): Beware read-only dirs (bug#8954).
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 798131236d5..2058c9f64ee 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -37,7 +37,6 @@
37;; are bzr-versioned, `vc-bzr` presently runs `bzr status` on the 37;; are bzr-versioned, `vc-bzr` presently runs `bzr status` on the
38;; symlink, thereby not detecting whether the actual contents 38;; symlink, thereby not detecting whether the actual contents
39;; (that is, the target contents) are changed. 39;; (that is, the target contents) are changed.
40;; See https://bugs.launchpad.net/vc-bzr/+bug/116607
41 40
42;;; Properties of the backend 41;;; Properties of the backend
43 42
@@ -65,14 +64,6 @@
65 :group 'vc-bzr 64 :group 'vc-bzr
66 :type 'string) 65 :type 'string)
67 66
68(defcustom vc-bzr-sha1-program '("sha1sum")
69 "Name of program to compute SHA1.
70It must be a string \(program name\) or list of strings \(name and its args\)."
71 :type '(repeat string)
72 :group 'vc-bzr)
73
74(define-obsolete-variable-alias 'sha1-program 'vc-bzr-sha1-program "24.1")
75
76(defcustom vc-bzr-diff-switches nil 67(defcustom vc-bzr-diff-switches nil
77 "String or list of strings specifying switches for bzr diff under VC. 68 "String or list of strings specifying switches for bzr diff under VC.
78If nil, use the value of `vc-diff-switches'. If t, use no switches." 69If nil, use the value of `vc-diff-switches'. If t, use no switches."
@@ -190,20 +181,15 @@ in the repository root directory of FILE."
190(defun vc-bzr-sha1 (file) 181(defun vc-bzr-sha1 (file)
191 (with-temp-buffer 182 (with-temp-buffer
192 (set-buffer-multibyte nil) 183 (set-buffer-multibyte nil)
193 (let ((prog vc-bzr-sha1-program) 184 (insert-file-contents-literally file)
194 (args nil) 185 (sha1 (current-buffer))))
195 process-file-side-effects)
196 (when (consp prog)
197 (setq args (cdr prog))
198 (setq prog (car prog)))
199 (apply 'process-file prog (file-relative-name file) t nil args)
200 (buffer-substring (point-min) (+ (point-min) 40)))))
201 186
202(defun vc-bzr-state-heuristic (file) 187(defun vc-bzr-state-heuristic (file)
203 "Like `vc-bzr-state' but hopefully without running Bzr." 188 "Like `vc-bzr-state' but hopefully without running Bzr."
204 ;; `bzr status' was excruciatingly slow with large histories and 189 ;; `bzr status' could be slow with large histories and pending merges,
205 ;; pending merges, so try to avoid using it until they fix their 190 ;; so this tries to avoid calling it if possible. bzr status is
206 ;; performance problems. 191 ;; faster now, so this is not as important as it was.
192 ;;
207 ;; This function tries first to parse Bzr internal file 193 ;; This function tries first to parse Bzr internal file
208 ;; `checkout/dirstate', but it may fail if Bzr internal file format 194 ;; `checkout/dirstate', but it may fail if Bzr internal file format
209 ;; has changed. As a safeguard, the `checkout/dirstate' file is 195 ;; has changed. As a safeguard, the `checkout/dirstate' file is
@@ -299,10 +285,7 @@ in the repository root directory of FILE."
299 'up-to-date) 285 'up-to-date)
300 (t 'edited)) 286 (t 'edited))
301 'unregistered)))) 287 'unregistered))))
302 ;; Either the dirstate file can't be read, or the sha1 288 ;; The dirstate file can't be read, or some other problem.
303 ;; executable is missing, or ...
304 ;; In either case, recent versions of Bzr aren't that slow
305 ;; any more.
306 (error (vc-bzr-state file))))))) 289 (error (vc-bzr-state file)))))))
307 290
308 291