Add a small mercurial repository as a sub-directory of a larger one - how?

Arne Babenhauserheide arne_bab at web.de
Sat Aug 25 22:22:13 UTC 2018


Chris Green <cl at isbd.net> writes:

> On Sat, Aug 25, 2018 at 06:17:12PM +0200, Arne Babenhauserheide wrote:
>> 
>> Chris Green <cl at isbd.net> writes:
>> 
>> > 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.
>> 
>> Ah, so you don’t actually want a subrepo, you just want to keep the
>> history?
>> 
> Absolutely!  :-)
>
>> Then:
>> 
> Take any responses with a pinch of salt, I've had a *liitle* bit too
> much to drink - not an ideal approach to software technicalities.
>
>
>> cd path/to/bin/
>> hg mv * bin/
>
> Whatever I do I seem to always get the response:-
>
> abort: with multiple sources, destination must be an existing directory

before you use hg mv, just do 

    mkdir bin

>> hg ci -m "move to subrepo"
>> cd path/to/odin
>> hg pull --force path/to/bin
>> hg merge
>> hg ci -m "merge bin subfolder into odin"
>> 
>> This becomes somewhat cleaner with the convert extension:
>> - replace the hg mv by a convert with a rename filemap
>> - otherwise follow the steps above
>> 
> I think maybe tomorrow would be a good idea!  :-)
>
> Thanks for all your help Arne and I'm sorry I'm not at my brightest
> and best just now!


-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1076 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20180826/97b61690/attachment.asc>


More information about the Mercurial mailing list