From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ian Dunn Newsgroups: gmane.emacs.bugs Subject: bug#34305: [PATCH] Add switches to hg revert Date: Wed, 06 Feb 2019 20:42:39 -0500 Message-ID: <87k1ics7ao.fsf@gnu.org> References: <87tvhkcle1.fsf@gnu.org> <820410bf-a952-039d-f742-68a0d5c01a2d@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="12461"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.0; emacs 26.1.90 Cc: 34305@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 07 02:47:46 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1grYn4-00037h-LB for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Feb 2019 02:47:46 +0100 Original-Received: from localhost ([127.0.0.1]:32952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grYn3-0007DH-DU for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Feb 2019 20:47:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grYmx-0007CT-T5 for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 20:47:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grYiU-0004jI-Mo for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 20:43:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1grYiU-0004j9-Jg for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 20:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1grYiU-0002Si-G9 for bug-gnu-emacs@gnu.org; Wed, 06 Feb 2019 20:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ian Dunn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2019 01:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34305 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34305-submit@debbugs.gnu.org id=B34305.15495037719443 (code B ref 34305); Thu, 07 Feb 2019 01:43:02 +0000 Original-Received: (at 34305) by debbugs.gnu.org; 7 Feb 2019 01:42:51 +0000 Original-Received: from localhost ([127.0.0.1]:36413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grYiG-0002SC-Fe for submit@debbugs.gnu.org; Wed, 06 Feb 2019 20:42:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grYiF-0002Rx-Hl for 34305@debbugs.gnu.org; Wed, 06 Feb 2019 20:42:47 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grYi9-0004Xe-2a; Wed, 06 Feb 2019 20:42:41 -0500 Original-Received: from [2604:6000:1006:8195:229c:c3cf:46a4:839a] (port=54660 helo=escafil) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1grYi8-0002WY-Tk; Wed, 06 Feb 2019 20:42:41 -0500 In-reply-to: <820410bf-a952-039d-f742-68a0d5c01a2d@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:155205 Archived-At: --=-=-= Content-Type: text/plain DG> On 04.02.2019 05:55, Ian Dunn wrote: >> + ;; No nil option, since there's no `vc-revert-switches' variable. DG> nil should still work (vc-switches checks whether vc-revert-switches is bound, DG> it's not an error), and it would probably be more intuitive. I see your point. `vc-bzr-log-switches' does this as well. I've updated the patch to use nil instead of t. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=vc-hg.el.diff diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index befaabd5c6..e7b7de38e6 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -145,6 +145,15 @@ switches." :version "25.1" :group 'vc-hg) +(defcustom vc-hg-revert-switches nil + "String or list of strings specifying switches for hg revert +under VC." + :type '(choice (const :tag "None" nil) + (string :tag "Argument String") + (repeat :tag "Argument List" :value ("") string)) + :version "27.1" + :group 'vc-hg) + (defcustom vc-hg-program "hg" "Name of the Mercurial executable (excluding any arguments)." :type 'string @@ -1161,7 +1171,11 @@ REV is the revision to check out into WORKFILE." ;; Modeled after the similar function in vc-bzr.el (defun vc-hg-revert (file &optional contents-done) (unless contents-done - (with-temp-buffer (vc-hg-command t 0 file "revert")))) + (with-temp-buffer + (apply #'vc-hg-command + t 0 file + "revert" + (append (vc-switches 'hg 'revert)))))) ;;; Hg specific functionality. --=-=-= Content-Type: text/plain -- Ian Dunn --=-=-=--