emacs-diffs
[Top][All Lists]
Advanced

[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: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-bzr.el,v [EMACS_22_BASE]
Date: Wed, 19 Mar 2008 03:49:15 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Dan Nicolaescu <dann>   08/03/19 03:49:13

Index: vc-bzr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-bzr.el,v
retrieving revision 1.11.2.13
retrieving revision 1.11.2.14
diff -u -b -r1.11.2.13 -r1.11.2.14
--- vc-bzr.el   18 Mar 2008 20:52:17 -0000      1.11.2.13
+++ vc-bzr.el   19 Mar 2008 03:49:08 -0000      1.11.2.14
@@ -354,8 +354,7 @@
 (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 @@
 
 (defun vc-bzr-print-log (files &optional buffer) ; get buffer arg in Emacs 22
   "Get bzr change log for FILES into specified BUFFER."
+  ;; `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.
-  (apply 'vc-bzr-command "log" buffer 0 files 
+    ;; "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))
+              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 @@
   "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)))))
 




reply via email to

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