[PATCH 1 of 2] phases: add a phase and phasestr method to file context
Kevin Bullock
kbullock+mercurial at ringworld.org
Wed Oct 17 15:13:20 CDT 2012
On Oct 17, 2012, at 2:10 PM, Matt Mackall wrote:
> On Wed, 2012-10-17 at 13:08 -0500, Sean Farley wrote:
>> [referring to filectx]
>> def date(self):
>> return self._changectx.date()
>
> Here, _changectx is one of:
>
> a) the changectx you explicitly used to get here
> b) the changectx of the node you used to get here
> c) the changectx of the filectx's linkrev, if you got here by following
> the file graph
>
> (a) and (b) are trouble-free. So things like
> repo[rev].p1()["somefile"].date() will always do the right thing.
>
> (c) is a changeset that introduced this file revision, but it's not
> guaranteed to be the only one. So repo[rev][file].p1().date() may not be
> what you expect. This is a side effect of the fact that we only store
> one linkrev per file revision.
Sounds like something that at least merits warning inside the function's docstring?
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121017/ceae384f/attachment.html>
More information about the Mercurial-devel
mailing list