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 250421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:30:35+00:00 2026-05-11T21:30:35+00:00

I have a platform neutral mercurial code repo called Simulator and want to apply

  • 0

I have a platform neutral mercurial code repo called “Simulator”

and want to apply patches that target specific platform’s optimizations before a build.

According to the guide we can accomplish this by the use of patches with guards.

  • Windows Experimental.patch +windows
  • Unix Experimental.patch +unix
  • Mac Experimental.patch +mac

However its starting to get cumbersome because our patch queue contains 100+ patches named like windows-memory-optimization.patch +windows, unix-memory-optimization.patch +unix, windows-io-experimental-bug-fix.patch +windows, etc etc. We organized it as groups in the series file, but the file is getting huge and using qseries / qapplied is getting unmanageable

Instead we would like to have a queue for windows, unix and mac.

So that patches can be organized as:

  • Windows Patch Stack: memory-opt.patch, io-opt.patch, etc
  • Unix Patch Stack: disk.patch, graphics.patch, etc
  • Mac Patch Stack: io-fix.patch, io-opt.patch, experimental.patch, etc

Then swap the patch stacks for each platform in and out of the simulator repo. So that I can work on the windows patch stack and pop/push various subsystem optimization patches and work on them independently of the unix or mac patch stacks.

It does not look like I can do that, other than making 3 different repos specific to the each platform and maintaining the patch stacks that way.

Is there a way to, other than manually copying the .hg/patches directory in and out of the repo, to accomplish “swapping” patch stacks?

  • 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-11T21:30:35+00:00Added an answer on May 11, 2026 at 9:30 pm

    Interesting use of Mercurial Queues 🙂

    I assume here that you are already versioning your mercurial queues somewhere. If you don’t/for those that don’t know how to do this, have a look at the relevant section from the hgbook: it’s a great way to collaborate/save incrementally your work without applying the patches.

    Three named branches

    It should be possible to maintain three different named branches, one for each platform, in your MQ repository.

    To switch platform, just switch the active branch.

    (with alias mq='hg -R $(hg root)/.hg/patches')

    First create a windows branch:

    $ mq branch windows
    marked working directory as branch windows
    

    created, but not yet committed.

    Do some stuff, add patches:

    $ hg qnew windowspatch
    ... do some stuff
    

    Refresh, pop and commit:

    $ hg qref
    $ hg qpop -a
    $ mq ci -m 'new windows branch'
    

    You now have the default branch and the new windows branch:

    $ mq branches
    windows                       65:5fd4ef0b96c9
    default                       64:06c1a56a3c08 (inactive)
    

    Now create an Unix branch.

    First switch back to the base default branch:

    $ mq up default
    1 files updated, 0 files merged, 1 files removed, 0 files unresolved
    

    Create a new unix branch and add a unix-specific patch:

    $ mq branch unix
    marked working directory as branch unix
    $ hg qnew unixpatch
    ... blahblah
    $ hg qref
    $ hg qpop -a
    $ mq ci -m 'adding unix branch'
    $ mq branches
    unix                          66:c51bb2c7b413
    windows                       65:5fd4ef0b96c9
    default                       64:06c1a56a3c08 (inactive)
    

    Usage

    Don’t forget to qpop -a before operating on the mq repos…

    Push all the windows patches

    $ mq up windows
    xx files updated, yy files merged, zz files removed, ww files unresolved
    $ hg qpush -a
    

    Three physical repos

    Maintaining three separate (mercurial queue) branches can look a bit scary. If so, you can just use three different MQ repositories: one for each platform, each of them versioned in a different place.

    For example :

    $ cd mqs
    $ hg qclone mq-windows windows
    $ hg qclone mq-unix unix
    $ hg qclone mq-mac mac
    

    To work on different platforms, just switch folders (repos). The concept is similar to the first approach. But instead of having three internal branches in one MQ repo, you use three separate MQ repos.

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

Sidebar

Related Questions

Imagine you have a NB Platform application and you would like to use that
I have created a Windows CE6 Image through Platform Builder, and I now want
I have a PHP Platform that I've built. I use a copy of that
Is Runtime.getRuntime().exec(cmd /c); platform independent or I have to pass platform specific command in
We have a platform component (written in Java) that now shall be backward compatible
I have a cross platform product that gets deployed to several Linux distros and
I've found ActiveMQ that use for message broker and that's good for cross-platform Have
In writing an install script, I quickly found that I'd have cross-platform issues, and
I know that the Windows platform have windows API from Microsoft, and Mac get
I have a platform that is up to 14 branded applications now. I am

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.