tags:

views:

78

answers:

2

What is the easiest way of obtaining the changeset version of a particular file in Mercurial? A similar thing that we did for svn was to run "svn --info" in the command line and then obtain the Revision number. Is there any similar approach for Mercurial?

+1  A: 

Simplest is hg log -l1 path/to/file.

tonfa
That shows the last revision that file was changed in, but that doesn't necessary show what revision of that file you have in your working dir, which I think was the question.Oh wait, you're tonfa, clearly you know that. :)
Ry4an
+3  A: 

The concept you're missing is that all files are all the same changeset. Unlike SVN you update your entire working dir, not just folders and files. So you want:

hg id

to get just the rev number and hash, or

hg parents

to get info about the comment your current working dir is at, or

hg summary

for detailed info about what checkout you're at.

Ry4an