Philip
Philip

Reputation: 3799

How to extract a list of changed files between two mercurial revisions

I need to extract a list of changed files from Mercurial from the last "revision" tag to the current working version instead of the head. The process is part of a batch script, so the current revision bit needs to be automated.

I know that I can get the current revision using:

hg id -n

or

hg parent --template "{rev}\n"

I also know that I can get a list of changed files from a tagged version ("from") like this:

hg st --rev from > file_list.txt

I also know that I can get a list of changed files from a tagged version ("from") to another tagged version ("to") like this:

hg st --rev from --rev to > file_list.txt

However, is there a tag or a way that one can specify the "to" version to be the current working version automatically? I need to be able to exclude the "tip" or "default" files.

This process happens in a DOS batch file, if that helps, and the results are all output to text files.

Upvotes: 1

Views: 1321

Answers (1)

Philip
Philip

Reputation: 3799

Sorry - I got confused about which files actually had changed... The answer is as simple as:

hg st --rev from > file_list.txt

That will list all files that have changed from the named revision to the current working version and NOT the head revision (tip or default).

Upvotes: 4

Related Questions