diff options
| author | Ian Dunn | 2019-02-07 12:26:04 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2019-02-07 12:27:34 +0300 |
| commit | 84b79f6a07bf45a27815f4793a7ee79a6d3610b3 (patch) | |
| tree | 214da5e28fbcb9b7793870b8935cc413b646aafc | |
| parent | 5e627fa5f5db8f27ea789d61148e7d5ade644956 (diff) | |
| download | emacs-84b79f6a07bf45a27815f4793a7ee79a6d3610b3.tar.gz emacs-84b79f6a07bf45a27815f4793a7ee79a6d3610b3.zip | |
Add vc-hg-revert-switches
* lisp/vc/vc-hg.el (vc-hg-revert-switches): New option.
(vc-hg-revert): Use it.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/vc/vc-hg.el | 15 |
2 files changed, 17 insertions, 1 deletions
| @@ -448,6 +448,9 @@ values. | |||
| 448 | *** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions | 448 | *** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions |
| 449 | and compares their entire trees. | 449 | and compares their entire trees. |
| 450 | 450 | ||
| 451 | *** New user option 'vc-hg-revert-switches' specifies switches to pass | ||
| 452 | to hg revert. | ||
| 453 | |||
| 451 | ** Diff mode | 454 | ** Diff mode |
| 452 | *** Hunks are now automatically refined by default. | 455 | *** Hunks are now automatically refined by default. |
| 453 | To disable it, set the new defcustom 'diff-font-lock-refine' to nil. | 456 | 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 befaabd5c66..342c6d214cd 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -145,6 +145,15 @@ switches." | |||
| 145 | :version "25.1" | 145 | :version "25.1" |
| 146 | :group 'vc-hg) | 146 | :group 'vc-hg) |
| 147 | 147 | ||
| 148 | (defcustom vc-hg-revert-switches nil | ||
| 149 | "String or list of strings specifying switches for hg revert | ||
| 150 | under VC." | ||
| 151 | :type '(choice (const :tag "None" nil) | ||
| 152 | (string :tag "Argument String") | ||
| 153 | (repeat :tag "Argument List" :value ("") string)) | ||
| 154 | :version "27.1" | ||
| 155 | :group 'vc-hg) | ||
| 156 | |||
| 148 | (defcustom vc-hg-program "hg" | 157 | (defcustom vc-hg-program "hg" |
| 149 | "Name of the Mercurial executable (excluding any arguments)." | 158 | "Name of the Mercurial executable (excluding any arguments)." |
| 150 | :type 'string | 159 | :type 'string |
| @@ -1161,7 +1170,11 @@ REV is the revision to check out into WORKFILE." | |||
| 1161 | ;; Modeled after the similar function in vc-bzr.el | 1170 | ;; Modeled after the similar function in vc-bzr.el |
| 1162 | (defun vc-hg-revert (file &optional contents-done) | 1171 | (defun vc-hg-revert (file &optional contents-done) |
| 1163 | (unless contents-done | 1172 | (unless contents-done |
| 1164 | (with-temp-buffer (vc-hg-command t 0 file "revert")))) | 1173 | (with-temp-buffer |
| 1174 | (apply #'vc-hg-command | ||
| 1175 | t 0 file | ||
| 1176 | "revert" | ||
| 1177 | (append (vc-switches 'hg 'revert)))))) | ||
| 1165 | 1178 | ||
| 1166 | ;;; Hg specific functionality. | 1179 | ;;; Hg specific functionality. |
| 1167 | 1180 | ||