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

In git, I can do the following:

git log foo ^bar 

to show changes in the foo branch, but not in the bar branch. Is there a way to do this in Mercurial?

Edit:. Explain a little more. Say I have a branch in Mercurial (name it foo ) that is forked by default . What I want to know is that commits are in foo branches and therefore have not been merged with default . Maybe I'm thinking about it wrong, but in git I could start working on foo , merge to master , and then work on foo and use the command above to find out which commits are there for merging.

Thus, a specific use case is knowing whether a branch was completed merged by default. From using Mercurial, if I launched the foo off default branch to work with one function, leave it there to combine it and separate from foo to create a bar that contains another function built on top of things in foo , foo ends up which is inactive because bar contains all the changes in the foo file, but I might want to merge only the set of changes in foo , because I know that they are good, and bar is still in development. Hope this is helpful.

+8
mercurial
source share
3 answers

Try using revsets ( hg help revsets )

 hg log -r "branch(foo) and not branch(bar)" 

But this is useless, since a set of changes can only be in one named branch at a time.

Perhaps you mean all the ancestors of a bookmark that are not the ancestors of another bookmark?

 hg log -r "::a and not ::b" 

In any case, the settings help page should start with you.

+26
source share

What exactly do you mean by committing in the foo branch, but not in the bar? Obligations are basically only in one branch in mercurial.

 hg log -b foo #lists all commits that are in branch foo 
+9
source share

to display change sets in foo branches, but not in the branch line

 hg log -r "::foo and not ::bar and ! destination(branch(bar)) and ! origin(branch(bar))" 
+1
source share

All Articles