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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:51:34+00:00 2026-06-09T08:51:34+00:00

Suppose we have the following (Visual Studio) projects (simplified): base-lib-1 base-lib-2 product-1 : depending

  • 0

Suppose we have the following (Visual Studio) projects (simplified):

  • base-lib-1
  • base-lib-2
  • product-1: depending on base-lib-1
  • product-2: depending on base-lib-1 and base-lib-2
  • product-3: depending on base-lib-1 and base-lib-2 and used as a component in product-2
  • product-4: like product-3

I wondered what would be a good way to organize this project structure in one or multiple Mercurial repositories. We currently use Subversion and include the dependent libraries as externals.

Now one way would be to put everything but product-1 in a single repository as all those products are always released together as a single package. I would feel most comfortable with this solution as then I would be pretty sure about how to handle the repository. But how would fit product-1 in this scheme without duplicating base-lib-1?

As an alternative I thought about using sub repositories that would be organized something like this:

  • product-package-A
    • base-lib-1
    • product-1
  • product-package-B
    • base-lib-1
    • base-lib-2
    • product-2
    • product-3
    • product-4

The problem with this approach is that I’ve never used subrepos so I’m not sure about any pitfalls that would arise with this solution.

For example, do the subrepos behave like SVN externals in that you can decide whether to always use the latest or a fixed revision of each subrepo?

How do subrepos behave if you make changes e.g. in base-lib-1 and product-2 at the same time? Are those handled by Mercurial in the same step or do you have to commit/push and pull/update everything manually? And how would the subrepo of base-lib-1 behave in product-package-A in this case?

How does branching work in this scenario if I want to develop a new feature branch that requires changes in multiple subrepos? Do I have to branch and merge every repository manually or is this handled by Mercurial?

Are there any other pitfalls about using subrepos to organize a large project? What is the preferred way of handling larger projects with many dependencies in Mercurial?

  • 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-06-09T08:51:38+00:00Added an answer on June 9, 2026 at 8:51 am

    Your question is a near-perfect duplicate of a question that’s often asked here, but I can’t find a good reference in a quick search, so here you go: use the subrepos

    Taking your sub-questions one at a time:

    For example, do the subrepos behave like SVN externals in that you can
    decide whether to always use the latest or a fixed revision of each
    subrepo?

    Sub-repos are pegged to a specific version, and the parent project specifies which.

    How do subrepos behave if you make changes e.g. in base-lib-1 and
    product-2 at the same time? Are those handled by Mercurial in the same
    step or do you have to commit/push and pull/update everything
    manually? And how would the subrepo of base-lib-1 behave in
    product-package-A in this case?

    The hg commit comma?
    nd takes a --subrepos option, so you can recursively commit or not at your option (see all ui.commitsubrepos in man hgrc). Push always pushes subrepo changes.

    How does branching work in this scenario if I want to develop a new
    feature branch that requires changes in multiple subrepos? Do I have
    to branch and merge every repository manually or is this handled by
    Mercurial?

    Yes, you’ll be branching and merging in each repo manually.

    Are there any other pitfalls about using subrepos to organize a large
    project? What is the preferred way of handling larger projects with
    many dependencies in Mercurial?

    Just do a test scenario first and practice. Also, make sure people have new-ish clients. This stuff didn’t really get polished UI-wise until 2.1.x

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

Sidebar

Related Questions

Suppose I have a C++ project in Visual Studio 2010 in Windows 7 with
I have the following question: Does Microsoft Visual Studio (I'm using 2008 SP1) offer
suppose I have following test/ Main.py test/one/ One.py test1.txt test/two/ Two.py test2.txt What I
Suppose I have following code package memoryleak; public class MemoryLeak { public static int
Possible Duplicate: Are file descriptors shared when fork()ing? Suppose I have following code in
Suppose I have the following simple struct: struct Vector3 { double x; double y;
Suppose I have the following js code: r='d|daa|dd'; reg = /\|.*/; result = reg.exec(r);
suppose I have the following matrix a = 2 NaN NaN 4 NaN 3
Suppose I have the following list: ID3_tag = ['Title','Artist','Album','Track'] And I have a file
Suppose I have the following directory structure in Vim's NERDTree: /some/folder/ |-apples.txt |-bananas.txt |-

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.