Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Mercurial equivalent for showing commits in one branch but not in another?

Tags:

mercurial

In git, I can do the following:

git log foo ^bar

to show changesets in the branch foo but not in the branch bar. Is there a way to do that in Mercurial?

Edit: To explain a little more the use case. Say I have a branch in Mercurial (call it foo) that is branched off of default. What I want to know is what commits are in the foo branch, and therefore haven't been merged to default. Maybe I'm thinking of this the wrong way, but in git, I could start working on foo, merge to master and then work some more on foo and use the command above to see which commits had yet to be merged in.

So a specific use case is knowing whether a branch has been completed merged into default. From using Mercurial, if I start a branch foo off of default to work on one feature, then leave it there so be merged and branch off of foo to create bar, which contains another feature built on top of things in foo, foo ends up being inactive because bar contains all the changesets in foo, but I may want to merge just the changesets in foo because I know those are good while bar is still in development. Hopefully that's helpful.

like image 506
Bialecki Avatar asked Oct 11 '11 15:10

Bialecki


1 Answers

to show changesets in the branch foo but not in the branch bar

hg log -r "::foo and not ::bar and ! destination(branch(bar)) and ! origin(branch(bar))"
like image 59
Justin Avatar answered Oct 30 '22 22:10

Justin