unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34305: [PATCH] Add switches to hg revert
@ 2019-02-04  2:55 Ian Dunn
  2019-02-04 16:54 ` Eli Zaretskii
  2019-02-05 17:59 ` Dmitry Gutov
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Dunn @ 2019-02-04  2:55 UTC (permalink / raw)
  To: 34305

[-- 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-07  9:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04  2:55 bug#34305: [PATCH] Add switches to hg revert Ian Dunn
2019-02-04 16:54 ` 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

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).