krupan
krupan

Reputation: 3959

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

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.

Upvotes: 5

Views: 625

Answers (1)

Idan K
Idan K

Reputation: 20901

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.

Upvotes: 5

Related Questions