Subrepos question
Mads Kiilerich
mads at kiilerich.com
Wed Jan 19 17:56:46 CST 2011
Keith Gardner wrote, On 01/19/2011 06:16 PM:
>
> Is there a way to have a subrepo specified in the .hgsub point to a
> named branch? I know that a user can do it with a script afterwards
> but I am looking for native support in mercurial.
>
Yes and no.
The outer repo will always track each subrepo at one specific revision
for each revision in the outer repo, and each revision in the subrepo
will be on a branch (assuming it is a Mercurial subrepo). When a commit
is made in the subrepo it will by default be on the same branch, and
when the subrepo is updated it will by default stay on the same branch.
The branch of a subrepo is thus indirectly and effectively tracked.
You might however be asking for a way to say "whoever checks out the
outer repo should get the latest revision of repo X on branch Y". That
is intentionally not possible with Mercurial. Mercurial is a tool for
controlling versions and ensuring that the working directory content is
tracked and 100% reproducible. Updating to the latest revision (which
then should be tracked) must be done manually or by scripts. There might
be some demand for an extension for automating that, but nobody has
needed it enough to write it.
/Mads
More information about the Mercurial
mailing list