[PATCH 1 of 2] phases: add a phase and phasestr method to file context

Pierre-Yves David pierre-yves.david at logilab.fr
Wed Oct 17 13:18:20 CDT 2012


On Wed, Oct 17, 2012 at 01:08:35PM -0500, Sean Farley wrote:
> On Wed, Oct 17, 2012 at 12:49 PM, Pierre-Yves David
> <pierre-yves.david at logilab.fr> wrote:
> > On Wed, Oct 17, 2012 at 10:38:40AM -0500, Sean Farley wrote:
> >> On Wed, Oct 17, 2012 at 10:33 AM, Pierre-Yves David
> >> <pierre-yves.david at logilab.fr> wrote:
> >> > On Wed, Oct 17, 2012 at 10:28:20AM -0500, Sean Farley wrote:
> >> >> # HG changeset patch
> >> >> # User Sean Farley <sean.michael.farley at gmail.com>
> >> >> # Date 1350425390 18000
> >> >> # Node ID 072adc076e641990cf0000ece34e9545ebaaa0b3
> >> >> # Parent  72c234081ae1350220132c69750f5a093902a1e7
> >> >> phases: add a phase and phasestr method to file context
> >> >
> >> > Hey? we already have them!
> >>
> >> But not for filecxt :-( ... unless I am missing something about
> >> wanting to call 'ctx.phasestr()' without having to test whether it is
> >> a changectx or filectx?
> >
> > Not that filectx is very deceptive. It usually point to the **first revision**
> > that introduce a content. This revision may be a different revision that the
> > one you care about. With a differrent phase (and different visibility)
> >
> > :-(
> 
> Hmm, then I'm confused how functions like
> 
> def date(self):
>     return self._changectx.date()
> 
> work?

badly

> If self._changectx points to the first revision then wouldn't date() be
> possibly incorrect?

The subtility is about what first revision mean. By "first revision" do you mean:

- First of my ancestors that installed the content I have in revision X

- First revision to have the content in the repo ever ?

  This may be a revision in a totaly unrelated branches, with a **more recent**
  date, difference user, etc.

  It just happen to have the very same content than you.

> Or is it more subtle than that, i.e. is the caller of the function supposed
> to update self._changectx somehow?

The current state is: Broken in a way few people notice and care.

-- 
Pierre-Yves David

http://www.logilab.fr/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121017/28f83159/attachment.pgp>


More information about the Mercurial-devel mailing list