From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Harsanyi Newsgroups: gmane.emacs.devel Subject: incorrect working revision for the mercurial VC backend Date: Wed, 30 Dec 2009 09:53:54 +0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1262138053 9693 80.91.229.12 (30 Dec 2009 01:54:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Dec 2009 01:54:13 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 30 02:54:06 2009 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.50) id 1NPnlF-0002gH-Im for ged-emacs-devel@m.gmane.org; Wed, 30 Dec 2009 02:54:05 +0100 Original-Received: from localhost ([127.0.0.1]:59103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPnlF-00039i-LK for ged-emacs-devel@m.gmane.org; Tue, 29 Dec 2009 20:54:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NPnlB-00039V-0k for emacs-devel@gnu.org; Tue, 29 Dec 2009 20:54:01 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NPnl5-000393-Mn for emacs-devel@gnu.org; Tue, 29 Dec 2009 20:53:59 -0500 Original-Received: from [199.232.76.173] (port=45513 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPnl5-000390-F1 for emacs-devel@gnu.org; Tue, 29 Dec 2009 20:53:55 -0500 Original-Received: from mail-yx0-f191.google.com ([209.85.210.191]:38666) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NPnl5-0007UI-5D for emacs-devel@gnu.org; Tue, 29 Dec 2009 20:53:55 -0500 Original-Received: by yxe29 with SMTP id 29so32964708yxe.14 for ; Tue, 29 Dec 2009 17:53:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=FLBgvSf636RXPEdJvPBTvRMxD8rq61QjkJT1tNZ3Nhk=; b=BDFL5VpgvHqiZ+x/keDo01hOHafsWotP680o3lWB1/Hx80+7mm/g7llYQAI66xg7eL EonTioXXFCI/OXtoE4bskzXzilS27qGpXbPHFc2suqWK72coAlEQiC2ErjOsgMPrFegJ waxuJnk7IrK4PxRzMBfPtQGGnF08F4otSKL3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Z8nZeEMUf4zXCji4+/d4zj8AmdnnAFw0V3CL7PxVyo6EnAxLiOJR2v2CXKgpHC/kgA zKQIwIXHm4FT9ot1kD2rUavOmEQpqc0iz9n50ZmzqG7E7cRpHYer9SFqD8zAhB5YcdA+ 0rUJUkWiSOnj7AubWWAzNr0AxHWdDJLD1O8lE= Original-Received: by 10.151.5.11 with SMTP id h11mr24134385ybi.305.1262138034406; Tue, 29 Dec 2009 17:53:54 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:119000 Archived-At: It seems that `vc-hg-working-revision` is using "hg log -l1 FILE" to obtain the working revision of the file. This only works correctly if the file is at the most recent revision in the workspace. If you update the workspace to a different repository revision using "hg update -r REV", emacs will continue to think that files are at their latest revision. As a side effect, `vc-annotate` will always annotate the latest revision of a file regardless of what the file revision is in the workspace. I believe using the "hg parent" command is more accurate in computing the working revision: hg parent --template "{rev}" FILE Also by using the --template option, the command will return just the revision number, making the `string-match' call unnecessary. Cheers, Alex.