[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 84b79f6 3/3: Add vc-hg-revert-switches
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master 84b79f6 3/3: Add vc-hg-revert-switches |
Date: |
Thu, 7 Feb 2019 04:27:54 -0500 (EST) |
branch: master
commit 84b79f6a07bf45a27815f4793a7ee79a6d3610b3
Author: Ian Dunn <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Add vc-hg-revert-switches
* lisp/vc/vc-hg.el (vc-hg-revert-switches): New option.
(vc-hg-revert): Use it.
---
etc/NEWS | 3 +++
lisp/vc/vc-hg.el | 15 ++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/etc/NEWS b/etc/NEWS
index f889a8a..7ee49bf 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -448,6 +448,9 @@ values.
*** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions
and compares their entire trees.
+*** New user option 'vc-hg-revert-switches' specifies switches to pass
+to hg revert.
+
** Diff mode
*** Hunks are now automatically refined by default.
To disable it, set the new defcustom 'diff-font-lock-refine' to nil.
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index befaabd..342c6d2 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 +1170,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.