]> code.delx.au - gnu-emacs/commitdiff
Use vc-switches on vc-*-annotate-command
authorOscar Fuentes <ofv@wanadoo.es>
Thu, 26 Feb 2015 14:46:12 +0000 (15:46 +0100)
committerOscar Fuentes <ofv@wanadoo.es>
Thu, 26 Feb 2015 14:50:41 +0000 (15:50 +0100)
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.

lisp/ChangeLog
lisp/vc/vc-bzr.el
lisp/vc/vc-cvs.el
lisp/vc/vc-git.el
lisp/vc/vc-hg.el
lisp/vc/vc-mtn.el
lisp/vc/vc-svn.el
lisp/vc/vc.el

index 8ccc2c35b1fd53ec76f80bdba8f5f05f3b41a80e..749bd343973f95c1948f7bd06b71b98f21647f83 100644 (file)
@@ -1,3 +1,19 @@
+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.
index 96d6d1da48c34280622ac4fa1dbd7705aac78f36..811f9e80b0c9f3d47860d1709cb8026dea399c90 100644 (file)
@@ -73,6 +73,16 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
                  (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)
@@ -826,7 +836,8 @@ If LIMIT is non-nil, show no more than this many entries."
 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)
index 707090a10eb07d4a1d33635471895c0e0e6904c7..232dcc2185e718b9f18c5900d0db235515f50f7e 100644 (file)
@@ -96,6 +96,17 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   :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
@@ -623,11 +634,12 @@ Remaining arguments are ignored."
 (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
index a31c121b89b3a585c40978d139e10de2fa3b9d27..48e22c826472205c29536f106c9020844b99586b 100644 (file)
@@ -120,6 +120,16 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   :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"
@@ -1013,7 +1023,9 @@ or BRANCH^ (where \"^\" can be repeated)."
 
 (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))
 
index 8b4067f536be405b1da46a5c14d10eff712b5907..c841dfcdf54c00e73a93e63dc4052e88a182d7e7 100644 (file)
@@ -131,6 +131,17 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   :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
@@ -358,8 +369,9 @@ If LIMIT is non-nil, show no more than this many entries."
 (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))
 
index d783572678c1b7a79dc0f6d6dd80ac1150a94808..cd84ebe7afa5cae0854d1a2cbb0fc87b6ea65db1 100644 (file)
@@ -49,6 +49,17 @@ If nil, use the value of `vc-diff-switches'.  If t, use no switches."
   :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."
@@ -246,8 +257,9 @@ If LIMIT is non-nil, show no more than this many entries."
            (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))
 
index d74daf9c36fac3fb2f7d30373fa87a5bfe479304..5ce9afa02c691e9485c803f2d561cce1296655ab 100644 (file)
@@ -95,6 +95,17 @@ If you want to force an empty list of arguments, use t."
   :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
@@ -736,7 +747,9 @@ Set file properties accordingly.  If FILENAME is non-nil, return its status."
 ;; 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.
index 54b221428a58c6bc43e20a83210eccae81e53a42..e8e8202dbbb6e6ca04c1b59f6186d6782e7bd5e4 100644 (file)
@@ -780,6 +780,26 @@ not specific to any particular backend."
   :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.