I like being able to see what changes will come in on a merge with hg merge --preview
but sometimes I wish I could change the formatting a bit, or show only commits that affect certain files, or commits made by certain people. There appears to be no way to specify a different log output format or to apply any filters when using hg merge --preview
so I wonder if I can somehow get the same list of changesets using hg log
and revsets. If I had that I'm pretty sure I could figure out how to tweak it how I like.
To start a merge between the two heads, we use the hg merge command. We resolve the contents of hello. c This updates the working directory so that it contains changes from both heads, which is reflected in both the output of hg parents and the contents of hello.
The merge process is simple. Usually you will want to merge the tip into your working directory. Thus you run hg merge and Mercurial will incorporate the changes from the tip into your local changes; Tip will then become the second parent revision of your working directory.
A simple way to 'uncommit' your last commit is to use hg strip -r -1 -k. In case the link breaks, the documentation mentioned by @phb states: hg rollback Roll back the last transaction (DANGEROUS) (DEPRECATED) Please use 'hg commit --amend' instead of rollback to correct mistakes in the last commit.
DESCRIPTION. The hg command provides a command line interface to the Mercurial system.
You want all ancestors of the changeset you are merging with, excluding common ones with the parent of your working directory:
$ hg log -r "ancestors(mergerev) - ancestors(.)"
or in short form:
$ hg log -r "::mergerev - ::."
see hg help revsets for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With