Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get the equivalent of hg merge --preview with hg log and revsets?

Tags:

mercurial

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.

like image 202
krupan Avatar asked Aug 29 '11 20:08

krupan


People also ask

How do you combine two Mercurial heads?

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.

What does hg merge do?

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.

How do you Uncommit in Heartgold?

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.

What is hg command in ubuntu?

DESCRIPTION. The hg command provides a command line interface to the Mercurial system.


1 Answers

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.

like image 132
Idan K Avatar answered Sep 21 '22 20:09

Idan K