From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#4642: diff from log-view somtime diffs the wrong file Date: Mon, 5 Oct 2009 05:43:57 -0700 (PDT) Message-ID: <200910051243.n95ChutU010935@godzilla.ics.uci.edu> Reply-To: Dan Nicolaescu , 4642@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1254748048 22253 80.91.229.12 (5 Oct 2009 13:07:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Oct 2009 13:07:28 +0000 (UTC) To: bug-gnu-emacs Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 05 15:07:23 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MunHe-00085S-Sf for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Oct 2009 15:07:23 +0200 Original-Received: from localhost ([127.0.0.1]:34903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MunHe-0003KS-R7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Oct 2009 09:07:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MunHY-0003HG-NT for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 09:07:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MunHU-0003D9-3w for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 09:07:16 -0400 Original-Received: from [199.232.76.173] (port=56770 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MunHT-0003Cs-E9 for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 09:07:11 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37261) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MunHS-000191-Q6 for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 09:07:11 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n95D78Wm029988; Mon, 5 Oct 2009 06:07:09 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n95Ct5vO027236; Mon, 5 Oct 2009 05:55:05 -0700 Resent-Date: Mon, 5 Oct 2009 05:55:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Mon, 05 Oct 2009 12:55:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4642 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125474674126368 (code B ref -1); Mon, 05 Oct 2009 12:55:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 5 Oct 2009 12:45:41 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n95CjdaQ026365 for ; Mon, 5 Oct 2009 05:45:41 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mumwd-0000To-BO for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 08:45:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MumwY-0000TB-Ag for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 08:45:39 -0400 Original-Received: from [199.232.76.173] (port=57830 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MumwY-0000T8-1b for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 08:45:34 -0400 Original-Received: from colin-baker-v0.ics.uci.edu ([128.195.1.153]:44953) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MumwX-0004ln-Bv for bug-gnu-emacs@gnu.org; Mon, 05 Oct 2009 08:45:33 -0400 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by colin-baker-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id n95ChvLe027036 for ; Mon, 5 Oct 2009 05:43:57 -0700 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n95ChutU010935; Mon, 5 Oct 2009 05:43:57 -0700 (PDT) Original-Lines: 59 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: n95ChvLe027036 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 05 Oct 2009 09:07:16 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31698 Archived-At: emacs -Q C-x v d SOME_DIRECTORY RET say the above display 2 files a and b put the cursor on a and do: C-x v l put the cursor on b and switch to the *vc-change-log* buffer. press d in that buffer it will show a diff for the file "b", not "a" (or it will give an error that the diff is not found). log-view-diff calls vc-version-diff, which calls vc-diff-internal not using it's arguments, but by calling `vc-deduce-fileset'. That will trigger this code in vc-deduce-fileset: ((and (buffer-live-p vc-parent-buffer) (or (buffer-file-name vc-parent-buffer) (with-current-buffer vc-parent-buffer (derived-mode-p 'vc-dir-mode)))) but the selected file in the vc-dir buffer has changed, and this will return the new selected file, while log-view actually wants the old one. One way to fix this is to make log-view-diff not call vc-version-diff, but vc-diff-internal, like so: --- log-view.el.~1.60.~ 2009-10-03 03:20:50.000000000 -0700 +++ log-view.el 2009-10-04 19:20:58.000000000 -0700 @@ -496,11 +496,12 @@ changeset that affected the currently co (goto-char end) (log-view-msg-next) (setq to (log-view-current-tag)))) - (vc-version-diff - (if log-view-per-file-logs - (list (log-view-current-file)) - log-view-vc-fileset) - to fr))) + (vc-diff-internal + t (list log-view-vc-backend + (if log-view-per-file-logs + (list (log-view-current-file)) + log-view-vc-fileset)) + to fr))) (declare-function vc-diff-internal "vc" (async vc-fileset rev1 rev2 &optional verbose)) OK to check in?