Mercurial API: How can I get the coming content of the file which was pulled but has not been updated yet?

160 views Asked by At

I'm a complete noob at Mercurial API and Python, but I'm trying to write a useful extension for myself and my colleagues now.

Let's assume I have a repository which contains some code and an auxiliary file .hgdata. The code and .hgdata are both under Mercurial's control. When I execute a command pull-extended which is provided by my extension, I want it to make a pull and then to analyze the state of a .hgdata and probably make some additional actions. The problem is that when my command is invoked, it just pulls the incoming changesets, but it can't look into the actual .hgdata without making a preceding repository update. Is there any way to watch the after update .hgdata besides repository update?

1

There are 1 answers

0
Igor Soloydenko On BEST ANSWER

I've received an answer on the Mercurial's official IRC channel:

In order to get an actual file state after making a pull, we may use repo[revision][file].data().

P.S. I haven't checked that yet. If it works, I will close the question.