emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107858: Use internal sha1 in vc-bzr


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107858: Use internal sha1 in vc-bzr
Date: Tue, 10 Apr 2012 21:16:48 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107858
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2012-04-10 21:16:48 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/vc/vc-bzr.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-11 00:21:00 +0000
+++ b/lisp/ChangeLog    2012-04-11 01:16:48 +0000
@@ -1,3 +1,8 @@
+2012-04-11  Glenn Morris  <address@hidden>
+
+       * vc/vc-bzr.el (vc-bzr-sha1-program, sha1-program): Remove.
+       (vc-bzr-sha1): Use internal sha1.
+
 2012-04-11  Stefan Monnier  <address@hidden>
 
        * progmodes/flymake.el (flymake-mode): Beware read-only dirs (bug#8954).

=== modified file 'lisp/vc/vc-bzr.el'
--- a/lisp/vc/vc-bzr.el 2012-03-22 19:57:43 +0000
+++ b/lisp/vc/vc-bzr.el 2012-04-11 01:16:48 +0000
@@ -37,7 +37,6 @@
 ;; are bzr-versioned, `vc-bzr` presently runs `bzr status` on the
 ;; symlink, thereby not detecting whether the actual contents
 ;; (that is, the target contents) are changed.
-;; See https://bugs.launchpad.net/vc-bzr/+bug/116607
 
 ;;; Properties of the backend
 
@@ -65,14 +64,6 @@
   :group 'vc-bzr
   :type 'string)
 
-(defcustom vc-bzr-sha1-program '("sha1sum")
-  "Name of program to compute SHA1.
-It must be a string \(program name\) or list of strings \(name and its args\)."
-  :type '(repeat string)
-  :group 'vc-bzr)
-
-(define-obsolete-variable-alias 'sha1-program 'vc-bzr-sha1-program "24.1")
-
 (defcustom vc-bzr-diff-switches nil
   "String or list of strings specifying switches for bzr diff under VC.
 If nil, use the value of `vc-diff-switches'.  If t, use no switches."
@@ -190,20 +181,15 @@
 (defun vc-bzr-sha1 (file)
   (with-temp-buffer
     (set-buffer-multibyte nil)
-    (let ((prog vc-bzr-sha1-program)
-          (args nil)
-         process-file-side-effects)
-      (when (consp prog)
-       (setq args (cdr prog))
-        (setq prog (car prog)))
-      (apply 'process-file prog (file-relative-name file) t nil args)
-      (buffer-substring (point-min) (+ (point-min) 40)))))
+    (insert-file-contents-literally file)
+    (sha1 (current-buffer))))
 
 (defun vc-bzr-state-heuristic (file)
   "Like `vc-bzr-state' but hopefully without running Bzr."
-  ;; `bzr status' was excruciatingly slow with large histories and
-  ;; pending merges, so try to avoid using it until they fix their
-  ;; performance problems.
+  ;; `bzr status' could be slow with large histories and pending merges,
+  ;; so this tries to avoid calling it if possible.  bzr status is
+  ;; faster now, so this is not as important as it was.
+  ;;
   ;; This function tries first to parse Bzr internal file
   ;; `checkout/dirstate', but it may fail if Bzr internal file format
   ;; has changed.  As a safeguard, the `checkout/dirstate' file is
@@ -299,10 +285,7 @@
                         'up-to-date)
                        (t 'edited))
                     'unregistered))))
-          ;; Either the dirstate file can't be read, or the sha1
-          ;; executable is missing, or ...
-          ;; In either case, recent versions of Bzr aren't that slow
-          ;; any more.
+          ;; The dirstate file can't be read, or some other problem.
           (error (vc-bzr-state file)))))))
 
 


reply via email to

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