GNU bug report logs - #1017
vc-diff for the hg backend ignore diff switches variables

Previous Next

Package: emacs;

Reported by: Francesco Potorti` <pot <at> gnu.org>

Date: Tue, 23 Sep 2008 15:05:05 UTC

Severity: normal

Tags: moreinfo, patch

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1017 in the body.
You can then email your comments to 1017 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1017; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Francesco Potorti` <pot <at> gnu.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Francesco Potorti` <pot <at> gnu.org>
To: GNU emacs bug list <bug-gnu-emacs <at> gnu.org>
Subject: vc-diff for the hg backend ignore diff switches variables
Date: Tue, 23 Sep 2008 16:57:24 +0200
Three related problems:

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.  Its doc says:

  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.

This behaviour assumes that the diff switches can be accumulated.
however, it does not allow for removing them for a particular backend.
For example, I have

(setq diff-switches "-pu"
      vc-diff-switches "-b")

which works for the cvs and rcs backends.  However, it would not work
for the hg backend, as 'hg diff' does not tolerate the -u option.  This
problem would require a different way of combining the diff switches.





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1017; Package emacs. Full text and rfc822 format available.

Message #8 received at 1017 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Francesco Potorti` <pot <at> gnu.org>
Cc: 1017 <at> debbugs.gnu.org
Subject: Re: bug#1017: vc-diff for the hg backend ignore diff switches variables
Date: Sat, 27 Sep 2008 21:59:24 -0400
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)




Tags added: patch, moreinfo Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 02 Oct 2008 21:25:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1017; Package emacs. Full text and rfc822 format available.

Message #13 received at 1017 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 1017 <at> debbugs.gnu.org
Cc: Francesco Potorti` <pot <at> gnu.org>
Subject: Re: bug#1017: vc-diff for the hg backend ignore diff switches variables
Date: Sat, 04 Oct 2008 16:31:04 -0400
Since I do not use Mercurial, I need someone who does to check that
patch works.




bug 1017 cloned as bug 1384. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 19 Nov 2008 22:10:04 GMT) Full text and rfc822 format available.

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Francesco Potorti` <pot <at> gnu.org>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #20 received at 1017-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 1017-done <at> debbugs.gnu.org
Subject: Re: bug#1017: vc-diff for the hg backend ignore diff switches variables
Date: Wed, 19 Nov 2008 21:45:49 -0500
It seems no-one uses Mercurial, so I verified myself that this seems
to work OK, and have installed it.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1017; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Francesco Potortì <pot <at> gnu.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #25 received at 1017 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Francesco Potortì <pot <at> gnu.org>
To: 1017 <at> debbugs.gnu.org
Subject: Re: bug#1017 closed by Glenn Morris <rgm <at> gnu.org> (Re: bug#1017:
 vc-diff for the hg backend ignore diff switches variables)
Date: Fri, 21 Nov 2008 14:15:05 +0100
Thank you for correcting this bug and sorry for not checking myself.  I
still cannot find the time to do it, but I eventually will and let you
know.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Fri, 19 Dec 2008 15:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.