Add a small mercurial repository as a sub-directory of a larger one - how?
Chris Green
cl at isbd.net
Sat Aug 25 15:49:44 UTC 2018
On Sat, Aug 25, 2018 at 12:08:08PM +0200, Arne Babenhauserheide wrote:
> Hi Chris,
>
> Chris Green <cl at isbd.net> writes:
>
> > I have a small mercurial repository (a bin directory on a host called
> > odin) that I want to add in to my main 'keep all my configuration
> > files and scripts' repository.
> >
> > The files from odin's bin directory will live at <root>/odin/bin in
> > the main repository, this will be a new sub-directory.
> >
> > How do I add in this sub-directory and keep the history?
>
> You can simply copy it there and add it to .hgsub; see
> https://www.mercurial-scm.org/wiki/Subrepository
>
That doesn't really do what I want, or at least I don't think it does.
It looks as if I'd forever need to know that it was a sub-repository
within my main repository for Mercurial to work properly with the
files there. It's also a "feature of last resort" and I really don't
see any reason to use it in my situation.
> To ease evolution, you’d likely be best advised to use a shell
> repository: Init a repo at <root> to which you add both odin and bin as
> subrepositories. See
> https://www.mercurial-scm.org/wiki/Subrepository#Use_a_thin_shell_repository_to_manage_your_subrepositories
>
Yes, maybe, but it's still really trying to tell me I shouldn't be
doing this unless there's a very good reason - and there isn't (a good
reason that is).
There are only about a dozen or so files in the odin/bin repository,
if I can't keep their history then I'll just put them into the right
place in the main repository and leave it at that.
Is there a way to import a single file and its history? That would
work OK as there are so few files involved. I've searched for this
and the answers seem rather complicated using ConvertExtension.
--
Chris Green
More information about the Mercurial
mailing list