From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sascha Wilde Newsgroups: gmane.emacs.devel Subject: Re: Un-setting HGRCPATH in vc-hg.el problematic Date: Sun, 01 Aug 2010 17:32:03 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1280680320 31830 80.91.229.12 (1 Aug 2010 16:32:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 1 Aug 2010 16:32:00 +0000 (UTC) Cc: Dan Nicolaescu , Chong Yidong To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 01 18:31:57 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OfbS7-0000Wc-7u for ged-emacs-devel@m.gmane.org; Sun, 01 Aug 2010 18:31:55 +0200 Original-Received: from localhost ([127.0.0.1]:53370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfbS5-00048g-Ll for ged-emacs-devel@m.gmane.org; Sun, 01 Aug 2010 12:31:53 -0400 Original-Received: from [140.186.70.92] (port=58989 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfbOo-0001Kr-1e for emacs-devel@gnu.org; Sun, 01 Aug 2010 12:28:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfaYC-0006bq-SY for emacs-devel@gnu.org; Sun, 01 Aug 2010 11:34:10 -0400 Original-Received: from mail2.sha-bang.de ([78.47.120.114]:44616 helo=mail.sha-bang.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfaYB-0006DL-2s; Sun, 01 Aug 2010 11:34:07 -0400 Original-Received: from kenny.lan.sha-bang.de (xdslci211.osnanet.de [89.166.136.211]) by mail.sha-bang.de (Postfix) with ESMTPSA id 3C8BA565; Sun, 1 Aug 2010 17:32:04 +0200 (CEST) Original-Received: from wilde by kenny.lan.sha-bang.de with local (Sha Bang MUA v.0711184.68) ID 1OfaWB-0008N0-HA; Sun, 01 Aug 2010 17:32:03 +0200 In-Reply-To: (Dan Nicolaescu's message of "Mon, 28 Jun 2010 11:22:30 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:128076 Archived-At: --=-=-= Hi *, sorry for the extreme late reply... Anyway, I created a patch which hopefully resolves my issues while not reintroducing any of the old ones. Dan Nicolaescu wrote: > Sascha Wilde writes: [...] > Setting HGRCPATH was the result of some discussion on the list (here or > the bug list). > > We want to be able to reliably parse the results of hg log regardless > of the users .hgrc settings. In case my attached patch (re)creates any of the problems discussed back then I would be grateful for a pointer to the thread in question. >> So at the moment it looks as if the HGRCPATH='' can be simply removed! > > What happens if the user changes the format of hg log in her .hgrc ? I see only two possible ways how this could happen: alias definitions (also redefining the original command name is discouraged) and default definitions (currently repriced in favor for aliases). My patch addresses them both... >> But there might be some other reasons (Bug#5846 seems to indicate that) >> besides the localization issue for trying to deactivate .hgrc files... As said before: localization is orthogonal to hgrc. And the problem described in the second part of Bug#5846 was really due to the -- meanwhile fixed -- use of an abbreviated hg command in vc-hg-working-revision. So all problems reported in Bug#5846 should stay fixed with my proposed patch. Chong Yidong wrote: > Sascha Wilde writes: >> Maybe Chong Yidong knows some details, as he made the last changes to >> the code in question? > > See Bug#5960. Sorry, but neither does Bug#5960 mention hgrc nor does the related patch include the hgrc related part. So here is my patch, I successfully tested it with an "evil" hgrc redefining 'log' and 'parents'. It would be great if it could be committed to get some wider testing... --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=emacs-vc-hg-hgrc.patch changeset: 109607:955b39955186 branch: wilde tag: tip user: Sascha Wilde date: Sun Aug 01 17:27:24 2010 +0200 files: lisp/ChangeLog lisp/vc/vc-hg.el description: Replaced setting HGRCPATH="" with selective --config options. diff -r 4af5866a5568 -r 955b39955186 lisp/ChangeLog --- a/lisp/ChangeLog Sun Aug 01 06:37:41 2010 +0200 +++ b/lisp/ChangeLog Sun Aug 01 17:27:24 2010 +0200 @@ -1,3 +1,8 @@ +2010-08-01 Sascha Wilde + + * vc/vc-hg.el (vc-hg-state,vc-hg-working-revision): Replaced + setting HGRCPATH to "" by some less invasive --config options. + 2010-08-01 Chong Yidong * emacs-lisp/package.el (package--list-packages): Fix column diff -r 4af5866a5568 -r 955b39955186 lisp/vc/vc-hg.el --- a/lisp/vc/vc-hg.el Sun Aug 01 06:37:41 2010 +0200 +++ b/lisp/vc/vc-hg.el Sun Aug 01 17:27:24 2010 +0200 @@ -170,10 +170,12 @@ (let ((process-environment ;; Avoid localization of messages so we ;; can parse the output. - (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=") + (append (list "TERM=dumb" "LANGUAGE=C") process-environment))) (process-file "hg" nil t nil + "--config" "alias.status=status" + "--config" "defaults.status=" "status" "-A" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. @@ -198,7 +200,7 @@ ((status nil) (default-directory (file-name-directory file)) ;; Avoid localization of messages so we can parse the output. - (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=") + (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C") process-environment)) (out (with-output-to-string @@ -210,6 +212,8 @@ ;; Ignore all errors. (process-file "hg" nil t nil + "--config" "alias.parents=parents" + "--config" "defaults.parents=" "parents" "--template" "{rev}" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. --=-=-= cheers sascha -- Sascha Wilde Wer HTML postet oder gepostetes HTML quotet oder sich gepostetes oder gequotetes HTML beschafft, um es in Verkehr zu bringen, wird geplonkt. --=-=-=--