all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Glenn Morris <rgm@gnu.org>
Cc: 5428@debbugs.gnu.org, Dan Nicolaescu <dann@ics.uci.edu>,
	Stefan Monnier <monnier@IRO.UMontreal.CA>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#5428: vc-annotate for Bzr does not show the date
Date: Thu, 27 Jun 2019 19:36:17 +0200	[thread overview]
Message-ID: <m3mui3ylpq.fsf@gnus.org> (raw)
In-Reply-To: <7bio18zo57.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sun, 28 Feb 2016 13:27:16 -0500")

Glenn Morris <rgm@gnu.org> writes:

>> It looks to me like the vc-annotate output is reasonable now, so I'm
>> closing this bug report.  If it's still an issue, please reopen.
>
> The actual report was that vc-annotate for bzr does not show the date.
> It still doesn't, so I don't see why you would think this is fixed.
> The meta-issue was that the various backends display different
> annotation information.

Indeed.  The bzr output is really, really terse.

I've reworked Dan's patch to work apply now, and with that I get lines
like

1   larsi@gnus.org 20190627 | Foo

which seem nice and terse, but informative.  (The current git version,
on the other hand, is way overboard in noise.)

Does anybody still object to this change?  Stefan wanted this to be
customisable, and that would be nice, and should probably apply to all
backends, but it's a somewhat orthogonal issue...

diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index ee1646cae5..89f1fcce37 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -869,61 +869,25 @@ vc-bzr-annotate-command
 property containing author and date information."
   (apply #'vc-bzr-command "annotate" buffer 'async file "--long" "--all"
          (append (vc-switches 'bzr 'annotate)
-		 (if revision (list "-r" revision))))
-  (let ((table (make-hash-table :test 'equal)))
-    (set-process-filter
-     (get-buffer-process buffer)
-     (lambda (proc string)
-       (when (process-buffer proc)
-         (with-current-buffer (process-buffer proc)
-           (setq string (concat (process-get proc :vc-left-over) string))
-           ;; Eg: 102020      Gnus developers          20101020 | regexp."
-           ;; As of bzr 2.2.2, no email address in whoami (which can
-           ;; lead to spaces in the author field) is allowed but discouraged.
-           ;; See bug#7792.
-           (while (string-match "^\\( *[0-9.]+ *\\) \\(.+?\\) +\\([0-9]\\{8\\}\\)\\( |.*\n\\)" string)
-             (let* ((rev (match-string 1 string))
-                    (author (match-string 2 string))
-                    (date (match-string 3 string))
-                    (key (substring string (match-beginning 0)
-                                    (match-beginning 4)))
-                    (line (match-string 4 string))
-                    (tag (gethash key table))
-                    (inhibit-read-only t))
-               (setq string (substring string (match-end 0)))
-	       (unless tag
-		 (setq tag
-		       (propertize
-			(format "%s %-7.7s" rev author)
-			'help-echo (format "Revision: %d, author: %s, date: %s"
-					   (string-to-number rev)
-					   author date)
-			'mouse-face 'highlight))
-                 (puthash key tag table))
-               (goto-char (process-mark proc))
-               (insert tag line)
-               (move-marker (process-mark proc) (point))))
-           (process-put proc :vc-left-over string)))))))
+		 (if revision (list "-r" revision)))))
 
 (declare-function vc-annotate-convert-time "vc-annotate" (&optional time))
 
 (defun vc-bzr-annotate-time ()
-  (when (re-search-forward "^ *[0-9.]+ +.+? +|" nil t)
-    (let ((prop (get-text-property (line-beginning-position) 'help-echo)))
-      (string-match "[0-9]+\\'" prop)
-      (let ((str (match-string-no-properties 0 prop)))
+  (when (re-search-forward "^[0-9.]+ +[^\n ]* +\\([0-9]\\{8\\}\\) |" nil t)
+    (let ((str (match-string-no-properties 1)))
       (vc-annotate-convert-time
        (encode-time 0 0 0
-                      (string-to-number (substring str 6 8))
-                      (string-to-number (substring str 4 6))
-                      (string-to-number (substring str 0 4))))))))
+                    (string-to-number (substring str 6 8))
+                    (string-to-number (substring str 4 6))
+                    (string-to-number (substring str 0 4)))))))
 
 (defun vc-bzr-annotate-extract-revision-at-line ()
   "Return revision for current line of annotation buffer, or nil.
 Return nil if current line isn't annotated."
   (save-excursion
     (beginning-of-line)
-    (if (looking-at "^ *\\([0-9.]+\\) +.* +|")
+    (if (looking-at "^\\([0-9.]+\\) +[^\n ]* +\\([0-9]\\{8\\}\\) |")
         (match-string-no-properties 1))))
 
 (defun vc-bzr-command-discarding-stderr (command &rest args)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2019-06-27 17:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20  7:26 bug#5428: vc-annotate for Bzr does not show the date Dan Nicolaescu
2010-01-20 16:36 ` Chong Yidong
2010-01-20 18:18   ` Dan Nicolaescu
2010-01-20 18:19   ` Eli Zaretskii
2010-01-21 14:17 ` Stefan Monnier
2010-01-21 15:27   ` Dan Nicolaescu
2010-01-22 15:21     ` Stefan Monnier
2010-01-22 19:26       ` Dan Nicolaescu
2010-01-22 20:21         ` Eli Zaretskii
2010-01-23 11:13         ` Stefan Monnier
2010-01-23 17:24           ` Dan Nicolaescu
2019-06-27 18:13     ` Lars Ingebrigtsen
2015-05-08 21:35   ` Glenn Morris
2015-05-16 23:55     ` Dmitry Gutov
2015-05-17  1:16       ` Stefan Monnier
2015-05-17  1:30         ` Dmitry Gutov
2015-05-17  1:47         ` Dmitry Gutov
2015-05-18 16:05           ` Stefan Monnier
2016-02-28  6:14       ` Lars Ingebrigtsen
2016-02-28 18:27         ` Glenn Morris
2019-06-27 17:36           ` Lars Ingebrigtsen [this message]
2019-06-27 18:05             ` Stefan Monnier
2019-06-27 18:11               ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3mui3ylpq.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=5428@debbugs.gnu.org \
    --cc=dann@ics.uci.edu \
    --cc=dgutov@yandex.ru \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.