tamakisquare
tamakisquare

Reputation: 17067

Mercurial: How do I find the most recent revision that includes a specific file, if possible?

I have a file that's been modified recently. Rather than looking into each revision, is there an easier way to find out, in Mercurial, in which revision the file was last modified? Thanks.

Note that I am using command line in Linux.

Upvotes: 13

Views: 3180

Answers (2)

krtek
krtek

Reputation: 26597

The answer of Autopulated is exactly what you are looking for if you just want to have a look on the last revision for a file.

I just wanted to mention the grep command :

$ hg help grep
hg grep [OPTION]... PATTERN [FILE]...

search for a pattern in specified files and revisions
[...]

With hg grep, you can search a particular file or the whole repository at any revision or range of revision for a particular pattern.

It is the kind of command which is really helpful if you're searching for the revision in which a particular method or variable was introduced or removed for example.

Upvotes: 4

James
James

Reputation: 25523

This will give you the last time a change was made to a particular file (increase 1 to N to see last N changes):

hg log -l 1 ./path/to/file

Upvotes: 20

Related Questions