From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63470: [PATCH] Use faster option for running vc-hg status Date: Wed, 17 May 2023 14:39:45 +0300 Message-ID: <83o7mjxk3i.fsf@gnu.org> References: <83h6shbaiv.fsf@gnu.org> <83bkiobwsu.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31336"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 63470@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 17 13:40:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzFVx-0007vT-GF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 May 2023 13:40:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzFVl-0005oI-QN; Wed, 17 May 2023 07:40:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzFVj-0005o9-B8 for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 07:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pzFVi-00064O-TV for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 07:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzFVi-0003El-Ed for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 07:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 May 2023 11:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63470 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63470-submit@debbugs.gnu.org id=B63470.168432358612413 (code B ref 63470); Wed, 17 May 2023 11:40:02 +0000 Original-Received: (at 63470) by debbugs.gnu.org; 17 May 2023 11:39:46 +0000 Original-Received: from localhost ([127.0.0.1]:49158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFVR-0003E9-TT for submit@debbugs.gnu.org; Wed, 17 May 2023 07:39:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzFVQ-0003Dw-7H for 63470@debbugs.gnu.org; Wed, 17 May 2023 07:39:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzFVJ-0005yt-GT; Wed, 17 May 2023 07:39:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=u9rh26s4MLj59e5ZMK0TzZBRmsVlnfGY5b0g4pwEQl8=; b=qfeS2kSyhHRB yTt4c+zYHYapt8jBswiWV2W5PATQHA3u50EW5CG8jbiEiiyEsBZ5DuzfMLuoNqBauIIuU9Sp4u45B 6hHft3YTQaEJT9OTwtou8zVjSm14KDbZ/7d4usQs0RG6OSgbOzL78xaZ+pXWTbSi875Oi7x23ry/Z 6gn2ovdThLQXFye4KgLnM7cSG8XCSPevi6OGe9aT3d7UiaADvPIgDJ1/vLJ4THcnGP8iHx4pKx93N GqoJEwST/uh4moQKJLmdYbX23DaYTCaFfZ+2A4TuQ5+pqelJaxq283sKaVVeZJhqT8XzxPDhMqK5n 6EJ+sPLbRm9kC4qDysjQMg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzFVG-0001DE-V6; Wed, 17 May 2023 07:39:36 -0400 In-Reply-To: (message from Spencer Baugh on Tue, 16 May 2023 16:39:49 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261840 Archived-At: > From: Spencer Baugh > Cc: Dmitry Gutov , 63470@debbugs.gnu.org > Date: Tue, 16 May 2023 16:39:49 -0400 > > Eli Zaretskii writes: > > >> Date: Fri, 12 May 2023 23:10:05 +0300 > >> Cc: 63470@debbugs.gnu.org > >> From: Dmitry Gutov > >> > >> On 12/05/2023 22:57, Spencer Baugh wrote: > >> > > >> > I could add a user option to revert to the old behavior, if you want. > >> > >> We could cache it like we do with vc-git--program-version. That's a > >> simple memoization that doesn't take the host into account (though that > >> could be implemented, too). > > > > Yes, that'd be a good-enough solution. > > > >> But it'd really make things easier if we're just allowed to rely on some > >> new enough versions of Git and Hg. > > > > It isn't easy to be backward-compatible, but we should strive at doing > > that. > > OK, revised backwards-compatible patch attached. Thanks, but I'd prefer to call the new function only once, and record the result in some variable. We do such things in umpteen other places, so it looks strange to test the version each time only in this case. If you are afraid that somehow the version could change while the Emacs session runs, we could add a command to recompute the version. I think it's reasonable to ask the user to do this by hand, since installing a new version of Mercurial should be something users are aware of.