Subdirectory clone

Sivaraj sivaraj at mcci.com
Thu Feb 9 13:04:49 UTC 2012


On 2/9/2012 5:40 PM, Kastner Masilko, Friedrich wrote:
>> From: Sivaraj [mailto:sivaraj at mcci.com]
>>
>> I meant, suppose we have the repository structure as I mentioned earlier in the server, I want to convert all
>> the subdirectories to subrepos in that same repo itself on the server. Is that possible? This is what I meant.
>> If it is possible, then can you please list the procedure?
> I already did that, but it was perhaps not clear enough. Let me try again.
>
> I'll start with an already CVS->HG converted repository in /repos/orig, because the CVS conversion itself is a big step. I suppose you did that already, as mentioned in your first email.
>
> So if your directory structure (NOT repository structure!) looks like that:
>
>> main
>>     |
>>     |- .hg
>>     |- subdir1
>>     |    |- subdir11
>>     |    |- subdir12
>>     |    |    |- subdir121
>>     |    |    |- subdir122
>>     |- subdir2
>>     |    |- subdir21
>>     |    |- subdir22
>>     |- subdir3
> ...and you want EXACTLY that (notice the missing .hgsub in subdir2 and subdir12, as it serves no purpose!):
>
>> main
>>     |
>>     |- .hg
>>     |- subdir1
>>     |    |- .hg
>>     |    |- subdir11
>>     |    |- subdir12
>>     |    |    |- .hg
>>     |    |    |- subdir121
>>     |    |    |- subdir122
>>     |    |- .hgsub
>>     |- subdir2
>>     |    |- .hg
>>     |    |- subdir21
>>     |    |- subdir22
>>     |- subdir3
>>     |- .hgsub
> You can do it like so:
>
>    cd /repos
>    echo exclude subdir1>  filemap
>    echo exclude subdir2>>  filemap
>    hg convert --filemap filemap orig new
>    echo include subdir2>  filemap
>    echo rename subdir2 .>>  filemap
>    hg convert --filemap filemap orig new/subdir2
>    echo include subdir1>  filemap
>    echo exclude subdir12>>  filemap
>    echo rename subdir1 .>>  filemap
>    hg convert --filemap filemap orig new/subdir1
>    echo include subdir1/subdir12>  filemap
>    echo rename subdir1/subdir12 .>>  filemap
>    hg convert --filemap filemap orig new/subdir1/subdir12
>    rm filemap
>    cd new/subdir1/subdir12
>    hg up
>    cd ..
>    hg up
>    echo subdir12 = subdir12>  .hgsub
>    hg add .hgsub
>    cd ..
>    hg up
>    echo subdir1 = subdir1>  .hgsub
>    echo subdir2 = subdir2>  .hgsub
>    hg add .hgsub
>    hg commit -Sm "converted to subrepos"
>    cd ..
>    mv orig old
>    mv new orig
>
> This makes everyone who clones the orig repo the same checkout directory structure as before (plus the .hg, .hgsub and .hgsubstate files, of course). But - as mentioned before - this is not a complete conversion, as checking out e.g. the first revision in the subdir1 subrepo will NOT show the subdir12 content, because that reference information was done with the single commit you see in the above recipe.
Ok, thanks a lot for these details, this is really informative and of 
great help.
So, now I understand it still is an incomplete conversion as you said 
and may not suit for what we are thinking to have. So the possible (and 
likely the only complete) solution would be having separate repos perhaps?

>
>> 5.7GB is the actual CVS repository size.
> And how big is the .hg/store folder of your original HG conversion repo?
Actually I was experimenting with some of the modules initially before 
going for the whole repo conversion. For a 2.3GB CVS repo module, the 
converted HG repo .hg/store size is ~1.2GB, and for a 737MB CVS repo 
module, the converted HG repo .hg/store size is ~317MB (and it took 
~4Hrs for the 737MB repoconversion on a P4 3GHZ + 1GB RAM machine).

Thanks,
Sivaraj

>
> regards,
> Fritz
>
>
> Development Software Systems
> Festo Gesellschaft m.b.H.
> Linzer Strasse 227
> Austria - 1140 Wien
>
> Firmenbuch Wien
> FN 38435y
> UID: ATU14650108
>
> Tel: +43(1)91075-198
> Fax: +43(1)91075-282
> www.festo.at
>
> Der Inhalt dieses E-Mails ist ausschliesslich fuer den bezeichneten Adressaten bestimmt. Jede Form der Kenntnisnahme,
> Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieses E-Mails durch unberechtigte Dritte ist unzulaessig. Wir
> bitten Sie, sich mit dem Absender des E-Mails in Verbindung zu setzen, falls Sie nicht der Adressat dieses E-Mails sind und das
> Material von Ihrem Computer zu loeschen.
>
> This e-mail and any attachments are confidential and intended solely for the addressee. The perusal, publication, copying or
> dissemination of the contents of this e-mail by unauthorised third parties is prohibited. If you are not the intended recipient of this
> e-mail, please delete it and immediately notify the sender.
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20120209/f7f5ce87/attachment-0002.html>


More information about the Mercurial mailing list