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: Sun, 09 Dec 2018 01:32:47 +0200 Organization: LINKOV.NET Message-ID: <87va431t6w.fsf@mail.linkov.net> References: <87d0qe8gon.fsf@mail.linkov.net> <831s6t7s9j.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1544314368 23291 195.159.176.226 (9 Dec 2018 00:12:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Dec 2018 00:12:48 +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 Sun Dec 09 01:12:44 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 1gVmi8-0005sW-TI for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Dec 2018 01:12:41 +0100 Original-Received: from localhost ([::1]:53393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVmkF-000385-NA for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Dec 2018 19:14:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVmjX-0002iI-B2 for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 19:14:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVmjU-0001Pz-6i for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 19:14:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34778) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVmjU-0001Pv-1l for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 19:14:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gVmjT-0001FF-Sv for bug-gnu-emacs@gnu.org; Sat, 08 Dec 2018 19:14: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: Sun, 09 Dec 2018 00:14: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.15443144184693 (code B ref 33650); Sun, 09 Dec 2018 00:14:03 +0000 Original-Received: (at 33650) by debbugs.gnu.org; 9 Dec 2018 00:13:38 +0000 Original-Received: from localhost ([127.0.0.1]:39027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVmj4-0001Dd-0b for submit@debbugs.gnu.org; Sat, 08 Dec 2018 19:13:38 -0500 Original-Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:46884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gVmj2-0001DR-8j for 33650@debbugs.gnu.org; Sat, 08 Dec 2018 19:13:36 -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 246683E3E77; Sun, 9 Dec 2018 00:13:35 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a20.g.dreamhost.com (unknown [100.96.35.77]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id C86153E3D3B; Sun, 9 Dec 2018 00:13:34 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a20.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); Sun, 09 Dec 2018 00:13:35 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Eyes-Harmony: 47f11fec2d0f1be6_1544314414938_902544820 X-MC-Loop-Signature: 1544314414938:34521423 X-MC-Ingress-Time: 1544314414937 Original-Received: from pdx1-sub0-mail-a20.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a20.g.dreamhost.com (Postfix) with ESMTP id 63D5A80761; Sat, 8 Dec 2018 16:13:34 -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=frb4cQcg/eq02AjhBaGiOE7T8/g=; b= ubyZYvQ7M2DXwTYvSzcKlBBHqNoBI5XJ4W8bV39UN37q6qBdAnWiOciMocJzOPIN qzhERbPlkW8ynxdbGuPyjrtYS1nLKYrnRH6Daq8489+LAmnk4ymaJlgNVPoLlA88 CZbCkc8osrtdBa8BnHytxrNRVz1WpdHhIpLjPiMhvDo= Original-Received: from mail.jurta.org (m91-129-103-7.cust.tele2.ee [91.129.103.7]) (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-a20.g.dreamhost.com (Postfix) with ESMTPSA id 02F9280760; Sat, 8 Dec 2018 16:13:32 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a20 In-Reply-To: <831s6t7s9j.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 07 Dec 2018 08:41:44 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudeguddgudekfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtreejnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtfedrjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdefrdejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepvghlihiisehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd 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:153234 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> +(defun vc-root-version-diff (_files rev1 rev2) >> + "Report diffs between revisions of the whole tree in the repository= history." > > This doc string doesn't describe the arguments, and doesn't tell how > those arguments are populated in interactive invocations. I copied the doc string from `vc-version-diff' that doesn't describe its arguments. Now I fixed the doc string of `vc-version-diff' as well below= . > I also wonder what would this mean for a VCS such as CVS or RCS, where > there's no meaning of a "tree revision". I'm guessing this is why the > old code deduced files to diff. See also the description of vc-diff > in the Emacs manual. `vc-root-diff' is not applicable to VCS without tree revisions, and the manual says nothing about this. Maybe the manual should say this explicitly for `vc-root-diff' as it says it for `vc-print-root-log' in (info "(emacs) VC Change Log") =E2=80=98C-x v L=E2=80=99 (=E2=80=98vc-print-root-log=E2=80=99) disp= lays a =E2=80=98*vc-change-log*=E2=80=99 buffer showing the history of the entire version-controlled directory tree (RCS, SCCS, CVS, and SRC do not support this feature). > 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 from (=E2=80=98vc-root-diff=E2=80=99). With a prefix argument, prompt = for two revisions and compare their trees. It didn't work as documented before properly implemented by the patch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=vc-root-version-diff.2.patch diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index dbbc3e2038..ba410dca0e 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1817,7 +1817,8 @@ 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 revisions of the fileset in the repository history. +REV1 is an older revision, REV2 is a newer revision." (interactive (vc-diff-build-argument-list-internal)) ;; All that was just so we could do argument completion! (when (and (not rev1) rev2) @@ -1827,6 +1828,29 @@ 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 revisions of the whole tree in the repository history. +REV1 is an older revision, REV2 is a newer revision." + (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 +1924,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) --=-=-=--