简体   繁体   中英

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.

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM