Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6685259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:02:15+00:00 2026-05-26T05:02:15+00:00

In git, I can do the following: git log foo ^bar to show changesets

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:02:15+00:00Added an answer on May 26, 2026 at 5:02 am

    Try using revsets (hg help revsets)

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

    But this is kind of useless as a changeset can only be in one named branch at a time.

    Maybe you mean all ancestors of a bookmark that are not ancestor of another bookmark?

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

    Either way, the revsets help page should get you started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use git log to show all commits that do not match
I can't figure out why git show-branch isn't giving me the same full history
How can I do the following in Git? My current branch is branch1 and
How can I make git show my current node in the log graph? git
Can I embed the following bash shell code: for name in $(git diff --name-only
I understand that Git can be used without a central repository. However, I am
Has anyone got a script for git that can go through the history, check
To search for a string that has been added/removed in git history I can
I periodically get message from git that look like this: Your branch is behind
Possible Duplicate: Show the original branch for a commit git version 1.7.4.1 I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.