Help with extension writing

Matthew Watson mattw.watson at gmail.com
Wed May 5 01:30:12 CDT 2010


Hi Guys,

Still working on FishEye (http://www.atlassian.com/software/fisheye/)
support for mercurial.

I've got another question, this time around file permission changes.

A permission change seems to make no change to the filerev, but the
file gets added to the changectx.files() - We want to capture that a
change was made to the file (a meta change really) yet in a subsequent
non-perm change to that file, the filectx.p0().linkrev() is not the
commit that changed the perm, it's the commit that last changed the
file content!

Unfortunately, this means that when we try to reconstruct the DAG for
the file, the permission change "revision" is left out on an orphaned
branch and only file content changes are part of the direct
ancestor/predecessor graph.

Is there some way to find the commit in which a file was last changed,
including where its permissions might have changed?

Thanks,
Matt

On 15 April 2010 16:32, Dirkjan Ochtman <dirkjan at ochtman.nl> wrote:
> On Thu, Apr 15, 2010 at 03:28, Greg Ward <greg-hg at gerg.ca> wrote:
>>> One last question: Sometimes when a file has 2 parents, we may want to find
>>> the closest changectx mergepoint for the 2 ancestor revisions (I guess there
>>> could be more than one, but there would be 1 that is closer or as close as
>>> the others) - like changectx.ancestor(self, c2), but for descendants - there
>>> doesn't appear to be one on changectx, is there something like this
>>> elsewhere?
>>
>> Doesn't the linkrev of the parent file revs give what you want?  If
>> memory serves, filectx.parents() returns 1 or 2 other filectxs, each
>> of which has a linkrev().  I believe linkrev() is a revnum in the
>> changelog.  I think that is as close as you're going to get.  If not,
>> can you show us a cooked example where that doesn't work?
>
> It sounds like he's trying to get the common descendant for two
> divergent filerevs.
>
> I don't know about any API we have for that, but maybe someone else
> (Benoit) does?
>
> Cheers,
>
> Dirkjan
>


More information about the Mercurial-devel mailing list