aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-11-22 03:29:03 +0000
committerGlenn Morris2008-11-22 03:29:03 +0000
commit0717d483b6ccfcbb4a0a9082afff308ab8ac75ed (patch)
tree778784508e8d32718e3c0905111163ce15d034bb
parentf9d5dc48249d23e6f63d58394c11268bbb8bd845 (diff)
downloademacs-0717d483b6ccfcbb4a0a9082afff308ab8ac75ed.tar.gz
emacs-0717d483b6ccfcbb4a0a9082afff308ab8ac75ed.zip
(vc-hg-program): New option.
(vc-hg-state, vc-hg-working-revision, vc-hg-command): Use vc-hg-program rather than hard-coded "hg".
-rw-r--r--lisp/vc-hg.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el
index aa11495441a..35ff589f9f0 100644
--- a/lisp/vc-hg.el
+++ b/lisp/vc-hg.el
@@ -116,6 +116,12 @@
116 116
117;;; Customization options 117;;; Customization options
118 118
119(defcustom vc-hg-program "hg"
120 "Name of the Hg executable."
121 :type 'string
122 :version "23.1"
123 :group 'vc)
124
119(defcustom vc-hg-global-switches nil 125(defcustom vc-hg-global-switches nil
120 "*Global switches to pass to any Hg command." 126 "*Global switches to pass to any Hg command."
121 :type '(choice (const :tag "None" nil) 127 :type '(choice (const :tag "None" nil)
@@ -174,7 +180,8 @@ If you want to force an empty list of arguments, use t."
174 (condition-case nil 180 (condition-case nil
175 ;; Ignore all errors. 181 ;; Ignore all errors.
176 (call-process 182 (call-process
177 "hg" nil t nil "--cwd" (file-name-directory file) 183 vc-hg-program nil t nil
184 "--cwd" (file-name-directory file)
178 "status" "-A" (file-name-nondirectory file)) 185 "status" "-A" (file-name-nondirectory file))
179 ;; Some problem happened. E.g. We can't find an `hg' 186 ;; Some problem happened. E.g. We can't find an `hg'
180 ;; executable. 187 ;; executable.
@@ -205,7 +212,8 @@ If you want to force an empty list of arguments, use t."
205 (condition-case nil 212 (condition-case nil
206 ;; Ignore all errors. 213 ;; Ignore all errors.
207 (call-process 214 (call-process
208 "hg" nil t nil "--cwd" (file-name-directory file) 215 vc-hg-program nil t nil
216 "--cwd" (file-name-directory file)
209 "log" "-l1" (file-name-nondirectory file)) 217 "log" "-l1" (file-name-nondirectory file))
210 ;; Some problem happened. E.g. We can't find an `hg' 218 ;; Some problem happened. E.g. We can't find an `hg'
211 ;; executable. 219 ;; executable.
@@ -597,9 +605,9 @@ REV is the revision to check out into WORKFILE."
597 605
598(defun vc-hg-command (buffer okstatus file-or-list &rest flags) 606(defun vc-hg-command (buffer okstatus file-or-list &rest flags)
599 "A wrapper around `vc-do-command' for use in vc-hg.el. 607 "A wrapper around `vc-do-command' for use in vc-hg.el.
600The difference to vc-do-command is that this function always invokes `hg', 608The difference to vc-do-command is that this function always invokes
601and that it passes `vc-hg-global-switches' to it before FLAGS." 609`vc-hg-program', and that it passes `vc-hg-global-switches' to it before FLAGS."
602 (apply 'vc-do-command (or buffer "*vc*") okstatus "hg" file-or-list 610 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-hg-program file-or-list
603 (if (stringp vc-hg-global-switches) 611 (if (stringp vc-hg-global-switches)
604 (cons vc-hg-global-switches flags) 612 (cons vc-hg-global-switches flags)
605 (append vc-hg-global-switches 613 (append vc-hg-global-switches