From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#5428: vc-annotate for Bzr does not show the date Date: Thu, 27 Jun 2019 19:36:17 +0200 Message-ID: References: <201001200726.o0K7Qn9W013724@godzilla.ics.uci.edu> <8u3836n45e.fsf@fencepost.gnu.org> <5557D8FB.7030105@yandex.ru> <87bn71tl8r.fsf@gnus.org> <7bio18zo57.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="90295"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 5428@debbugs.gnu.org, Dan Nicolaescu , Stefan Monnier , Dmitry Gutov To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 27 19:37:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgYKm-000NLs-6z for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 19:37:20 +0200 Original-Received: from localhost ([::1]:53230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgYKl-00081r-7p for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 13:37:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35883) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgYKb-00081j-Am for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 13:37:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgYKV-000714-RI for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 13:37:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54207) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgYKU-00070J-Fx for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 13:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgYKU-00042n-B3 for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 13:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Jun 2019 17:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5428 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 5428-submit@debbugs.gnu.org id=B5428.156165699115504 (code B ref 5428); Thu, 27 Jun 2019 17:37:02 +0000 Original-Received: (at 5428) by debbugs.gnu.org; 27 Jun 2019 17:36:31 +0000 Original-Received: from localhost ([127.0.0.1]:39518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgYJz-000420-2m for submit@debbugs.gnu.org; Thu, 27 Jun 2019 13:36:31 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:46084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgYJx-00041r-II for 5428@debbugs.gnu.org; Thu, 27 Jun 2019 13:36:30 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgYJl-0008AV-Hr; Thu, 27 Jun 2019 19:36:21 +0200 In-Reply-To: <7bio18zo57.fsf@fencepost.gnu.org> (Glenn Morris's message of "Sun, 28 Feb 2016 13:27:16 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161625 Archived-At: Glenn Morris 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