From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33650: 27.0.50; Root diffs between revisions Date: Mon, 10 Dec 2018 02:04:30 +0200 Organization: LINKOV.NET Message-ID: <87efaqkzkp.fsf@mail.linkov.net> References: <87d0qe8gon.fsf@mail.linkov.net> <831s6t7s9j.fsf@gnu.org> <87va431t6w.fsf@mail.linkov.net> <835zw33yae.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1544402206 18681 195.159.176.226 (10 Dec 2018 00:36:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Dec 2018 00:36:46 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33650@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 10 01:36:41 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gW9Yu-0004kI-0p for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Dec 2018 01:36:40 +0100 Original-Received: from localhost ([::1]:57804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gW9b0-0002Jr-M8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Dec 2018 19:38:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gW9aJ-0001Ac-3d for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 19:38:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gW9aF-0004Bt-Rl for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 19:38:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36224) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gW9aF-0004Bb-IZ for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 19:38:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gW9aF-0004eB-EU for bug-gnu-emacs@gnu.org; Sun, 09 Dec 2018 19:38:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Dec 2018 00:38:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33650 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33650-submit@debbugs.gnu.org id=B33650.154440223017668 (code B ref 33650); Mon, 10 Dec 2018 00:38:03 +0000 Original-Received: (at 33650) by debbugs.gnu.org; 10 Dec 2018 00:37:10 +0000 Original-Received: from localhost ([127.0.0.1]:40441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gW9ZN-0004ar-OW for submit@debbugs.gnu.org; Sun, 09 Dec 2018 19:37:10 -0500 Original-Received: from golden.birch.relay.mailchannels.net ([23.83.209.73]:35588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gW9ZL-0004ae-I7 for 33650@debbugs.gnu.org; Sun, 09 Dec 2018 19:37:08 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 3F2AB3E66B5; Mon, 10 Dec 2018 00:37:06 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a47.g.dreamhost.com (unknown [100.96.19.74]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E9FAF3E36B1; Mon, 10 Dec 2018 00:37:05 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a47.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Mon, 10 Dec 2018 00:37:06 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Well-Made-Duck: 772b44e15e6c3829_1544402226055_629348416 X-MC-Loop-Signature: 1544402226055:3287583377 X-MC-Ingress-Time: 1544402226054 Original-Received: from pdx1-sub0-mail-a47.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a47.g.dreamhost.com (Postfix) with ESMTP id A448A805B3; Sun, 9 Dec 2018 16:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=DJvTr1POs5UuAk2EWCTeiggEdt4=; b= ZJ4+xpxZhAlK4qJupc3auJrykAN9rfQufoSQWSqerK23hLF5Sy8uQHKBgi5Dk1xP 9/ED8IleFCRlEuEbQO3Xt0+Ws7nxIgg5vjZmunKRe5ib4J/gw/JNcEnouUbLIOqa +LvebpZ+BmbJz/PQjxJQEmi7koxliVMIp8zZXQyaR5A= Original-Received: from mail.jurta.org (m91-129-96-177.cust.tele2.ee [91.129.96.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a47.g.dreamhost.com (Postfix) with ESMTPSA id 5BB44805B0; Sun, 9 Dec 2018 16:37:03 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a47 In-Reply-To: <835zw33yae.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 09 Dec 2018 10:22:01 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudeggedgvdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdeliedrudejjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdeliedrudejjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvlhhiiiesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt 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: 208.118.235.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:153283 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> > Finally, we need documentation changes to go with this change of >> > user-visible behavior. >> >> This feature is already documented in (info "(emacs) Old Revisions") >> >> =E2=80=98C-x v D=E2=80=99 >> Compare the entire working tree to the revision you started fro= m >> (=E2=80=98vc-root-diff=E2=80=99). With a prefix argument, prom= pt for two revisions >> and compare their trees. >> >> It didn't work as documented before properly implemented by the patch. > > Isn't the result user-visible change in behavior? Yes, this fix changes user-visible behavior, so perhaps it should be mentioned in NEWS. >> (defun vc-version-diff (_files rev1 rev2) >> - "Report diffs between revisions of the fileset in the repository hi= story." >> + "Report diffs between revisions of the fileset in the repository hi= story. >> +REV1 is an older revision, REV2 is a newer revision." > > We usually mention the arguments in the first line of the doc string. > Something like this: > > Report diffs between revisions REV1 and REV2 in the repository histor= y. > > I wonder whether "fileset" needs to be mentioned at all, given your > changes. When does any "fileset" come into play here? "fileset" is essential to be mentioned in `vc-version-diff' whereas the text "in the repository history" is unnecessary. >> +(defun vc-root-version-diff (_files rev1 rev2) >> + "Report diffs between revisions of the whole tree in the repository= history. >> +REV1 is an older revision, REV2 is a newer revision." > > Same here: please mention the arguments in the first sentence. As "fileset" is essential for `vc-version-diff', "whole tree" is essential for `vc-root-version-diff': --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-root-version-diff.3.patch diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 4527c23d9e..e92db9e419 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -774,8 +774,7 @@ Old Revisions @item C-x v D Compare the entire working tree to the revision you started from -(@code{vc-root-diff}). With a prefix argument, prompt for two -revisions and compare their trees. +(@code{vc-root-diff}). @item C-x v ~ Prompt for a revision of the current file, and visit it in a separate @@ -829,7 +828,9 @@ Old Revisions it displays the changes in the entire current working tree (i.e., the working tree containing the current VC fileset). If you invoke this command from a Dired buffer, it applies to the working tree containing -the directory. +the directory. With a prefix argument, prompt for two revisions and +compare the entire version-controlled directory trees (RCS, SCCS, CVS, +and SRC do not support this feature). @vindex vc-diff-switches You can customize the @command{diff} options that @kbd{C-x v =} and @@ -963,6 +964,7 @@ VC Change Log Directory Mode}) or a Dired buffer (@pxref{Dired}), it applies to the file listed on the current line. +@kindex C-x v L @findex vc-print-root-log @findex log-view-toggle-entry-display @kbd{C-x v L} (@code{vc-print-root-log}) displays a diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index dbbc3e2038..5ff9f4d5be 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1817,7 +1817,7 @@ vc-diff-build-argument-list-internal ;;;###autoload (defun vc-version-diff (_files rev1 rev2) - "Report diffs between revisions of the fileset in the repository history." + "Report diffs between REV1 and REV2 revisions of the fileset." (interactive (vc-diff-build-argument-list-internal)) ;; All that was just so we could do argument completion! (when (and (not rev1) rev2) @@ -1827,6 +1827,28 @@ vc-version-diff (vc-diff-internal t (vc-deduce-fileset t) rev1 rev2 (called-interactively-p 'interactive))) +;;;###autoload +(defun vc-root-version-diff (_files rev1 rev2) + "Report diffs between REV1 and REV2 revisions of the whole tree." + (interactive (vc-diff-build-argument-list-internal)) + ;; This is a mix of `vc-root-diff' and `vc-version-diff' + (when (and (not rev1) rev2) + (error "Not a valid revision range")) + (let ((backend (vc-deduce-backend)) + (default-directory default-directory) + rootdir) + (if backend + (setq rootdir (vc-call-backend backend 'root default-directory)) + (setq rootdir (read-directory-name "Directory for VC root-diff: ")) + (setq backend (vc-responsible-backend rootdir)) + (if backend + (setq default-directory rootdir) + (error "Directory is not version controlled"))) + (let ((default-directory rootdir)) + (vc-diff-internal + t (list backend (list rootdir)) rev1 rev2 + (called-interactively-p 'interactive))))) + ;;;###autoload (defun vc-diff (&optional historic not-urgent) "Display diffs between file revisions. @@ -1900,10 +1922,8 @@ vc-root-diff saving the buffer." (interactive (list current-prefix-arg t)) (if historic - ;; FIXME: this does not work right, `vc-version-diff' ends up - ;; calling `vc-deduce-fileset' to find the files to diff, and - ;; that's not what we want here, we want the diff for the VC root dir. - (call-interactively 'vc-version-diff) + ;; We want the diff for the VC root dir. + (call-interactively 'vc-root-version-diff) (when buffer-file-name (vc-buffer-sync not-urgent)) (let ((backend (vc-deduce-backend)) (default-directory default-directory) --=-=-=--