From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#10822: 23.4; `l' in vc-dir with hg backend moves to the first commit Date: Mon, 12 Mar 2012 18:54:40 +0800 Message-ID: References: <87ty2m29wm.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1331549736 13766 80.91.229.3 (12 Mar 2012 10:55:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Mar 2012 10:55:36 +0000 (UTC) Cc: Ivan Kanis , 10822@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 12 11:55:34 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S72uW-0006Jr-5R for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Mar 2012 11:55:28 +0100 Original-Received: from localhost ([::1]:50639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S72uV-00053o-FJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Mar 2012 06:55:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S72uN-00053N-Ic for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2012 06:55:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S72uH-0006cc-31 for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2012 06:55:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S72uG-0006cY-TC for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2012 06:55:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S73N8-0002nw-2H for bug-gnu-emacs@gnu.org; Mon, 12 Mar 2012 07:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Mar 2012 11:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10822 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10822-submit@debbugs.gnu.org id=B10822.133155148810757 (code B ref 10822); Mon, 12 Mar 2012 11:25:01 +0000 Original-Received: (at 10822) by debbugs.gnu.org; 12 Mar 2012 11:24:48 +0000 Original-Received: from localhost ([127.0.0.1]:46137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S73Mt-0002nR-A8 for submit@debbugs.gnu.org; Mon, 12 Mar 2012 07:24:47 -0400 Original-Received: from mail-iy0-f172.google.com ([209.85.210.172]:59718) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S73Mq-0002nJ-LY for 10822@debbugs.gnu.org; Mon, 12 Mar 2012 07:24:46 -0400 Original-Received: by iazz13 with SMTP id z13so6007223iaz.3 for <10822@debbugs.gnu.org>; Mon, 12 Mar 2012 03:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=gT2BAs3GGEL5YLTVeIkzheZ5H+4+sBwCPvw/6wHAwXc=; b=dPTpwHBaasvIbV+Fn7LdB+hQh428pFruyb9ntL4FaI+0fN/5Apm9Pnm2jW75fYCRE/ q38rratGPEHr8Z8aTmYgp/UPNS/uS7W4weut6r4b0HVQRkXgnEK3BcrgdjuiJ7bkc4SX g4wb55stH6MWGazPsOP0mOhUjJANfQ8v+WzzZinFv1khfuATRCnEPVs1Ix2f8JG8qBws OBl9pZSy8KTIkZEwQh4VTNh0D79cu1xV/a3nr5UVRgkk76E929egPTNlswcwWI1B5l0d bnOmm+Ho/Ca6c49ap2cIz1ugmSbqo4af26zhOp0f42BqkT1n49xsQolFT6nV4rDU7PLf kFDQ== Original-Received: by 10.42.131.10 with SMTP id x10mr14880734ics.17.1331549693911; Mon, 12 Mar 2012 03:54:53 -0700 (PDT) Original-Received: from localhost ([114.249.24.219]) by mx.google.com with ESMTPS id pr8sm12081370igb.6.2012.03.12.03.54.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Mar 2012 03:54:51 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUKDAg1NjRWV1V9fnyg op/DxcLk5uP8/voi63ReAAAACXBIWXMAAAWJAAAFiQFtaJ36AAAAB3RJTUUH1goZAgAz00bgXgAA AeVJREFUKM9lk0Fz2jAQhQXJD3CCO70CmcC1YMtcWyTZ14Bl69xats4N9r6/3zWQBlodNKNPu/s0 b1cCQFuZGpfVVh3vAvBJolIXRkapSuoRUtIdFyo1Y5xSdlAj7OtvD1XnXxmWRi+eWgcxyCed1lVV B1CrKyujMoi+eLA5kU1SsjoHlW+nQjTtFxk4MXgrOxvIqzoTZR8XgPaLl419zgsMaSGFPiUOZCIh thsx5Xy9NsK8Kwf/JoQgMxcVJ301HKkcSWaT0O7FY056J4U9xcYfnmVXG4801lW6lqwu2nKFZoHC HuzvaTVndZ+LaRQgZdthXw1cpynEkLEwyFHXk/aIxNQ6QeooJuzPMB+wn+D7JJNsiCcVA13/A3h/ xE9J+WidpAwoYNmRFwyvSRhNVtsdaAewzZZP5uw82QL9+tyNfocyP0McAzICUr5Mk9RdIjWasUNx aIIt6NK4ZtXIMdfMQt3nuMAyWbLI4DqZ4xPq/ag8jPond4XU/cLuOgw6XCFX/YCUfcDAMMH58fD4 G9kDchwfqVefkBwup2uZM+Q4WhJt5jN3AxXCsaS2yXEDuWgS8VOzW0gFjhEPmLyFMKBFaLb1HRwc DiaKwx0EeTMRYnYPQRW3PP4HApvlMv0PttX5v/D6Aws3IOSEwzmLAAAAAElFTkSuQmCC In-Reply-To: <87ty2m29wm.fsf@gnu.org> (Chong Yidong's message of "Sun, 19 Feb 2012 22:08:25 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (Mac OS X 10.6.8) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57710 Archived-At: On 2012-02-19 22:08 +0800, Chong Yidong wrote: > We might as well make it consistent. Patch welcome. It turns out the bug I am seeing is due to the broken vc-hg-working-revision. I intend to install the following fix in the next few days. Could you comment on the this patch? Thanks. === modified file 'lisp/vc/vc-hg.el' --- lisp/vc/vc-hg.el 2012-02-25 04:29:09 +0000 +++ lisp/vc/vc-hg.el 2012-03-12 10:47:55 +0000 @@ -226,45 +226,14 @@ (defun vc-hg-working-revision (file) "Hg-specific version of `vc-working-revision'." - (let* - ((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") - process-environment)) - (out - (with-output-to-string - (with-current-buffer - standard-output - (setq status - (condition-case nil - (let ((process-environment avoid-local-env)) - ;; Ignore all errors. - (process-file - vc-hg-program 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. - (error nil))))))) - (if (eq 0 status) - out - ;; Check if the file is in the 'added state, the above hg - ;; command does not distinguish between 'added and 'unregistered. - (setq status - (condition-case nil - (let ((process-environment avoid-local-env)) - (process-file - vc-hg-program nil nil nil - ;; We use "log" here, if there's a faster command - ;; that returns true for an 'added file and false - ;; for an 'unregistered one, we could use that. - "log" "-l1" (file-relative-name file))) - ;; Some problem happened. E.g. We can't find an `hg' - ;; executable. - (error nil))) - (when (eq 0 status) "0")))) + (let ((default-directory (if (file-directory-p file) + (file-name-as-directory file) + (file-name-directory file)))) + (with-output-to-string + (ignore-errors + (process-file vc-hg-program nil standard-output nil + "log" "-l" "1" "--template" "{rev}" + (file-relative-name file)))))) ;;; History functions