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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:30:27+00:00 2026-05-20T04:30:27+00:00

We have our project stored in subversion in following way: trunk (main development goes

  • 0

We have our project stored in subversion in following way:

  • trunk (main development goes here)
  • branches
    • stable (production version of software)
    • internal (old, internal version of software is kept here and only very rarely new code is commited here)

How should I organize my mercurial repostories to host it? I have created three repositories, one for trunk and one for each branch as central servers, but since mercurial has branches, than maybe I am doing it wrong. At least it feels wrong, but when I tried to push single changeset from development local repo to stable local repo it pushed all my new changesets. That’s not what I wanted.

EDIT1

I had revision 623 in trunk and 620 in stable. I wanted to push only changeset 623 to stable. I tried hg push -r623 ../stable, but hg informed me, that 4 changesets were pushed.

  • 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-20T04:30:28+00:00Added an answer on May 20, 2026 at 4:30 am

    Ok, let’s tackle this one question at a time.

    Note that for layout and organization, there’s many ways to do this, and the only person to really decide is you.

    My advice, however, with the workflow you’ve outlined in your comment, is to use one repository for default and stable, using named branches for the two.

    As for the old code, I would keep that in a separate repository, and just merge in whatever you need from the primary one, if you need to do that.

    As such, here’s how I would organize it:

    • Primary repository
      • default branch (you always have this in Mercurial), this is what you previously called trunk
      • stable branch (this is similar to your stable branch from before)
    • Old-code repository
      • default branch, pulled from the primary repository
      • “old” branch, the old code, you can then easily merge from default to old when you need to
        • if you don’t need to merge from default to old, put all the old code in the default branch and don’t create a named branch for the old code

    Focusing on the primary repository, this gives you the following abilities:

    • You can update back and forth in a single working folder between default and stable
    • You can easily diff across branches
    • You can easily merge from one branch to another, both ways
    • Tags are global, visible all the time

    The last question is, how can you cherry-pick changesets when merging.

    Well, you can’t. Merging merges the changeset you picked + all its ancestors. That’s how merging does in Mercurial.

    There’s two ways to mitigate this:

    • transplant extension
    • commit the changeset elsewhere to begin with

    The transplant extension allows you to take one or more changesets out of one branch, and copy them (transplant them) onto another branch. The changesets will be tagged as transplanted, so future merges will not trip over this. The problem, however, is that other than whatever you add to the commit messages, there’s no visible lines in the graphical log to indicate this is what you did.

    The other approach, to commit the changeset elsewhere, is probably best described with an example.

    Let’s assume you have the following two branches:

    default:  1--2--3--4--5--6
               \
    stable:     x--y--z
    

    Now, you want to commit changeset 7 on top of changeset 6 in default, and then “merge” only that changeset, and not 2-5, onto the stable branch, and as I said, merge won’t do that.

    What you can do instead is find the previous common ancestor, 1 in this case, commit the new changeset on top of that changeset, in effect getting this repository log:

    default:  1--2--3--4--5--6
      |       |\
      +---    | 7
               \
    stable:     x--y--z
    

    Then you can merge the 7th changeset onto stable and default:

    default:  1--2--3--4--5--6--7
      |       |\               /
      +---    | 7------+------+
               \        \
    stable:     x--y--z--7
    

    Here’s how TortoiseHg shows that last repository, I just moved the labels:

    TortoiseHg display

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

Sidebar

Related Questions

In our project, we have all DB manipulations concentrated in Oracle stored procedures. Result
We have this constant discussion in our project as to the granularity of our
Our project is held in a SourceSafe database. We have an automated build, which
I have finally got the green light to use Memcached in our project (after
We are currently using unit tests to test our project. We have the majority
In our web application we have a directory which resides outside of the project.
I have been looking into IKVMing Apache's FOP project to use with our .NET
We have CC.NET setup on our ASP.NET app. When we build the project, the
We have similar code to the following in one of our projects. Can anyone
Most of our Eclipse projects have multiple source folders, for example: src/main/java src/test/java When

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.