From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel,gmane.comp.version-control.mercurial.devel Subject: Re: C-x v i bug Date: Fri, 18 Dec 2009 11:09:19 -0800 (PST) Message-ID: <200912181909.nBIJ9J7A019644@godzilla.ics.uci.edu> References: <200912031604.nB3G4nU1026058@godzilla.ics.uci.edu> <200912031828.nB3IS3xQ027198@godzilla.ics.uci.edu> <87638naci6.fsf@hbox.dyndns.org> <1B794147-1B60-4F5B-A972-09C73F8ECB6E@gmail.com> <200912040534.nB45YkG6002638@godzilla.ics.uci.edu> <200912181554.nBIFspNS017334@godzilla.ics.uci.edu> <1261154998.4629.317.camel@calx> <200912181740.nBIHexE9018620@godzilla.ics.uci.edu> <1261160170.4629.331.camel@calx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1261163552 14965 80.91.229.12 (18 Dec 2009 19:12:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Dec 2009 19:12:32 +0000 (UTC) Cc: Martin Geisler , Neal Becker , mercurial-devel@selenic.com, emacs-devel@gnu.org To: Matt Mackall Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 18 20:12:24 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 1NLiFT-0008Mz-AX for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2009 20:12:23 +0100 Original-Received: from localhost ([127.0.0.1]:33346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLiFT-0007Rk-2a for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2009 14:12:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLiFM-0007No-IR for emacs-devel@gnu.org; Fri, 18 Dec 2009 14:12:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLiFH-0007Cm-LU for emacs-devel@gnu.org; Fri, 18 Dec 2009 14:12:16 -0500 Original-Received: from [199.232.76.173] (port=41563 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLiFH-0007CY-F2 for emacs-devel@gnu.org; Fri, 18 Dec 2009 14:12:11 -0500 Original-Received: from paul-mcgann-v0.ics.uci.edu ([128.195.1.147]:36911) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NLiFH-0003NE-2h for emacs-devel@gnu.org; Fri, 18 Dec 2009 14:12:11 -0500 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nBIJ9KIM011911 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Dec 2009 11:09:20 -0800 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nBIJ9J7A019644; Fri, 18 Dec 2009 11:09:19 -0800 (PST) In-Reply-To: <1261160170.4629.331.camel@calx> (Matt Mackall's message of "Fri, 18 Dec 2009 12:16:10 -0600") Original-Lines: 130 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nBIJ9KIM011911 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.561, required 5, autolearn=disabled, ALL_TRUSTED -1.44, GAPPY_SUBJECT 2.00) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:118723 gmane.comp.version-control.mercurial.devel:27662 Archived-At: Matt Mackall writes: > On Fri, 2009-12-18 at 09:40 -0800, Dan Nicolaescu wrote: > > Matt Mackall writes: > >=20 > > > On Fri, 2009-12-18 at 07:54 -0800, Dan Nicolaescu wrote: > > > > Martin Geisler writes: > > > >=20 > > > > > Dan Nicolaescu writes: > > > > >=20 > > > > > > Let's first talk about the original problem that started = this > > > > > > discussion. > > > > > > > > > > > > When a file in a directory that is under mercurial contro= l is opened > > > > > > in emacs, emacs runs "hg status FILE" so that it knows if= it's > > > > > > registered or not, if it's modified, etc. > > > > > > > > > > > > Any user settings in .hgrc should be irrelevant to the ab= ove. Right? > > > > >=20 > > > > > Right. Many people use the color extension to get better fe= edback from > > > > > 'hg status', but if Emacs sets TERM=3Ddumb, then the extens= ion will > > > > > disable itself. I'm just mentioning color to say that there= are useful > > > > > extensions out there that modify even basic commands like '= hg status'. > > > > >=20 > > > > > > It's desirable that this is as fast as possible, so proce= ssing .hgrc, > > > > > > initializing plugins will just waste time. > > > > > > After that emacs will want to know the version number for= the file, for that > > > > > > it runs "hg log -l1 FILE", and parse it from the output. > > > > > > Any user settings in .hgrc should be irrelevant for this = command. Right? > > > > >=20 > > > > > Right, and it's even quite important that you disable local= ization (run > > > > > hg with LANGUAGE=3DC in the environment). Otherwise you'll = end up parsing: > > > > >=20 > > > > > % hg log -l1 README > > > > > =C3=A6ndring: 9586:a41f2840f9c6 > > > > > bruger: Lee Cantey > > > > > dato: Tue Oct 13 12:27:50 2009 -0700 > > > > > uddrag: README: revert accidental commit > > > > >=20 > > > > > The user could also very well have installed a different de= fault style > > > > > by setting ui.style. On the command line it's done line thi= s: > > > >=20 > > > > Thank you, this was very useful in taking care of some issues i= n emacs. > > > >=20 > > > > > % hg log -l1 README --style=3Dcompact > > > > > 9586 a41f2840f9c6 2009-10-13 12:27 -0700 lcantey > > > > > README: revert accidental commit > > > > >=20 > > > > > > [too bad that the status and version number are not avail= able from a > > > > > > single command...] > > > > >=20 > > > > > Well, you know, files don't really have a version number wi= th modern > > > > > version control systems. The entire tree has a version numb= er... You can > > > > > of course ask about when a file was last touched, but I thi= nk that > > > > > information is getting more and more irrelevant these days. > > > >=20 > > > > In emacs the generic Version Control layer needs a version numb= er in some case. > > > > Here's an example from a bug report: > > > >=20 > > > > cd /tmp > > > > mkdir hgtest2 > > > > cd hgtest2 > > > > hg init > > > > echo foo > foo.txt > > > > hg add foo.txt > > > > hg commit -m "Added foo.txt" > > > > hg branch bar > > > > echo bar > foo.txt > > > > hg commit -m "Changed foo to bar" > > > > hg update -r default > > > > echo frobozz > frobozz.txt > > > > hg add frobozz.txt > > > > hg commit -m "Added frobozz.txt" > > > >=20 > > > >=20 > > > > now open the file mkdir /tmp/hgtest2/foo.txt and ask to see the > > > > annotated version, emacs does that by running > > > >=20 > > > > hg annotate -r REVISION foo.txt > > > > > > > > How can REVISION be obtained in this case? > > > > It should be "0", but > > > > hg log -l1 foo.txt > > > > does not show that... > > >=20 > > > Version numbers are not per-file in Mercurial. The number you sho= uld use > > > is the global number (or numbers!) reported by hg parents. This r= evision > > > is also known as '.', eg 'hg annotate -r . foo.txt'.=20 > >=20 > > . is not usable in all cases. For the example above: > >=20 > > hg log -r . foo.txt=20 > >=20 > > does not work, it does not show anything. >=20 > I just tested it with the above commands and it works at least as far > back as 1.0. cat foo.txt foo $ hg parents foo.txt=20 changeset: 0:1ac3a9e3757e user: blah@blah.com date: Thu Dec 17 08:06:39 2009 -0800 summary: Added foo.txt $ hg log foo.txt=20 changeset: 1:6d88f588d323 branch: bar user: blah@blah.com date: Thu Dec 17 08:06:39 2009 -0800 summary: Changed foo to bar changeset: 0:1ac3a9e3757e user: blah@blah.com date: Thu Dec 17 08:06:39 2009 -0800 summary: Added foo.txt $ hg log -r . foo.txt=20 $ env HGRC=3D hg log -r . foo.txt $ hg --version Mercurial Distributed SCM (version 1.4) Copyright (C) 2005-2009 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This is on an up to date Fedora 12 machine. Is your output different.