This also removes switch "-C -C" from vc-git-annotate-command.
Fixes: debbugs:17945
* vc/vc.el (vc-annotate-switches): New defcustom.
* vc/vc-bzr.el (vc-bzr-annotate-switches): New defcustom.
(vc-bzr-annotate-command): Use it.
* vc/vc-cvs.el (vc-cvs-annotate-switches): New defcustom.
(vc-cvs-annotate-command): Use it.
* vc/vc-git.el (vc-git-annotate-switches): New defcustom.
(vc-git-annotate-command): Use it.
* vc/vc-hg.el (vc-hg-annotate-switches): New defcustom.
(vc-hg-annotate-command): Use it.
* vc/vc-mtn.el (vc-mtn-annotate-switches): New defcustom.
(vc-mtn-annotate-command): Use it.
* vc/vc-svn.el (vc-svn-annotate-switches): New defcustom.
(vc-svn-annotate-command): Use it.
+2015-02-26 Oscar Fuentes <ofv@wanadoo.es>
+
+ * vc/vc.el (vc-annotate-switches): New defcustom.
+ * vc/vc-bzr.el (vc-bzr-annotate-switches): New defcustom.
+ (vc-bzr-annotate-command): Use it.
+ * vc/vc-cvs.el (vc-cvs-annotate-switches): New defcustom.
+ (vc-cvs-annotate-command): Use it.
+ * vc/vc-git.el (vc-git-annotate-switches): New defcustom.
+ (vc-git-annotate-command): Use it.
+ * vc/vc-hg.el (vc-hg-annotate-switches): New defcustom.
+ (vc-hg-annotate-command): Use it.
+ * vc/vc-mtn.el (vc-mtn-annotate-switches): New defcustom.
+ (vc-mtn-annotate-command): Use it.
+ * vc/vc-svn.el (vc-svn-annotate-switches): New defcustom.
+ (vc-svn-annotate-command): Use it.
+
2015-02-26 Alan Mackenzie <acm@muc.de>
Handle "#" operator properly inside macro. Fix coding bug.
(repeat :tag "Argument List" :value ("") string))
:group 'vc-bzr)
+(defcustom vc-bzr-annotate-switches nil
+ "String or list of strings specifying switches for bzr annotate under VC.
+If nil, use the value of `vc-annotate-switches'. If t, use no switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string))
+ :version "25.1"
+ :group 'vc-bzr)
+
(defcustom vc-bzr-log-switches nil
"String or list of strings specifying switches for bzr log under VC."
:type '(choice (const :tag "None" nil)
Each line is tagged with the revision number, which has a `help-echo'
property containing author and date information."
(apply #'vc-bzr-command "annotate" buffer 'async file "--long" "--all"
- (if revision (list "-r" revision)))
+ (append (vc-switches 'bzr 'annotate)
+ (if revision (list "-r" revision))))
(let ((table (make-hash-table :test 'equal)))
(set-process-filter
(get-buffer-process buffer)
:version "21.1"
:group 'vc-cvs)
+(defcustom vc-cvs-annotate-switches nil
+ "String or list of strings specifying switches for cvs annotate under VC.
+If nil, use the value of `vc-annotate-switches'. If t, use no
+switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string))
+ :version "25.1"
+ :group 'vc-cvs)
+
(defcustom vc-cvs-header '("\$Id\$")
"Header keywords to be inserted by `vc-insert-headers'."
:version "24.1" ; no longer consult the obsolete vc-header-alist
(defun vc-cvs-annotate-command (file buffer &optional revision)
"Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER.
Optional arg REVISION is a revision to annotate from."
- (vc-cvs-command buffer
- (if (vc-cvs-stay-local-p file)
- 'async 0)
- file "annotate"
- (if revision (concat "-r" revision)))
+ (apply #'vc-cvs-command buffer
+ (if (vc-cvs-stay-local-p file)
+ 'async 0)
+ file "annotate"
+ (append (vc-switches 'cvs 'annotate)
+ (if revision (list (concat "-r" revision)))))
;; Strip the leading few lines.
(let ((proc (get-buffer-process buffer)))
(if proc
:version "23.1"
:group 'vc-git)
+(defcustom vc-git-annotate-switches nil
+ "String or list of strings specifying switches for Git blame under VC.
+If nil, use the value of `vc-annotate-switches'. If t, use no switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string))
+ :version "25.1"
+ :group 'vc-git)
+
(defcustom vc-git-program "git"
"Name of the Git executable (excluding any arguments)."
:version "24.1"
(defun vc-git-annotate-command (file buf &optional rev)
(let ((name (file-relative-name file)))
- (vc-git-command buf 'async nil "blame" "--date=iso" "-C" "-C" rev "--" name)))
+ (apply #'vc-git-command buf 'async nil "blame" "--date=iso"
+ (append (vc-switches 'git 'annotate)
+ (list rev "--" name)))))
(declare-function vc-annotate-convert-time "vc-annotate" (time))
:version "23.1"
:group 'vc-hg)
+(defcustom vc-hg-annotate-switches nil
+ "String or list of strings specifying switches for hg annotate under VC.
+If nil, use the value of `vc-annotate-switches'. If t, use no
+switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string))
+ :version "25.1"
+ :group 'vc-hg)
+
(defcustom vc-hg-program "hg"
"Name of the Mercurial executable (excluding any arguments)."
:type 'string
(defun vc-hg-annotate-command (file buffer &optional revision)
"Execute \"hg annotate\" on FILE, inserting the contents in BUFFER.
Optional arg REVISION is a revision to annotate from."
- (vc-hg-command buffer 0 file "annotate" "-d" "-n" "--follow"
- (when revision (concat "-r" revision))))
+ (apply #'vc-hg-command buffer 0 file "annotate" "-d" "-n" "--follow"
+ (append (vc-switches 'hg 'annotate)
+ (if revision (list (concat "-r" revision))))))
(declare-function vc-annotate-convert-time "vc-annotate" (time))
:version "23.1"
:group 'vc-mtn)
+(defcustom vc-mtn-annotate-switches nil
+ "String or list of strings specifying switches for mtn annotate under VC.
+If nil, use the value of `vc-annotate-switches'. If t, use no
+switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string))
+ :version "25.1"
+ :group 'vc-mtn)
+
(define-obsolete-variable-alias 'vc-mtn-command 'vc-mtn-program "23.1")
(defcustom vc-mtn-program "mtn"
"Name of the monotone executable."
(if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2)))))
(defun vc-mtn-annotate-command (file buf &optional rev)
- (apply 'vc-mtn-command buf 'async file "annotate"
- (if rev (list "-r" rev))))
+ (apply #'vc-mtn-command buf 'async file "annotate"
+ (append (vc-switches 'mtn 'annotate)
+ (if rev (list "-r" rev)))))
(declare-function vc-annotate-convert-time "vc-annotate" (time))
:version "22.1"
:group 'vc-svn)
+(defcustom vc-svn-annotate-switches nil
+ "String or list of strings specifying switches for svn annotate under VC.
+If nil, use the value of `vc-annotate-switches'. If t, use no
+switches."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string))
+ :version "25.1"
+ :group 'vc-svn)
+
(defcustom vc-svn-header '("\$Id\$")
"Header keywords to be inserted by `vc-insert-headers'."
:version "24.1" ; no longer consult the obsolete vc-header-alist
;; Support for `svn annotate'
(defun vc-svn-annotate-command (file buf &optional rev)
- (vc-svn-command buf 'async file "annotate" (if rev (concat "-r" rev))))
+ (apply #'vc-svn-command buf 'async file "annotate"
+ (append (vc-switches 'svn 'annotate)
+ (if rev (list (concat "-r" rev))))))
(defun vc-svn-annotate-time-of-rev (rev)
;; Arbitrarily assume 10 commits per day.
:group 'vc
:version "21.1")
+(defcustom vc-annotate-switches nil
+ "A string or list of strings specifying switches for annotate under VC.
+When running annotate under a given BACKEND, VC uses the first
+non-nil value of `vc-BACKEND-annotate-switches', `vc-annotate-switches',
+and `annotate-switches', in that order. Since nil means to check the
+next variable in the sequence, either of the first two may use
+the value t to mean no switches at all. `vc-annotate-switches'
+should contain switches that are specific to version control, but
+not specific to any particular backend.
+
+As very few switches (if any) are used across different VC tools,
+please consider using the specific `vc-BACKEND-annotate-switches'
+for the backend you use."
+ :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string))
+ :group 'vc
+ :version "25.1")
+
(defcustom vc-log-show-limit 2000
"Limit the number of items shown by the VC log commands.
Zero means unlimited.