[issue363] "hg cat filename" defaults to tip instead of the parent

Rafael Villar Burke pachi at rvburke.com
Thu Sep 7 21:36:54 UTC 2006


El jue, 07-09-2006 a las 13:34 -0500, Dean Roehrich escribió:
> On Thu, Sep 07, 2006 at 07:16:29PM +0200, Rafael Villar Burke wrote:
> > Dean Roehrich wrote:
> > >On Thu, Sep 07, 2006 at 08:32:09AM -0700, Brendan Cully wrote:
> > >  
> > >>Benoit probably meant "parent of the working directory." That is, hg
> > >>cat should default to using the revision that's currently checked out.
> > >>    
> > >
> > >Thanks, that helps.
> > >
> > >In mercurial-speak, does the word 'parent' always refer to a file?  When 
> > >you
> > >say "parent of the working directory" I think of dot-dot; just as "parent 
> > >of
> > >the repo" makes me think of another repo.
> > Parent of the working dir is the parent changeset of the working dir. 
> > When you "update" the repo to a changeset you're changing the working 
> > dir parent.
> 
> So the expression "working dir" is equivalent to terms like "workarea" or
> "workspace", rather than referring to $PWD.
Yes, the Mercurial term can be similar those terms in a different
context.

> Still, I would expect expressions like "parent of the working dir" or "parent
> of the repo" to refer to a repo rather than to a file.
Well, the exact term is 'distate' (and it's the parent changeset of the
working dir). It doesn't refer to a file, it refers to one of the states
of the whole repo... it defines the point in the repo history that's
being shown in the working dir, or, more exactly, the point in history
(changeset) where the next commits will be hanging from. It's the parent
of the next commit (it can have another parent if you do a merge). Have
in mind that every changeset can be a branch point, so the system must
know where it'll be acting for the next commit.

If you like to see Mercurial like a time machine :), the distate
(working dir parent changeset) is just the point in history you're
living on (and you're changing), and where your next commits will have
effect.

Regards,

Rafael Villar Burke




More information about the Mercurial mailing list