cloning with subrepos to an ssh url

Julius Ziegler julius.ziegler at kit.edu
Thu Aug 18 12:37:06 UTC 2011


On 08/17/11 20:32, Kevin Bullock wrote:
> On Aug 17, 2011, at 8:55 AM, Julius Ziegler wrote:
>
>> Hello,
>
> Hi Julius… (replies inline below)

I somehow missed the last two posts by Snidely and Kevin, and can now 
answer to myself. As Kevin suggested, you can clone the subrepos into 
place, and just for completeness, here is how it is done exactly (inline 
below):

>> # setup simple example repo with subrepo
>> hg init dog
>> cd dog
>> hg init cat
>> echo cat=cat>  .hgsub
>> hg add .hgsub
>> cd cat
>> echo meow>  meow
>> hg add meow
>> cd ..
>> hg commit -m"added somthing"

hg clone dog ssh://my_server/repos/dog
hg clone dog/cat ssh://my_server/repos/dog/cat



>> # try to clone this to my_server, via ssh
>> cd ..
>> hg -v clone dog ssh://my_server/repos/dog
>>
>> running ssh my_server "hg init repos/dog"
>> running ssh my_server "hg -R repos/dog serve --stdio"
>> searching for changes
>> 1 changesets found
>> remote: adding changesets
>> remote: adding manifests
>> remote: adding file changes
>> remote: added 1 changesets with 2 changes to 2 files
>>
>> If I now ssh to my_server, the directory repos/dog is there,
>> but it has no working copy:
>>
>> find repos/dog
>>
>> repos/dog/
>> repos/dog/.hg
>> repos/dog/.hg/branchheads.cache
>> repos/dog/.hg/00changelog.i
>> repos/dog/.hg/undo.desc
>> repos/dog/.hg/undo.dirstate
>> repos/dog/.hg/store
>> repos/dog/.hg/store/undo
>> repos/dog/.hg/store/data
>> repos/dog/.hg/store/data/.hgsubstate.i
>> repos/dog/.hg/store/data/.hgsub.i
>> repos/dog/.hg/store/fncache
>> repos/dog/.hg/store/00changelog.i
>> repos/dog/.hg/store/00manifest.i
>> repos/dog/.hg/undo.branch
>> repos/dog/.hg/requires
>
> You'll note here that the subrepo is _also_ absent, which causes the error you mention below.
>
>> Having no working copy is actually the first thing that puzzles me, but this also happens if I do not have any suprepos.
>
> When you're cloning a _local_ repo to a _remote_ location, the assumption is that you're either creating a central 'canonical' repository, or making a backup copy. In either case, you don't need (nor likely want) a remote working copy.
>
> Now note that cloning and pushing don't propagate subrepos; update does, because in order to know what subrepos at what revisions should be present in the outer repo, hg has to read the .hgsub and .hgsubstate files from the _working copy_ (at a particular checked-out revision).
>
> Thus, when you clone local->remote, since the update step is skipped, the subrepos aren't cloned along with the outer repo.
>
> pacem in terris / mir / shanti / salaam / heiwa
> Kevin R. Bullock
>> In that case, however, I can restore the working copy by hg update. But in the case with a subrepo, this gives me:
>>
>> cd repos/dog
>> hg up
>>
>> pulling subrepo cat from /home/ziegler/repos/dog/cat
>> no changes found
>> abort: unknown revision '14aad4f7de9a6a86b282b5de60279e154da63079'!
>>
>> I am really clueless! Why is this not working?
>>
>> Thanks!
>>
>> Julius
>




More information about the Mercurial mailing list