简体   繁体   中英

How to show history and ancestor changes between two revisions in Mercurial

Consider the following TortoiseHg graph:

乌龟图

We wish to obtain the revision history between two versions of our code, those with tags 5.5.82 and 5.5.83. Use of the hg log feature is simple enough, but it leaves some things out and this is not complete enough. I suppose it might even include things that were not merged into 5.5.83, if they existed as revisions on isolated branches between 5.5.82 and 5.5.83.

For example: revision 114. It includes the comment associated with that commit, but there is nothing interesting in that comment - it is just the standard "Merge with x" comment.

Is there a way to run hg log such that it will only list the changes between 5.5.83 and 5.5.82, including things that may be older than 5.5.82 but were merged after 5.5.82? 100, 99, 98, 97, and etc?

What we are looking to do is generate change logs for all of the changes that were made between arbitrary revisions. Is there a way to do that?

Many Thanks

See hg help log . The relevant options you need are:

 -r --rev REV [+]         show the specified revision or revset
 -f --follow              follow changeset history, or file history across
                          copies and renames
 -P --prune REV [+]       do not display revision or any of its ancestors
 -M --no-merges           do not show merges

To see all the revisions contributing to changes between tags 1.0 and 2.0 , skipping merges:

hg log -r 2.0 -fMP 1.0

Using a template parameter and using good revision comments, you can generate something approximating bulleted release notes:

hg log -r 2.0 -fMP 1.0 --template "* {desc}\r\n"

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