summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2008-03-19 03:49:09 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2008-03-19 03:49:09 +0000
commitfd2d29b2bd3d8dbd29a2516d21fe53444689ff3e (patch)
treefe23394e0d7d5ed3f56b28a8af72aec00e45b408
parent88219c1f1304cf6bdddc145c36c63b0266f019fa (diff)
downloademacs-fd2d29b2bd3d8dbd29a2516d21fe53444689ff3e.tar.gz
(vc-bzr-print-log): Insert a file marker. Run the log
command for each file in the list. (vc-bzr-log-view-mode): Recognize the file marker. (vc-bzr-show-log-entry): Make regexp match more cases.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/vc-bzr.el36
2 files changed, 33 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 19488a7810b..bacfad225b0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-18 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * vc-bzr.el (vc-bzr-print-log): Insert a file marker. Run the log
+ command for each file in the list.
+ (vc-bzr-log-view-mode): Recognize the file marker.
+ (vc-bzr-show-log-entry): Make regexp match more cases.
+
2008-03-18 Wilson Snyder <wsnyder@wsnyder.org>
* verilog-mode.el (verilog-read-decls): Fix AUTOINPUT/AUTOOUTPUT
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index 325b8e1c7fb..2d0e1a18c3d 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -354,8 +354,7 @@ EDITABLE is ignored."
(define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View"
(remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack.
(require 'add-log)
- ;; Don't have file markers, so use impossible regexp.
- (set (make-local-variable 'log-view-file-re) "\\'\\`")
+ (set (make-local-variable 'log-view-file-re) "^Working file:[ \t]+\\(.+\\)")
(set (make-local-variable 'log-view-message-re)
"^ *-+\n *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)")
(set (make-local-variable 'log-view-font-lock-keywords)
@@ -371,13 +370,25 @@ EDITABLE is ignored."
(defun vc-bzr-print-log (files &optional buffer) ; get buffer arg in Emacs 22
"Get bzr change log for FILES into specified BUFFER."
- ;; FIXME: `vc-bzr-command' runs `bzr log' with `LC_MESSAGES=C', so
- ;; the log display may not what the user wants - but I see no other
- ;; way of getting the above regexps working.
- (apply 'vc-bzr-command "log" buffer 0 files
- (if (stringp vc-bzr-log-switches)
- (list vc-bzr-log-switches)
- vc-bzr-log-switches))
+ ;; `vc-do-command' creates the buffer, but we need it before running
+ ;; the command.
+ (vc-setup-buffer buffer)
+ ;; If the buffer exists from a previous invocation it might be
+ ;; read-only.
+ (let ((inhibit-read-only t))
+ ;; FIXME: `vc-bzr-command' runs `bzr log' with `LC_MESSAGES=C', so
+ ;; the log display may not what the user wants - but I see no other
+ ;; way of getting the above regexps working.
+ ;; "bzr log" (as of bzr-1.1) can only take a single file argument.
+ ;; Loop through the file list.
+ (dolist (file files)
+ (with-current-buffer buffer
+ ;; Insert the file name so that log-view.el can find it.
+ (insert "Working file: " file "\n")) ;; Like RCS/CVS.
+ (apply 'vc-bzr-command "log" buffer 0 file
+ (if (stringp vc-bzr-log-switches)
+ (list vc-bzr-log-switches)
+ vc-bzr-log-switches))))
;; FIXME: Until Emacs-23, VC was missing a hook to sort out the mode for
;; the buffer, or at least set the regexps right.
(unless (fboundp 'vc-default-log-view-mode)
@@ -387,7 +398,12 @@ EDITABLE is ignored."
"Find entry for patch name VERSION in bzr change log buffer."
(goto-char (point-min))
(let (case-fold-search)
- (if (re-search-forward (concat "^-+\nrevno: " version "$") nil t)
+ (if (re-search-forward
+ ;; "revno:" can appear either at the beginning of a line, or indented.
+ (concat "^[ ]*-+\n[ ]*revno: "
+ ;; The revision can contain ".", quote it so that it
+ ;; does not interfere with regexp matching.
+ (regexp-quote revision) "$") nil t)
(beginning-of-line 0)
(goto-char (point-min)))))