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

  • SEARCH
  • Home
  • 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 6748537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:34:37+00:00 2026-05-26T12:34:37+00:00

I’ve recently started working with MQ as I like the idea of working on

  • 0

I’ve recently started working with MQ as I like the idea of working on isolated patches and committing without affecting the repo until the changeset is refined enough. Before that, I used to work with Mercurial’s shelves extension, but found it a bit unstable. What I’m still trying to figure out in MQ is how to keep patches separate from each other and apply them in no particular order, and across different branches. Here’s my normal flow –

1. Start working on a new patch:

hg qnew fix-bug-1234 -m "fix bug 1234"
# do some work
hg qrefresh

2. Get a new feature/bug to work on:

hg qpop fix-bug-1234
hg qnew some-feature -m "implement feature X"
# some work on feature X (perhaps in a different branch)
hg qrefresh

3. At this point, I’d like to get back to working on bugfix, and put aside the feature work. I thought it’s as simple as:

hg qpop some-feature
hg qpush fix-bug-1234
# wrap up bug fix
hg qfinish fix-bug-1234
# get back to work on feature

However, MQ seems to always use the latest patch created in the series, and apply it regardless of the qpop/qpush command I’m using. I should note that the files I work on are completely separate as well (though they can sometimes be the same).

Am I missing something here? Should I be using hg qqueue for this? Thanks.

  • 1 1 Answer
  • 3 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-26T12:34:38+00:00Added an answer on May 26, 2026 at 12:34 pm

    You could use guards. They allow you to maintain an ordering of patches without rearranging your series file, and selectively apply only a subset of patches, still in a stack-ordered fashion.

    An example in your case would be:

    hg qnew bugfix
    # ..hack hack..
    hg qrefresh
    # want to switch over to working on some feature now
    hg qpop
    hg qnew feature
    # ..hack hack..
    hg qrefresh
    

    At this point, you’re in a situation where patch feature comes before bugfix in your stack. Now you can use guards to select one or the other, and switch between the two:

    hg qpop -a
    hg qguard feature +featureguard
    hg qguard bugfix +bugfixguard
    

    If you want to work on feature:

    hg qselect featureguard
    hg qpush
    applying feature
    now at: feature
    

    If you want to work on bugfix:

    hg qpop -a
    hg qselect bugfixguard
    hg qpush
    applying bugfix
    now at: bugfix
    

    Note that since you selected the positive guard bugfixguard, MQ leap-frogged over feature (because it’s positive guard was different than the one selected) and applied the patch bugfix instead (which did match the selected guard).

    Some useful tools when working with guards are hg qseries -v, which will display a G instead of the usual U for a guarded, unapplied patch, and hg qselect -l which will display the guards associated with each patch.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display

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.