unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ian Dunn <dunni@gnu.org>
To: 34305@debbugs.gnu.org
Subject: bug#34305: [PATCH] Add switches to hg revert
Date: Sun, 03 Feb 2019 21:55:50 -0500	[thread overview]
Message-ID: <87tvhkcle1.fsf@gnu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 103 bytes --]


* vc/vc-hg.el (vc-hg-revert-switches): New user variable.
  (vc-hg-revert): Use switches for revert.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vc-hg.el.diff --]
[-- Type: text/x-patch, Size: 1138 bytes --]

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,16 @@ switches."
   :version "25.1"
   :group 'vc-hg)
 
+(defcustom vc-hg-revert-switches t
+  "String or list of strings specifying switches for hg revert
+under VC.  If t, use no switches."
+  ;; No nil option, since there's no `vc-revert-switches' variable.
+  :type '(choice (const :tag "None" t)
+		 (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.
 

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
Ian Dunn

             reply	other threads:[~2019-02-04  2:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04  2:55 Ian Dunn [this message]
2019-02-04 16:54 ` bug#34305: [PATCH] Add switches to hg revert Eli Zaretskii
2019-02-05 15:42   ` Ian Dunn
2019-02-05 17:59 ` Dmitry Gutov
2019-02-07  1:42   ` Ian Dunn
2019-02-07  9:27     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvhkcle1.fsf@gnu.org \
    --to=dunni@gnu.org \
    --cc=34305@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).