diff options
author | Glenn Morris <rgm@gnu.org> | 2008-11-22 03:34:55 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2008-11-22 03:34:55 +0000 |
commit | a857238c11e6a30e2168a43c0ae78a1bd93bf7b5 (patch) | |
tree | fd0fd30ea796a94e2e555f6c844ab81b8e510b06 /lisp/vc-mtn.el | |
parent | e94851d3ca97bd644e9e6e60a1bc6a46b041b987 (diff) | |
download | emacs-a857238c11e6a30e2168a43c0ae78a1bd93bf7b5.tar.gz |
(vc-mtn-diff-switches): New option.
(vc-mtn-program): Rename from vc-mtn-command, for
consistency with other backends. Keep old name as alias.
Update callers. Make it a defcustom.
(vc-mtn-diff): Give it a doc string. Apply diff switches.
Diffstat (limited to 'lisp/vc-mtn.el')
-rw-r--r-- | lisp/vc-mtn.el | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/lisp/vc-mtn.el b/lisp/vc-mtn.el index 42defb6f233..f5fffb7fc87 100644 --- a/lisp/vc-mtn.el +++ b/lisp/vc-mtn.el @@ -33,12 +33,30 @@ (eval-when-compile (require 'cl) (require 'vc)) +(defcustom vc-mtn-diff-switches t + "String or list of strings specifying switches for monotone diff under VC. +If nil, use the value of `vc-diff-switches'. +If you want to force an empty list of arguments, use t." + :type '(choice (const :tag "Unspecified" nil) + (const :tag "None" t) + (string :tag "Argument String") + (repeat :tag "Argument List" + :value ("") + string)) + :version "23.1" + :group 'vc) + +(define-obsolete-variable-alias 'vc-mtn-command 'vc-mtn-program "23.1") +(defcustom vc-mtn-program "mtn" + "Name of the monotone executable." + :type 'string + :group 'vc) + ;; Clear up the cache to force vc-call to check again and discover ;; new functions when we reload this file. (put 'Mtn 'vc-functions nil) -(defvar vc-mtn-command "mtn") -(unless (executable-find vc-mtn-command) +(unless (executable-find vc-mtn-program) ;; vc-mtn.el is 100% non-functional without the `mtn' executable. (setq vc-handled-backends (delq 'Mtn vc-handled-backends))) @@ -75,7 +93,8 @@ (let ((process-environment ;; Avoid localization of messages so we can parse the output. (cons "LC_MESSAGES=C" process-environment))) - (apply 'vc-do-command (or buffer "*vc*") okstatus vc-mtn-command files flags))) + (apply 'vc-do-command (or buffer "*vc*") okstatus vc-mtn-program + files flags))) (defun vc-mtn-state (file) ;; If `mtn' fails or returns status>0, or if the search files, just @@ -183,8 +202,11 @@ ;; ) (defun vc-mtn-diff (files &optional rev1 rev2 buffer) + "Get a difference report using monotone between two revisions of FILES." (apply 'vc-mtn-command (or buffer "*vc-diff*") 1 files "diff" - (append (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2))))) + (append + (vc-switches (if vc-mtn-diff-switches 'mtn) 'diff) + (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2))))) (defun vc-mtn-annotate-command (file buf &optional rev) (apply 'vc-mtn-command buf 0 file "annotate" |