From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#1017: vc-diff for the hg backend ignore diff switches variables Date: Sat, 27 Sep 2008 21:59:24 -0400 Message-ID: References: Reply-To: Glenn Morris , 1017@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222569013 26866 80.91.229.12 (28 Sep 2008 02:30:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Sep 2008 02:30:13 +0000 (UTC) Cc: 1017@emacsbugs.donarmstrong.com To: Francesco Potorti` Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 28 04:31:10 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kjm3u-0007IA-LZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Sep 2008 04:31:06 +0200 Original-Received: from localhost ([127.0.0.1]:35693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kjm2r-0005R4-T2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Sep 2008 22:30:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kjm2o-0005Qz-0N for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2008 22:29:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kjm2n-0005Qk-CM for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2008 22:29:57 -0400 Original-Received: from [199.232.76.173] (port=60614 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kjm2n-0005Qh-77 for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2008 22:29:57 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47899) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kjm2m-0002lS-PY for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2008 22:29:57 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8S2Tsj9023073; Sat, 27 Sep 2008 19:29:54 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8S2A4il018452; Sat, 27 Sep 2008 19:10:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Glenn Morris Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 28 Sep 2008 02:10:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1017 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1017-submit@emacsbugs.donarmstrong.com id=B1017.122256729816380 (code B ref 1017); Sun, 28 Sep 2008 02:10:04 +0000 Original-Received: (at 1017) by emacsbugs.donarmstrong.com; 28 Sep 2008 02:01:38 +0000 Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8S21ZZI016373 for <1017@emacsbugs.donarmstrong.com>; Sat, 27 Sep 2008 19:01:36 -0700 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KjlZE-0007cE-RI; Sat, 27 Sep 2008 21:59:24 -0400 X-Spook: Serbian FTS2000 Telex Iran Saddam Hussein offensive X-Ran: Q\:1K(S-D(2b?JWHSl>t,{bjLlhU`pWA>w,FiuMSUXoF0iOq:KV]6m6]b)F%e=x%wYBpj; X-Hue: red X-Attribution: GM In-Reply-To: (Francesco Potorti`'s message of "Tue, 23 Sep 2008 16:57:24 +0200") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 27 Sep 2008 22:29:57 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20841 Archived-At: 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)