Add an interface to create subrepositoires
Created originally on Bitbucket by AngelEzquerra (Angel Ezquerra)
Now that there is subrepo suport (both in Mercurial and TortoiseHg), I think that the TortoiseHg interface needs to give some level of access to the creation and handling of subrepositories.
Currently it seems that the only way to add a subrepository is to manually create an ".hgsub" file. This is problematic in windows because windows explorer does not let you create a file whose name starts with a "." (such as ".hgsub"). Also, the syntax of the hgsub file, while not particularly complex, requires you to manually write the repository to which the subrepo points to.
In addition, once you have added one or more subrepos to a repository, there is no way to tell through TortoiseHg's interface, nor there is a way to manage those subrepositories.
So I'd like to propose a few things that would make working with subrepositories much better:
Subrepository folders could have their own "subrepo" overlay to make it easier to distinguish them from regular folders.
When right clicking on a subfolder that is inside a repository, and which is a repository on itself, could give you an option to "Create a subrepo", which would automatically create (or modify) an .hgsubfile, adding the corresponding entry, and linking the subrepo to the repository with which the sub repository is set to be synchronized.
You should also be able to remove a subrepo from a repository by right clicking on its top folder and selecting "Remove subrepo".
When a repository contains subrepositories, there could be a tool that lets you see the subrepository hierarchy (since there could be subrepos containing subrepos) as a tree. In this tool you could see the revision to which each subrepo points to and perhaps even access the repository explorer for each of those subrepos. It could even show you the status of each subrepo (in terms of uncommited files, etc). This tool could be accessible from the top repository Revision Explorer, for instance.
Cloning a repository that contains subrepositories should automatically clone those subrepositories to the selected revisions.
When committing, if there is a version change on any of the subrepositories, the default commit message could include that information.
There are other minor enhancements that could be done. For instance the repository explorer could have an option to mark with some sort of icon or comment those revisions that have changes on the subrepository versions.
I know that there are already a few enhancement requests regarding subrepos (such as #338 (closed) and #507 (closed)) but I think these go a bit beyond them. My proposal is to make subrepos as accessible as possible.
I firmly believe that subrepo support is the only thing that is holding back Mercurial adoption in the enterprise, since in order to handle many complex projects, involving many different modules that are interrelated with each other, you must have a way to explicitly link them and in particular link them to particular revisions of each other. Currently there are some ways to handle this situation, but none is very good or very straight forward.
In my company we are unlucky enough to use Rational ClearCase. When I discuss Mercurial with the people in charge of handling the Source Control Systems the main (perhaps the only?) advantage of ClearCase that they mention is its support for handling inter-related modules. Having robust subrepo support in TortoiseHg would basically make that advantage moot.
I made this request a proposal, since its scope is quite large. If you want I could split it into several separate requests for each of the items that I have proposed here.
I put this under hgtk although in my opinion it should have its own section (subrepos).