[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc-bzr.el,v [EMACS_22_BASE]
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc-bzr.el,v [EMACS_22_BASE] |
Date: |
Mon, 06 Aug 2007 21:17:40 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Stefan Monnier <monnier> 07/08/06 21:17:38
Index: vc-bzr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-bzr.el,v
retrieving revision 1.11.2.4
retrieving revision 1.11.2.5
diff -u -b -r1.11.2.4 -r1.11.2.5
--- vc-bzr.el 3 Aug 2007 05:09:21 -0000 1.11.2.4
+++ vc-bzr.el 6 Aug 2007 21:17:33 -0000 1.11.2.5
@@ -10,7 +10,7 @@
;; Author: Dave Love <address@hidden>, Riccardo Murri <address@hidden>
;; Keywords: tools
;; Created: Sept 2006
-;; Version: 2007-05-24
+;; Version: 2007-08-03
;; URL: http://launchpad.net/vc-bzr
;; This file is free software; you can redistribute it and/or modify
@@ -101,32 +101,47 @@
;; is connected to a PTY; therefore, ask Emacs to use a pipe to
;; communicate with it.
;; This is redundant because vc-do-command does it already. --Stef
+ ;; Only for 'async processes, it seems. --Riccardo
(process-connection-type nil))
(apply 'vc-do-command buffer okstatus vc-bzr-program
file-or-list bzr-command (append vc-bzr-program-args args))))
;;;###autoload
-(defconst vc-bzr-admin-dirstate ".bzr/checkout/dirstate") ; "_bzr" on w32??
+(defconst vc-bzr-admin-dirname ".bzr" ; FIXME: "_bzr" on w32?
+ "Name of the directory containing Bzr repository status files.")
+(defconst vc-bzr-admin-checkout-format-file
+ (concat vc-bzr-admin-dirname "/checkout/format"))
+(defconst vc-bzr-admin-dirstate
+ (concat vc-bzr-admin-dirname "/checkout/dirstate"))
+(defconst vc-bzr-admin-branch-format-file
+ (concat vc-bzr-admin-dirname "/branch/format"))
+(defconst vc-bzr-admin-revhistory
+ (concat vc-bzr-admin-dirname "/branch/revision-history"))
;;;###autoload (defun vc-bzr-registered (file)
-;;;###autoload (if (vc-find-root file vc-bzr-admin-dirstate)
+;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file)
;;;###autoload (progn
;;;###autoload (load "vc-bzr")
;;;###autoload (vc-bzr-registered file))))
(defun vc-bzr-root-dir (file)
"Return the root directory in the hierarchy above FILE.
-Return nil if there isn't one."
- (vc-find-root file vc-bzr-admin-dirstate))
+Return nil if there isn't one.
+
+Note: use `vc-bzr-root' instead, which caches lookup results."
+ (vc-find-root file vc-bzr-admin-checkout-format-file))
(defun vc-bzr-registered (file)
"Return non-nil if FILE is registered with bzr."
- (let ((root (vc-bzr-root-dir file)))
+ (condition-case nil
+ (lexical-let ((root (vc-bzr-root file)))
(and root ; Short cut.
;; This looks at internal files. May break if they change
;; their format.
+ (lexical-let
+ ((dirstate-file (expand-file-name vc-bzr-admin-dirstate
root)))
+ (if (file-exists-p dirstate-file)
(with-temp-buffer
- (insert-file-contents
- (expand-file-name vc-bzr-admin-dirstate root))
+ (insert-file-contents dirstate-file)
(goto-char (point-min))
(let* ((relfile (file-relative-name file root))
(reldir (file-name-directory relfile)))
@@ -137,7 +152,9 @@
(regexp-quote (file-name-nondirectory relfile))
"