[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1017: vc-diff for the hg backend ignore diff switches variables
From: |
Glenn Morris |
Subject: |
bug#1017: vc-diff for the hg backend ignore diff switches variables |
Date: |
Sat, 27 Sep 2008 21:59:24 -0400 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Francesco Potorti` wrote:
> 1)
> Apparently the hg backend of vc ignores both diff-switches and
> vc-diff-switches.
>
> 2)
> The vc-hg-diff-switches variables is not defined.
>
> 3)
> The hg backend is special with respect to the vc-diff-switches
> variable.
I don't use hg, but try the included patch, based on vc-svn.
[vc-diff-switches]
> A string or list of strings specifying switches for diff under VC.
> When running diff under a given BACKEND, VC concatenates the values of
> `diff-switches', `vc-diff-switches', and `vc-BACKEND-diff-switches' to
> get the switches for that command. Thus, `vc-diff-switches' should
> contain switches that are specific to version control, but not
> specific to any particular backend.
The above does not appear to be true.
The `vc-switches' command uses either vc-BACKEND-diff-switches, or
vc-diff-switches, or diff-switches. It does not append any of these.
Most vc-BACKEND-diff commands seem to use the above behaviour.
vc-cvs-diff appends diff-switches and vc-diff-switches, but only if it
does not have to call cvs to get a diff. If it does, it uses the
vc-switches method.
vc-mtn-diff and vc-git-diff don't use any switches.
It is all rather confusing...
*** vc-hg.el.~1.85.~ 2008-07-05 12:09:45.000000000 -0700
--- vc-hg.el 2008-09-27 18:29:00.000000000 -0700
***************
*** 123,128 ****
--- 123,142 ----
:version "22.2"
:group 'vc)
+ (defcustom vc-hg-diff-switches
+ t ; Hg doesn't support common args like -u
+ "String or list of strings specifying extra switches for Hg 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)
+
;;; Properties of the backend
***************
*** 248,254 ****
(defun vc-hg-diff (files &optional oldvers newvers buffer)
"Get a difference report using hg between two revisions of FILES."
(let* ((firstfile (car files))
! (working (and firstfile (vc-working-revision firstfile))))
(when (and (equal oldvers working) (not newvers))
(setq oldvers nil))
(when (and (not oldvers) newvers)
--- 262,270 ----
(defun vc-hg-diff (files &optional oldvers newvers buffer)
"Get a difference report using hg between two revisions of FILES."
(let* ((firstfile (car files))
! (working (and firstfile (vc-working-revision firstfile)))
! (switches
! (vc-switches (if vc-hg-diff-switches 'HG) 'diff)))
(when (and (equal oldvers working) (not newvers))
(setq oldvers nil))
(when (and (not oldvers) newvers)
***************
*** 259,264 ****
--- 275,281 ----
(expand-file-name default-directory))
"diff"
(append
+ switches
(when oldvers
(if newvers
(list "-r" oldvers "-r" newvers)